2016-02-17 1 views
1

J'essaie d'ouvrir pop-up sur une chute, mais il ne fonctionne pas, je l'ai essayé avecangulaire dépliant-directive: Ouvrir le menu sur drop

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

et

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

Mais popup ne s'ouvre pas jusqu'à ce que je glisse et dépose le marqueur pour la deuxième fois. Here how this should work

Ce n'est pas comment cela devrait fonctionner, comment puis-je y parvenir?

Répondre

2

Utiliser la méthode de openPopupL.Marker:

ouvre la fenêtre lié au préalable par la méthode de 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(); 
});