angular-ui / ui-leaflet

AngularJS directive to embed an interact with maps managed by Leaflet library
http://angular-ui.github.io/ui-leaflet
Other
314 stars 134 forks source link

How to nest leaflet directive inside another directive? #274

Closed rawbeans closed 8 years ago

rawbeans commented 8 years ago

I am trying to nest the leaflet directive inside another directive.

I am getting the following error: angular.js:13708 TypeError: Cannot read property 'baselayers' of undefined

It is from the line:

for (var layerName in layers.baselayers) {

This is in the link function of the leaflet directive in the ui-leaflet source (ui-leaflet.js:4109).

I do not get this error if I put my at the top level outside of a directive.

rawbeans commented 8 years ago

sorry this is a duplicate of: https://github.com/angular-ui/ui-leaflet/issues/135