Hi all,

This is my 1st time developing with Google Maps, I was asked to create
a map that displays some overlays made up of GPolygons, which were
provided to me in kmz files.  I've been asked to change the fill and
outline colors of the overlay polygons from the 'default' colors,
which I presume is set within the kmz file somewhere.  I can not view
the contents of the KMZ file to change this manually (it looks like
it's encoded).

I see the GPolygons has setFillStyle and setStrokeStyle methods.  I'm
trying to use these methods to change the colors after the gpoly has
been added using an 'addoverlay' listener:

        var default_loc = new GLatLng(47.037023, -122.900105); // DEFAULT
LOCATION IS OLYMPIA
        map = new GMap2($("map_canvas")); // CREATE THE MAP
        map.setCenter(default_loc, 10); // START AT DEFAULT LOCATION
        map.setUIToDefault(); // USE DEFAULT UI FOR NOW
        tsunami_overlay = new GGeoXml("http://www-stage.emd.wa.gov/dev/heat/
data/tsunami.kmz");
        lahar_overlay =  new GGeoXml("http://www-stage.emd.wa.gov/dev/heat/
data/lahar_poly.kmz");
        // ADD LISTENER TO HANDLE WHEN OVERLAYS ARE FINISHED LOADING
        GEvent.addListener(tsunami_overlay, 'load', overlay_loaded);
        GEvent.addListener(lahar_overlay, 'load', overlay_loaded);
        // ADD THE OVERLAYS
        map.addOverlay(tsunami_overlay);
        map.addOverlay(lahar_overlay);

function overlay_added(){
        // this.strokeColor = "#FF0000"; // THIS DOESN'T WORK, NO ERROR
THROWN
        // this.color = "#ff0000"; // THIS DOESN'T WORK, NO ERROR THROWN
        // this.setFillStyle(GPolyStyleOptions('#ff0000', 1, 0.5)); // THROWS
ERROR 'GPOLYSTYLEOPTIONS IS NOT DEFINED'
        // this.setStrokeStyle(GPolyStyleOptions('#000000', 1, 1)); // THROWS
ERROR 'GPOLYSTYLEOPTIONS IS NOT DEFINED'
}

What I want to do is change the color of an overlay after it's been
added, but the setFillStyle and set StrokeStyle methods complain that
GPolyStyleOptions isn't defined, and trying to set the properties
directly doesn't seem to change anything visually (but throws no
error).

How can I accomplish this?  Any help is greatly appreciated.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to