PushPin clicks

Last post 3/28/2010 5:11:08 PM by Chris Pietschmann. 1 replies. << Back to Web.Maps.VE v3.0 General
1/30/2010 4:43:44 AM
zoinky

PushPin clicks

I had a run down of your control and figured out all the requirements i need using your control, except the most basic.  Following is what I am trying to do

If the zoom is =< 11 that means there is no point in plotting all the location points (pushpins) I simply just plot 1 point for every city.

This of course can be done easily from what i can see (havent tried it), where the real question is, how do i hook up a event to the pushpin clicks themselves so that when one of these pushpins for a city clicked, the map is zoomed to let say level 12 and all the pushpins for that city are loaded.

Also when indivisual pushpins are shown for each location I want to plot, I would like to simple be able to call a javascript function, where i can customize what happens (in this instance i will be showing a custom window with more details of the location, and the custom tooltip proviced when hovering over a pushpin is not enough and not customizable enough so thats why I would like functionality of firing a javascript function when a pushpin is clicked.

so to put it simple, pushpin clicks should be customizable to a javascript call where in on instance i zoom to another level, and at another instance i simply just display another custom window using a javascript call.

Thanks

3/28/2010 5:11:08 PM
Chris Pietschmann

Re:PushPin clicks

To handle the clicking of pushpins, just handle the Map.OnClick event. When this handler is called, the "e.Shape" event arguments property will control the Shape object that was clicked. Additionally to be able to better tell what location was clicked on the map, all you need to do is set the Shape.Tag property when first creating the Shape, then within the Map.OnClick event handler, just retrieve the Shapes Tag property to get back you custom identifier for the specific location. The Tag property is a string, and can contain any string data you want to place within it. Once you retrieve the Tag property of the Shape object, just perform what ever zooming/panning you need.

I would also recommend implementing a "dynamic style" map (as in the Dynamic Search example within the Sample Website) so that once you zoom/pan after the user clicks on a particular pushpin, the map will automatically load the shapes that are within the map view the user is now currently looking at.