我正在尝试打开弹出窗口,但它不起作用,我尝试过
$scope.$on('leafletDirectiveMarker.dragend', function(event,args){
args.model.focus = true;
});
和
$scope.$on('leafletDirectiveMarker.dragend', function(event,args){
$scope.markers.forEach(function(marker){
marker.focus = false;
});
args.model.focus = true;
});
这不是它应该如何运作,我怎样才能做到这一点?
答案 0 :(得分:3)
使用L.Marker
' openPopup
方法:
打开以前由bindPopup方法绑定的弹出窗口。
http://leafletjs.com/reference.html#marker-openpopup
$scope.$on('leafletDirectiveMarker.dragend', function(event,args){
// Marker which fires the event is stored in args.leafletObject
args.leafletObject.openPopup();
});