Pārlūkot izejas kodu

Map zoom strategy active on higher zoom

Piotr Labudda 11 gadi atpakaļ
vecāks
revīzija
21d419612e
3 mainītis faili ar 7 papildinājumiem un 3 dzēšanām
  1. 1 1
      SE/VERSION
  2. 1 0
      SE/se-lib/TableAjax.php
  3. 5 2
      SE/se-lib/TableAjaxMap.php

+ 1 - 1
SE/VERSION

@@ -1 +1 @@
-3.9.8.2
+3.9.9

+ 1 - 0
SE/se-lib/TableAjax.php

@@ -1712,6 +1712,7 @@ class TableAjax extends ViewAjax {
 				//debug: true,
 				wpsUrl: 'http://biuro.biall-net.pl/wps',
 				wfsUrl: 'http://biuro.biall-net.pl/wps',
+				zoomStrategyActivate: 14,
 				layerName: '<?php echo $this->getLabelHtml(); ?>',
 				onSaveFeature: function(selectedRecordId, selectedFeatureExtent) {
 					console.log('onSaveFeature (',selectedRecordId,'/',selectedFeatureExtent,') ', this);

+ 5 - 2
SE/se-lib/TableAjaxMap.php

@@ -63,6 +63,7 @@ OpenLayers.ProxyHost = "index-ajax.php?_zasobID=<?php echo $this->_zasobID; ?>&_
 			wpsUrl: '',
 			wfsUrl: '',
 			layerName: 'Warstwa rysowania',
+			zoomStrategyActivate: 15,
 			debug: false
 		};
 
@@ -100,6 +101,7 @@ OpenLayers.ProxyHost = "index-ajax.php?_zasobID=<?php echo $this->_zasobID; ?>&_
 			_nodeOutput = $('<div></div>');
 			_selectedFeature = null;
 			_selectedRecordId = 0;
+			priv.options.zoomStrategyActivate = (priv.options.zoomStrategyActivate > 0)? priv.options.zoomStrategyActivate : 15;
 
 			var div = $('<div></div>');
 			div.append(_nodeProcesses);
@@ -382,10 +384,11 @@ OpenLayers.ProxyHost = "index-ajax.php?_zasobID=<?php echo $this->_zasobID; ?>&_
 
 			_map.events.register("zoomend", this, function(e) {
 				var zoom = _map.getZoom();
-				if (zoom > 15 && _layer.strategies[1].active) {
+				//console.log('zoom(',zoom,', ',priv.options.zoomStrategyActivate,')');
+				if (zoom > priv.options.zoomStrategyActivate && _layer.strategies[1].active) {
 					_layer.strategies[1].deactivate();
 					_layer.refresh({force:true});
-				} else if (zoom <= 15 && !_layer.strategies[1].active) {
+				} else if (zoom <= priv.options.zoomStrategyActivate && !_layer.strategies[1].active) {
 					_layer.strategies[1].activate();
 					_layer.refresh({force:true});
 				}