Pregunta

If I smack up a series of pushpins (some from an array of data and some added by the user with a click), I'd like some magic to occur when the rat hovers over them.

So I've added an event on mouseover which gets me an alert. The problem is that I'd like to vary what's in the alert. How can I set an ID, name or such on each of the pushpins?

I'm going to use that to unfold a DIV later on, because, as far I could see, there's no functionality in the AJAX component itself that opens a frame when clicking or hovering over a pushpin.

Edit

For now, I'm creating a pushpin and appending an own field to it like so.

var pushpin = new Microsoft.Maps.Pushpin(latitude, longitude);
pushpin.info = { ... };
pushpins.push(pushpin);

Will I be sorry for this hack and, if so, in what way?

¿Fue útil?

Solución

I've added custom fields to pushpins to track my own objects and it works fine. I wouldn't call it a hack, you're just extending the pushpin object.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top