Hello,
I am building a map that has both point data and linestring data. when I display only points, markercluster works perfectly (a beautiful tool, really). When I add linestring data, however, no data is displayed. The map tiles are still there but no points or lines are shown. I get the error:
"TypeError: e.getLatLng is not a function
Source File: sites/all/libraries/leaflet_markercluster/dist/leaflet.markercluster.js?mhpg56
Line: 6"
Now I know that markercluster would only work for points and not lines, but is there a way to have the magic of markercluster as well as linestring display on the same map?
Any help is greatly appreciated
Comments
Comment #1
Schnitzer commentedI have the same problem. For now (until it will fixed) i have added a function to leaflet/leaflet.drupal.js
at line 210
So i can display at least the points instead of nothing.
Comment #2
Schnitzer commentedsorry, i forget the changes in leaflet_markercluster/leaflet_markercluster.drupal.js
i changed the linestring case at line 163 to
Comment #3
rdeboerSee screenshots.
You need to apply this simple patch to Leaflet Markercluster: #1995102: Patch to exclude some markers from the clustering process.
Should you not know how to do patches, no problem as the patch is so small you can easily do the edits by hand.
Comment #4
rdeboerOk, I've done a little more research on this.
The attached patch takes the patch from #1995102: Patch to exclude some markers from the clustering process one step further and replaces that patch.
The attached patch will work with IP Geolocation Views and Maps, as well as without it.
As above, it will exclude polygons from the clustering process, but will still render them, while applying the clustering to individual markers.
In addition it allows programmers to exclude selected markers, like a visitor marker or some landmark, to be excluded from the clustering process and render these as individual points.
Comment #5
rdeboerChecked into 7.x-1.x-dev as combined patch for #1995102: Patch to exclude some markers from the clustering process and #1935584: Allow clustering of points in the presence of polygons.