UNPKG

mohsen-angular-leaflet-directive

Version:

angular-leaflet-directive - An AngularJS directive to easily interact with Leaflet maps

32 lines 1.1 kB
app.controller('MarkersAddRemoveController', [ '$scope', function($scope) { angular.extend($scope, { london: { lat: 51.505, lng: -0.09, zoom: 8 }, markers: {} }); $scope.addMarkers = function() { angular.extend($scope, { markers: { m1: { lat: 51.505, lng: -0.09, message: "I'm a static marker", }, m2: { lat: 51, lng: 0, focus: true, message: "Hey, drag me if you want", draggable: true } } }); }; $scope.removeMarkers = function() { $scope.markers = {}; } $scope.addMarkers(); } ]);