]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/leaflet.map.js
Only add traces for POST requests
[rails.git] / app / assets / javascripts / leaflet.map.js
index 5a0c5521d2a8942ffdb985ca509781e1ac6018a0..4b50cc78c4ca0660b3ff5cfe484b95a53e417b94 100644 (file)
@@ -57,6 +57,7 @@ L.OSM.Map = L.Map.extend({
     this.dataLayer.options.code = 'D';
 
     this.gpsLayer = new L.OSM.GPS({
+      pane: "overlayPane",
       code: "G",
       name: I18n.t("javascripts.map.base.gps")
     });
@@ -210,16 +211,15 @@ L.OSM.Map = L.Map.extend({
       clickable: false
     };
 
-    this._object = object;
-
-    if (this._objectLoader) this._objectLoader.abort();
-    if (this._objectLayer) this.removeLayer(this._objectLayer);
+    this.removeObject();
 
     var map = this;
     this._objectLoader = $.ajax({
       url: OSM.apiUrl(object),
       dataType: "xml",
       success: function (xml) {
+        map._object = object;
+
         map._objectLayer = new L.OSM.DataLayer(null, {
           styles: {
             node: objectStyle,