Fixes #230 - updated the feature popup code
The feature popup code was broken since commit
9b1bedc97c
This commit is contained in:
9
dist/recline.js
vendored
9
dist/recline.js
vendored
@@ -2696,9 +2696,6 @@ my.Map = Backbone.View.extend({
|
|||||||
try {
|
try {
|
||||||
self.features.addData(feature);
|
self.features.addData(feature);
|
||||||
|
|
||||||
if (feature.properties && feature.properties.popupContent) {
|
|
||||||
self.features.bindPopup(feature.properties.popupContent);
|
|
||||||
}
|
|
||||||
} catch (except) {
|
} catch (except) {
|
||||||
wrongSoFar += 1;
|
wrongSoFar += 1;
|
||||||
var msg = 'Wrong geometry value';
|
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'});
|
var bg = new L.TileLayer(mapUrl, {maxZoom: 18, attribution: osmAttribution ,subdomains: '1234'});
|
||||||
this.map.addLayer(bg);
|
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.addLayer(this.features);
|
||||||
|
|
||||||
this.map.setView([0, 0], 2);
|
this.map.setView([0, 0], 2);
|
||||||
|
|||||||
@@ -217,9 +217,6 @@ my.Map = Backbone.View.extend({
|
|||||||
try {
|
try {
|
||||||
self.features.addData(feature);
|
self.features.addData(feature);
|
||||||
|
|
||||||
if (feature.properties && feature.properties.popupContent) {
|
|
||||||
self.features.bindPopup(feature.properties.popupContent);
|
|
||||||
}
|
|
||||||
} catch (except) {
|
} catch (except) {
|
||||||
wrongSoFar += 1;
|
wrongSoFar += 1;
|
||||||
var msg = 'Wrong geometry value';
|
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'});
|
var bg = new L.TileLayer(mapUrl, {maxZoom: 18, attribution: osmAttribution ,subdomains: '1234'});
|
||||||
this.map.addLayer(bg);
|
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.addLayer(this.features);
|
||||||
|
|
||||||
this.map.setView([0, 0], 2);
|
this.map.setView([0, 0], 2);
|
||||||
|
|||||||
Reference in New Issue
Block a user