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

The markercluster plugin is not loaded. (even after following #804) #1045

Open jiminHwa opened 8 years ago

jiminHwa commented 8 years ago

First of all, thank you for your work on this project. Your angular-leaflet-directive makes my angular project more efficient and exciting. The problem is same with #804. In my project, because I tried to define two markercluster layers, it throwed following warning twice: "[AngularJS - Leaflet] The markercluster plugin is not loaded." I checked the closed issue, and tried the 0.4.0 hotfix version (and also 1.0.0-beta.2.0). But I have still got the message when I load my map. And I definitely loaded leaflet.markercluster (and the css files) in index.html. So when I add a marker to a markercluster layer, understandably it throws the following error message: "[AngularJS - Leaflet] A marker can only be added to a layer of type "group". How can I solve this problem? Please, let me know.

adarrra commented 6 years ago

In my case (Leaflet 0.7.7 and markercluster 0.5) the problem was that markercluster really didn't load. In my case leaflet was required from require.js and from webpack so it was created twice but plugins were added only first time.