角叶指令:打开弹窗滴

时间:2022-06-06 11:57:21

I'm trying to open popup on drop, but it does not work, I've tried with

我试图在drop上打开弹出窗口,但它不起作用,我试过了

$scope.$on('leafletDirectiveMarker.dragend', function(event,args){
   args.model.focus = true;
});

and

$scope.$on('leafletDirectiveMarker.dragend', function(event,args){
    $scope.markers.forEach(function(marker){
        marker.focus = false;
    });
    args.model.focus = true;
});

But popup does not open until I drag and drop the marker for second time. 角叶指令:打开弹窗滴

但是弹出窗口直到我拖放第二次标记时才会打开。

That's not how it should work, how can I achieve this?

这不是它应该怎么做的,我怎么做呢?

1 个解决方案

#1


3  

Use L.Marker's openPopup method:

使用L。标记的openPopup方法:

Opens the popup previously bound by the bindPopup method.

打开之前由bindPopup方法绑定的弹出窗口。

http://leafletjs.com/reference.html#marker-openpopup

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();
});

#1


3  

Use L.Marker's openPopup method:

使用L。标记的openPopup方法:

Opens the popup previously bound by the bindPopup method.

打开之前由bindPopup方法绑定的弹出窗口。

http://leafletjs.com/reference.html#marker-openpopup

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();
});