Crafty69


Good Morning All

I have a question if anyone can offer a simple solution. I am developing a tourist site using ve maps and would like to group certain pushpins. The map basically covers a large area including 3 main towns. Most of the attractions are grouped in the towns and therefore, given the size of the icons, cover each other. I have searched the forums and found lots of info on clustering but this is way over my head and seems to be aimed at hundreds if not thousands of pushpins. I am only talking maybe 30 but this is still significant enough to cause a problem.

I thought of adding all the pins then making the last (uppermost) pin a simple circle with a number on - that being the number of pins at that location. As you zoom in the icons spread and the "number pin" becomes isolated and therefore insignificant (I could add a simple pop up to it saying " attractions at this location").

Does anyone have a simple alternative as this seems a bit of a "bodge" if you know what I mean!!

Thanks in advance

Crafty




Re: Grouping Pushpins

Earthware


If you're interested in a automatic way of doing this try John's article on clustering points:

http://viavirtualearth.com/vve/Articles/Clustering.ashx

Brian Norman

www.earthware.co.uk






Re: Grouping Pushpins

Jared H

Well your easiest solution -- and it sounds like you've already thought of this -- is that if you don't want to intergrate true logical clustering, then just simply eyeball the size of your pin icon against the map zoom level you set when it loads, and when the users zoom down to a certain level, display the full set of pushpins manually (in javascript code, that is). Another option is to provide a custom navigation menu where you have several options for preset lat, lon, zoom levels (map.SetCenterandZoom) so that this guides your customers around at visually-optimized zoom levels for your pinsets.




Re: Grouping Pushpins

Crafty69

Thanks Jared

Thats a better idea than mine - can you give me a hint as to how to only show the pushpins when a certain zoom level is reached Sorry if thats a dumb question but it might save me a few headaches.

Cheers

Crafty





Re: Grouping Pushpins

Earthware

Hi

Use a combination of the VEMap.onendzoom event and the VEMap.GetZoomLevel method. Each time onedzoom is called check in js what the current map level is, when its at your desired level (or higher) show the extra pushpins.

Check out the reference section of the sdk for help using these: http://dev.live.com/virtualearth/sdk/

Brian Norman
www.earthware.co.uk