Hi All, I''m looking for a good example of client-side marker clustering with Mapstraction. It would be especially valuable if it was easily reusable code, similar to MarkerClusterer for Google Maps: http://gmaps-utility-library.googlecode.com/svn/trunk/markerclusterer/1.0/docs/reference.html If no such thing exists for Mapstraction (and I haven''t seen one), what are the opinions on porting this library to Mapstraction? It is open source (Apache 2.0 license), so this seems feasible. A little background: I''m writing an introductory book on mapping APIs and I use Mapstraction in examples wherever I can. I''d like to include marker clustering, but may have to do so in a Google-only way. I thought before I do that I should ask the list. Any experience clustering with Mapstraction? --Adam --- Adam DuVander I like maps: http://mapscripting.com I like simple: http://adamduvander.com
Marker clustering is a method in Mapstraction (*declutterMarkers<http://mapstraction.com/doc/Mapstraction.html#declutterMarkers> ) although it''s only natively supported by MultiMap. Would be good to flesh that out with a Mapstraction implementation. This does bring up the issue of marker icons though; Mapstraction falls back to the provider defaults but in this case there wont be one so either we''ll have to start providing one (possibly not a bad idea to get a Mapstraction icon set together) or require that for it to work the dev must have provided an icon URL. Simple solutions aside, here are a couple of use cases I can think of that may be worth thinking about...* - Basic This should be enough to enable clustering for any markers using a standard icon, possibly with a number - Custom cluster icon Similar to custom marker icon, URL, size, anchor point, etc - Custom clustering behaviour Clustering algorithm works as normal but the programmer provides "cluster" and "uncluster" functions which are called when an operation is to be performed and they handle adding some special marker or other overlay and its removal - Clustering filtered markers Additionally it would be nice if the clustering functionality hooked in before any markers actually made it onto the map. The algorithm should process the marker data determining which are to be clustered and then add cluster icons rather than marker ones. This should hopefully save a lot of DOM operations from happening. The Multimap implementation actually has some rather nifty aggregating of marker info bubbles in it too so when clustering is in operation, or even if two markers happen to be in the same location, you can page through the detail for each one. Derek 2010/1/5 Adam DuVander <mapstraction at duvander.com>> Hi All, > > I''m looking for a good example of client-side marker clustering with > Mapstraction. It would be especially valuable if it was easily reusable > code, similar to MarkerClusterer for Google Maps: > > http://gmaps-utility-library.googlecode.com/svn/trunk/markerclusterer/1.0/docs/reference.html > > If no such thing exists for Mapstraction (and I haven''t seen one), what are > the opinions on porting this library to Mapstraction? It is open source > (Apache 2.0 license), so this seems feasible. > > A little background: I''m writing an introductory book on mapping APIs and I > use Mapstraction in examples wherever I can. I''d like to include marker > clustering, but may have to do so in a Google-only way. I thought before I > do that I should ask the list. Any experience clustering with Mapstraction? > > --Adam > --- > Adam DuVander > I like maps: http://mapscripting.com > I like simple: http://adamduvander.com > > _______________________________________________ > Mapstraction mailing list > Mapstraction at lists.mapstraction.com > http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com >-- Derek Fowler m. +44 (0) 7966 512 369 e. dezfowler at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mapstraction.com/pipermail/mapstraction-mapstraction.com/attachments/20100105/ad74d5d6/attachment.htm>
I agree that the best option would be client-side clustering that happens before any markers are added to the map. That means it could be provider agnostic--written once and work across all providers. Derek''s "custom clustering behavior" idea sounds nice. It might be wise to start with something simple. I think the "custom cluster icon" one would be the way to go. Anyone have additional thoughts on this, especially the idea of porting another implementation (and the licensing issues involved with that)? --Adam --- Adam DuVander I like maps: http://mapscripting.com I like simple: http://adamduvander.com On Jan 5, 2010, at 3:47 PM, Derek Fowler wrote:> Marker clustering is a method in Mapstraction (declutterMarkers) > although it''s only natively supported by MultiMap. Would be good to > flesh that out with a Mapstraction implementation. This does bring > up the issue of marker icons though; Mapstraction falls back to the > provider defaults but in this case there wont be one so either we''ll > have to start providing one (possibly not a bad idea to get a > Mapstraction icon set together) or require that for it to work the > dev must have provided an icon URL. Simple solutions aside, here are > a couple of use cases I can think of that may be worth thinking > about... > ? Basic > This should be enough to enable clustering for any markers using a > standard icon, possibly with a number > ? Custom cluster icon > Similar to custom marker icon, URL, size, anchor point, etc > ? Custom clustering behaviour > Clustering algorithm works as normal but the programmer provides > "cluster" and "uncluster" functions which are called when an > operation is to be performed and they handle adding some special > marker or other overlay and its removal > ? Clustering filtered markers > Additionally it would be nice if the clustering functionality hooked > in before any markers actually made it onto the map. The algorithm > should process the marker data determining which are to be clustered > and then add cluster icons rather than marker ones. This should > hopefully save a lot of DOM operations from happening. > > The Multimap implementation actually has some rather nifty > aggregating of marker info bubbles in it too so when clustering is > in operation, or even if two markers happen to be in the same > location, you can page through the detail for each one. > > Derek > > 2010/1/5 Adam DuVander <mapstraction at duvander.com> > Hi All, > > I''m looking for a good example of client-side marker clustering with > Mapstraction. It would be especially valuable if it was easily > reusable code, similar to MarkerClusterer for Google Maps: > http://gmaps-utility-library.googlecode.com/svn/trunk/markerclusterer/1.0/docs/reference.html > > If no such thing exists for Mapstraction (and I haven''t seen one), > what are the opinions on porting this library to Mapstraction? It is > open source (Apache 2.0 license), so this seems feasible. > > A little background: I''m writing an introductory book on mapping > APIs and I use Mapstraction in examples wherever I can. I''d like to > include marker clustering, but may have to do so in a Google-only > way. I thought before I do that I should ask the list. Any > experience clustering with Mapstraction? > > --Adam > --- > Adam DuVander > I like maps: http://mapscripting.com > I like simple: http://adamduvander.com > > _______________________________________________ > Mapstraction mailing list > Mapstraction at lists.mapstraction.com > http://lists.mapstraction.com/listinfo.cgi/mapstraction-mapstraction.com > > > > -- > Derek Fowler > m. +44 (0) 7966 512 369 > e. dezfowler at gmail.com