Przeglądaj źródła

Map fix add feature

Piotr Labudda 11 lat temu
rodzic
commit
1eac600d47
2 zmienionych plików z 18 dodań i 2 usunięć
  1. 1 1
      SE/VERSION
  2. 17 1
      SE/se-lib/TableAjaxMap.php

+ 1 - 1
SE/VERSION

@@ -1 +1 @@
-3.9.8.4
+3.9.8-5

+ 17 - 1
SE/se-lib/TableAjaxMap.php

@@ -209,7 +209,23 @@ OpenLayers.ProxyHost = "index-ajax.php?_zasobID=<?php echo $this->_zasobID; ?>&_
 				})
 			});
 
+			// @doc OpanLayers events http://dev.openlayers.org/docs/files/OpenLayers/Layer/Vector-js.html#link33
 			_layer.events.on({
+				'sketchcomplete': function(e) {// turn off cluster strategy on start drawing
+					if (priv.options.debug) console.log('Event: sketchcomplete e.feature.attributes: ', e.feature.attributes, '; selAttras', (_selectedFeature)? _selectedFeature.attributes : 'null');
+					if (priv.isSelectedRecordId()) {
+						e.feature.attributes._newRecordId = priv.getSelectedRecordId();
+					}
+				},
+				'sketchstarted': function(e) {// turn off cluster strategy on start drawing
+					if (priv.options.debug) console.log('Event: sketchstarted e.feature.attributes: ', e.feature.attributes, '; selAttras', (_selectedFeature)? _selectedFeature.attributes : 'null');
+					_layer.strategies[1].deactivate();
+					_layer.refresh({force:false});
+				},
+			//	'beforefeatureadded': function(e) {
+			//		if (priv.options.debug) console.log('Event: beforefeatureadded e.feature.attributes: ', e.feature.attributes, '; selAttras', (_selectedFeature)? _selectedFeature.attributes : 'null');
+			//		if (priv.options.debug) console.log('Event: beforefeatureadded attr.count(' + e.feature.attributes.count + ')')
+			//	},
 				'beforefeaturemodified': function(e) {
 					if (priv.options.debug) console.log('Event: beforefeaturemodified modified(', e.feature.attributes._modified, ')', e.feature.attributes, ' selAttras', (_selectedFeature)? _selectedFeature.attributes : 'null');// TODO: DBG
 					// NOTE: beforefeaturemodified from new node is fired before afterfeaturemodified from old node when click from one node to enother
@@ -401,7 +417,7 @@ OpenLayers.ProxyHost = "index-ajax.php?_zasobID=<?php echo $this->_zasobID; ?>&_
 
 			_map.events.register("zoomend", this, function(e) {
 				var zoom = _map.getZoom();
-				//console.log('zoom(',zoom,', ',priv.options.zoomStrategyActivate,')');
+				if (priv.options.debug) console.log('zoom(',zoom,', ',priv.options.zoomStrategyActivate,')');
 				if (zoom > priv.options.zoomStrategyActivate && _layer.strategies[1].active) {
 					_layer.strategies[1].deactivate();
 					_layer.refresh({force:true});