I have two quick and easy functions called by a link:
function setEditGeo() {
document.getElementById("spanSetGeoEdit").innerHTML = '<a href="#"
onclick="setNoEditGeo();">edit geo mode off<\/a>';
for (var i = 0; i < geoFenceArray.length; i++) {
polyListenerArray.push
(google.maps.event.addListener(geoFenceArray[i], 'click',
showArrays));
geoFenceArray[i].setOptions({ clickable: true });
}
}
function setNoEditGeo() {
document.getElementById("spanSetGeoEdit").innerHTML = '<a href="#"
onclick="setEditGeo();">edit geo mode on<\/a>';
for (var i = 0; i < geoFenceArray.length; i++) {
google.maps.event.removeListener(polyListenerArray[i]);
geoFenceArray[i].setOptions({ clickable: false });
}
}
The first successfully sets the polygons as clickable and I see the
infowindow when I click. however when I click on the link to run the
second function (setNoEditGeo) the code runs, I can step through with
debug, the eventhandler removal works, but the polygons remain
clickable (hand changes to pointing finger when on mouseover) - the
infowindow doesn't appear on clicking though, so some of the function
is working.
I presume that I have the syntax right for setting clickable to false?
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.