Fixes #230 - updated the feature popup code

The feature popup code was broken since commit
9b1bedc97c6febd236023e1ec40114ed288eecd4
This commit is contained in:
Michael Bauer 2012-09-12 12:48:59 +02:00
parent 208c9a9330
commit 881fee5fe7
2 changed files with 10 additions and 8 deletions

9
dist/recline.js vendored
View File

@ -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);

View File

@ -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);