Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- popup: {
- icon: {
- iconSize: [0, 0],
- shadowSize: [0, 0],
- iconAnchor: [0, 0],
- shadowAnchor: [0, 0],
- popupAnchor: [0, 10]
- },
- lat: 0,
- lng: 0,
- focus: false,
- opacity: 0,
- message: "<button class='btn btn-primary btn-block' \
- ng-click='setSourceMarker()'>Пункт отправки</button> \
- <button class='btn btn-danger btn-block' \
- ng-click='setDestinationMarker()'>Пункт назначения</button>",
- getMessageScope: function() {
- return $scope;
- },
- },
- $scope.$on("leafletDirectiveMap.click", function(event, args) {
- var leafEvent = args.leafletEvent;
- var lat = leafEvent.latlng.lat
- var lng = leafEvent.latlng.lng
- $scope.markers.popup.lat = lat
- $scope.markers.popup.lng = lng
- $scope.markers.popup.focus = true
- });
- $scope.$on("leafletDirectiveMap.mousedown", function(event, args) {
- $scope.markers.popup.focus = false
- });
Advertisement
Add Comment
Please, Sign In to add comment