EugeneBosyakov

leaflet popup

Dec 5th, 2015
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         popup: {
  2.             icon: {
  3.                 iconSize: [0, 0],
  4.                 shadowSize: [0, 0],
  5.                 iconAnchor: [0, 0],
  6.                 shadowAnchor: [0, 0],
  7.                 popupAnchor: [0, 10]
  8.             },
  9.             lat: 0,
  10.             lng: 0,
  11.             focus: false,
  12.             opacity: 0,
  13.             message: "<button class='btn btn-primary btn-block' \
  14.              ng-click='setSourceMarker()'>Пункт отправки</button> \
  15.              <button class='btn btn-danger btn-block' \
  16.              ng-click='setDestinationMarker()'>Пункт назначения</button>",
  17.             getMessageScope: function() {
  18.                 return $scope;
  19.             },
  20.         },
  21.  
  22.     $scope.$on("leafletDirectiveMap.click", function(event, args) {
  23.         var leafEvent = args.leafletEvent;
  24.         var lat = leafEvent.latlng.lat
  25.         var lng = leafEvent.latlng.lng
  26.  
  27.         $scope.markers.popup.lat = lat
  28.         $scope.markers.popup.lng = lng
  29.         $scope.markers.popup.focus = true
  30.     });
  31.     $scope.$on("leafletDirectiveMap.mousedown", function(event, args) {
  32.         $scope.markers.popup.focus = false
  33.     });
Advertisement
Add Comment
Please, Sign In to add comment