tombatossals / angular-leaflet-directive

AngularJS directive to embed an interact with maps managed by Leaflet library
http://tombatossals.github.io/angular-leaflet-directive
MIT License
1.5k stars 635 forks source link

Attribute directives apply for everything in an application #1031

Open v1v2r0b8 opened 8 years ago

v1v2r0b8 commented 8 years ago

Hello!

I think it was supposed that all inner attribute directives would apply only to a parent <leaflet> element directive, but they are invoked everywhere, e.g. in angular-google-maps directive (which causes the following error: Controller 'leaflet', required by directive 'center', can't be found!). As a workaround, I deleted 'center' from the line 3365:

var centerDirectiveTypes = ['center', 'lfCenter'];

but I think it's better to find a way to prevent invoking constructors for all such directives if an element is not a <leaflet>.

jnystrom commented 8 years ago

I am also seeing this error when I am using angular-google-maps directive.

st04 commented 8 years ago

I thought this was fixed in #914 with the alternative lf-center by @nmccready ?

EDIT: I too am having the same problem. Not so sure if the problem is related to the issue I stated above.

jnystrom commented 8 years ago

@st04 when I did what @leitasat suggested above...it worked for me...so the issue still exists.

nimeso commented 8 years ago

+1 This is also a issue when using 'bounds'. It clashes with google maps as well angular.js:13550 Error: [$compile:ctreq] Controller 'leaflet', required by directive 'bounds', can't be found!