[Commits] r2566 - sandbox/cmoullet/ux/GeolocationAPI/lib/GeoExt.ux/control

commits at geoext.org commits at geoext.org
Sun Jan 16 19:31:57 CET 2011


Author: cmoullet
Date: 2011-01-16 19:31:57 +0100 (Sun, 16 Jan 2011)
New Revision: 2566

Modified:
   sandbox/cmoullet/ux/GeolocationAPI/lib/GeoExt.ux/control/GeolocationAPI.js
Log:
Better management of vector layer

Modified: sandbox/cmoullet/ux/GeolocationAPI/lib/GeoExt.ux/control/GeolocationAPI.js
===================================================================
--- sandbox/cmoullet/ux/GeolocationAPI/lib/GeoExt.ux/control/GeolocationAPI.js	2011-01-16 06:25:09 UTC (rev 2565)
+++ sandbox/cmoullet/ux/GeolocationAPI/lib/GeoExt.ux/control/GeolocationAPI.js	2011-01-16 18:31:57 UTC (rev 2566)
@@ -178,7 +178,9 @@
             this.activateTracking();
         }
         if (this.displayPosition || this.displayAccuracy) {
-            this.map.addLayers([this.vector]);
+            if (this.vector.name == 'GeolocationAPIVector') {
+                this.map.addLayers([this.vector]);
+            }
         }
         return OpenLayers.Control.prototype.activate.apply(this);
     },
@@ -195,7 +197,9 @@
         this.stopTracking();
         if (this.displayPosition || this.displayAccuracy) {
             this.removeFeatures();
-            this.map.removeLayer(this.vector);
+            if (this.vector.name == 'GeolocationAPIVector') {
+                this.map.removeLayer(this.vector);
+            }
         }
         return OpenLayers.Control.prototype.deactivate.apply(this);
     },



More information about the Commits mailing list