Hi, the following chunk of code allows show/hide of image overlays
depending on the hide_show parameter. So, here are the steps that lead
to the error.
Call function to display ggroundoverlay. ok
Call function to remove ggroundoverlay. ok
call function to display same ggroundoverlay. B is Null.
Any ideas? Thanks in advance!
var imageOverlayHash = {}; // global hash
function implementImageOverlayFeature(project_name, image_boundaries,
imageOverlay_id, imageOverlay_name, imageOverlay_description,
imageOverlay_imageUrl, imageOverlay_thematicUrl,
imageOverlay_indicator, featureLayer, featureGroup, hide_show){
// if toggle button is turned off, remove feature from map and
arrays - problem: it does not remove certain overlays in IE.
if (hide_show=="0"){
for (item in imageOverlayHash) {
if (item == imageOverlay_id){
// remove the image from the map
google_maps[project_name].removeOverlay(imageOverlayHash[imageOverlay_id]);
// remove element from the hash array
delete imageOverlayHash[imageOverlay_id];
}
}
} else {
var imageOverlay = new GGroundOverlay(imageOverlay_imageUrl,
image_boundaries);
google_maps[project_name].addOverlay(imageOverlay);
// add the thematic map legend onto google maps -
imageOverlay_thematic_map_legend
// Each time a point is read, extend the bounds to include
that point.
projectBounds[project_name].extend(image_boundaries.getSouthWest());
projectBounds[project_name].extend(image_boundaries.getNorthEast());
// set the zoom level after including the polygon above
google_maps[project_name].setZoom(google_maps[project_name].getBoundsZoomLevel(projectBounds[project_name]));
// The centre can be obtained by using the bounds.getCenter()
method
google_maps[project_name].setCenter(projectBounds[project_name].getCenter());
// add overlay to the associative array
imageOverlayHash[imageOverlay_id] = imageOverlay;
} // end of else
}
--
You received this message because you are subscribed to the Google Groups
"Google Maps API" 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-api?hl=en.