diff --git a/dist/recline.js b/dist/recline.js index f3d4605a..7c8f896a 100644 --- a/dist/recline.js +++ b/dist/recline.js @@ -2696,9 +2696,6 @@ my.Map = Backbone.View.extend({ try { self.features.addData(feature); - if (feature.properties && feature.properties.popupContent) { - self.features.bindPopup(feature.properties.popupContent); - } } catch (except) { wrongSoFar += 1; var msg = 'Wrong geometry value'; @@ -2846,7 +2843,11 @@ my.Map = Backbone.View.extend({ var bg = new L.TileLayer(mapUrl, {maxZoom: 18, attribution: osmAttribution ,subdomains: '1234'}); this.map.addLayer(bg); - this.features = new L.GeoJSON(); + this.features = new L.GeoJSON(null, + {onEachFeature: function(feature,layer) { + layer.bindPopup(feature.properties.popupContent); + } + }); this.map.addLayer(this.features); this.map.setView([0, 0], 2); diff --git a/src/view.map.js b/src/view.map.js index cd69bf34..c74b2cf0 100644 --- a/src/view.map.js +++ b/src/view.map.js @@ -217,9 +217,6 @@ my.Map = Backbone.View.extend({ try { self.features.addData(feature); - if (feature.properties && feature.properties.popupContent) { - self.features.bindPopup(feature.properties.popupContent); - } } catch (except) { wrongSoFar += 1; var msg = 'Wrong geometry value'; @@ -367,7 +364,11 @@ my.Map = Backbone.View.extend({ var bg = new L.TileLayer(mapUrl, {maxZoom: 18, attribution: osmAttribution ,subdomains: '1234'}); this.map.addLayer(bg); - this.features = new L.GeoJSON(); + this.features = new L.GeoJSON(null, + {onEachFeature: function(feature,layer) { + layer.bindPopup(feature.properties.popupContent); + } + }); this.map.addLayer(this.features); this.map.setView([0, 0], 2);