-
Notifications
You must be signed in to change notification settings - Fork 632
Closed
Description
Hello!
In my project I need to use the popup without marker. I could not find similar cases in the documentation and wrote this
Full example here
$scope.map = null;
leafletData.getMap('map').then(function(map) {
$scope.map = map;
});
/* ... */
$scope.createWindow = function(lat, lng) {
var html = $compile("<button \
ng-click='setSourceMarker(" + lat + ","+lng+")'>First button</button> \
<button class='btn btn-danger btn-block' \
ng-click='setDestinationMarker(" + lat + ","+lng+")'>Second button</button>")({});
L.popup()
.setContent(html[0])
.setLatLng(L.latLng(lat, lng)).openOn($scope.map)
}
$scope.$on("leafletDirectiveMap.click", function(event, args) {
var leafEvent = args.leafletEvent;
$scope.createWindow(leafEvent.latlng.lat, leafEvent.latlng.lng)
});
My problem - I can not send in setContent full html. In general, this method looks awful. What are the ways to solve the problem and whether it is possible to write better?
Metadata
Metadata
Assignees
Labels
No labels