Open nmccready opened 9 years ago
From @skray on October 12, 2015 3:28
I also was trying to use Leaflet.Editable, and ran into this same problem. Looking at this line in LeafletMapDefaults, it looks like you can assign any non-standard default to the map
field of the defaults
object, and they will get carried over. So for your example @markovaljaots, I did this instead and it worked for me:
angular.extend($scope, { defaults: { map: { editable: true } } });
I'm not sure if this is the correct use of defaults.map
, but it seems to do the trick.
With leafletMapDefaults factory why doesn't someone PR changes to setDefaults to make them less restrictive. IE remove all the isDefined and default checks and just merge / extend all the properties via angular.extend({}. newDefaults, userDefaults)
From @markovaljaots on October 9, 2015 13:18
I want to use https://github.com/yohanboniface/Leaflet.Editable together with angular-leaflet-directive, but in order to do so it is necessary to create a map with following options:
Unfortunately all the "defaults" keys are hardcoded in angular-leaflet-directive.js and therefore "editable: true" is skipped. I managed to enable "editable" key by modifying angular-leflet-directive.js and making these adjustments:
Now Leaflet.Editable works, but this solution is quite hacky. Are there any alternative ways to achieve this?
Copied from original issue: tombatossals/angular-leaflet-directive#986