2016-02-17 66 views
1

我試圖打開下降彈出,但它不工作打開彈出窗口,我試着角瓣葉指令:在降

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

但彈出不會打開,直到我第二次拖放標記爲止。 Here how this should work

這不是它應該如何工作,我怎麼能做到這一點?

回答

2

使用L.MarkeropenPopup方法:

打開以前由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(); 
});