Friday, December 4, 2009

events with markermanager

hello,

i have the following problem with setting events to markers created
with the markermanager:
i used the weather-map example and edited the getWeatherMarkers()
methode to the following:

function getWeatherMarkers(n) {
var batch = [];
for (var i = 0; i < n; ++i) {
temp = new GMarker(getRandomPoint(), { icon: getWeatherIcon() });
GEvent.addListener(temp, "click", doXY());
batch.push( temp );
}
return batch;
}

the problem is, when loading the map, for each marker the doXY()
function is called, but when clicking one it isn't, i get an error "
this.xh is undefined
http://maps.gstatic.com/intl/de_ALL/mapfiles/184a/maps2.api/main.js
Line 286"

my aim is to execute one of my functions, when i click a marker (and
differ them with theire position or unique id)
can anybody please help me?!

thanks a lot MR

--

You received this message because you are subscribed to the Google Groups "Google Maps API" group.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate