当我点击特定的地图标记(leaflet.js)时,如何从geoJSON中检索value
属性?我尝试了以下和类似的代码,但我似乎无法让它工作。
var geojsonFeature = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"marker-color": "#f85047",
"marker-size": "medium",
"value": 130
},
"geometry": {
"type": "Point",
"coordinates": [
146.3622826337814,
-41.187067757423826
]
}
},
]
};
marker.on('click', function(e){
alert(this.geojsonFeature.features.properties.value);
});
以下是JSFiddle