Posted by syawillim on September 15, 2014 at 1:34am
I have a number of tracks (linstrings) that I would like to display on a map as points.
The perfect solution would be to have Leaflet and Leaflet MarkerCluster configured so that as the user zooms out the the tracks change to point markers and then cluster as on www.mtbproject.com.
Failing this an alternative would be to have a second GeoField that converts the linestring to a point so that point markers can be shown on a map with links the node and map with the track. Views has an option to output the field as a centroid which works fine as text, but this does not happen output to a map.
Any suggestions for achieving either of these options would be much appreciated.
Comments
Or allow linestrings and polygons to be centered?
A third solution could be to adapt Leaflet MarkerCluster (the module) and Leaflet.markercluster (the JS plugin) to accept the clustering of items that aren't single points, based on some "central" point.
I believe Geofield already supports a centroid for polygons, so if that could be passed to the clustering...
Oh..., just saw you already requested this here: https://www.drupal.org/node/2335209