我无法创建指向地图框地图的外部链接,该链接会打开相应标记的弹出窗口。这部分似乎无效:
mymap.markerLayer.on('ready', function(e) {
// Attach click event to new sections
$('.poi').on('click', function() {
$title = $(this).html();
mymap.markerLayer.eachLayer( function(marker) {
if (marker.feature.properties.title === $title ) {
marker.openPopup();
mymap.panTo(marker.getLatLng());
}
});
});
});
Codepen: