When I use leaflet map with angular-leaflet-directive and try to add draw controls, this causes an error.
The Controller:
SomeApp.controller("mainMapController", function ($scope){
angular.extend($scope, {
defaults: {
tileLayer: "http://{s}.tile.osm.org/{z}/{x}/{y}.png"
},
controls: {
draw: {}
}
})
leafletData.getMap().then(function(map) {
var drawnItems = $scope.controls.edit.featureGroup;
})
});
HTML code:
<div ng-controller="mainMapController">
<leaflet></leaflet>
</div>
Angular gives this error:
Error: ng:areq Bad Argument
Argument mainMapController
is not.
Can you give me some help?
Thanks