Answered by:
Collision Detection?

Question
-
Is there a way to have the control recognize when two pushpins are on top of each other and draw them with a temporary offset so both pins could be seen? Thanks.Wednesday, June 28, 2006 2:31 PM
Answers
-
I have posted an example of collision detection for pushpins in the ViaVirtualEarth site
The blog post http://www.viavirtualearth.com/VVE/Blog/1/136.ashx
The forum entry http://www.viavirtualearth.com/VVE/Forum/2/449.ashx
The example http://www.viavirtualearth.com/MyVirtualEarth/v3/pushpincollision.htm
- Marked as answer by Ricky_BrundrittModerator Thursday, November 26, 2009 10:10 PM
Friday, July 7, 2006 7:38 AM
All replies
-
I don't think there is anything built in yet. I had to build custom handling for this in my application, but it only works when loading a batch of points, and won't detect collisions if I add pushpins one at a time.Thursday, June 29, 2006 12:42 PM
-
ghamm wrote: ... I had to build custom handling for this in my application... Any chance you could share some of your solution?
I'm hoping this becomes part of Virtual Earth proper. I'm sure they could dig the algorithm out of MapPoint easily.
Glenn
Friday, June 30, 2006 3:45 AM -
Well as I originally stated, this only works for loading a batch of points at once.
MY logic was fairly simple, I sorted my batch of points by latitude/longitude, and as I looped through my data and plotted each point, I compared the last coordinate pair to the current one, and if they were the same, I created a list of sorts. Then, once I get a point that is different from the previous point, if a list exists, I create a default pushpin and put the list I created into the mouseover.
I've thought about ways to do this outside of a batch, or in a non-sorted order, but my ideas would require a handful of array management and looping, and for the sake of my application, just wasn't necessary.
Thursday, July 6, 2006 12:57 PM -
I have posted an example of collision detection for pushpins in the ViaVirtualEarth site
The blog post http://www.viavirtualearth.com/VVE/Blog/1/136.ashx
The forum entry http://www.viavirtualearth.com/VVE/Forum/2/449.ashx
The example http://www.viavirtualearth.com/MyVirtualEarth/v3/pushpincollision.htm
- Marked as answer by Ricky_BrundrittModerator Thursday, November 26, 2009 10:10 PM
Friday, July 7, 2006 7:38 AM