我正在尝试使弹出窗口在django-leaflet上打开页面加载。我该怎么做呢?
var collection = {{ object_list|geojsonfeature:"popupContent"|safe }};
console.log(collection);
function onEachFeature(feature, layer) {
if (feature.properties && feature.properties.popupContent) {
layer.bindPopup(feature.properties.popupContent).openPopup();
}
}发布于 2021-06-09 12:43:27
这是可行的:
function onEachFeature(feature, layer) {
// does this feature have a property named popupContent?
if (feature.properties && feature.properties.popupContent) {
layer.addTo(map).bindPopup(feature.properties.popupContent,{autoClose:false}).openPopup();
};
}https://stackoverflow.com/questions/67747817
复制相似问题