Angular-leaflet-directive:打开弹出窗口
Angular-leaflet-directive: Open popup on drop
我试图在拖放时打开弹出窗口,但它不起作用,我试过
$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;
});
但是直到我第二次拖放标记时弹出窗口才打开。
这不是它应该的工作方式,我该如何实现?
使用L.Marker
的openPopup
方法:
Opens the popup previously bound by the bindPopup method.
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();
});
我试图在拖放时打开弹出窗口,但它不起作用,我试过
$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;
});
但是直到我第二次拖放标记时弹出窗口才打开。
这不是它应该的工作方式,我该如何实现?
使用L.Marker
的openPopup
方法:
Opens the popup previously bound by the bindPopup method.
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();
});