On May 7, 8:51 am, svante21 <[email protected]> wrote:
> Hi,
>
> I use basically the following code to add my areas from MapInfo
> export:
>
> var map = new GMap2( document.getElementById( "map_canvas" ) );
> var geoXml = new GGeoXml( "http://mydomain/maps6/test2.kml"; );
> map.addOverlay( geoXml );
>
> The areas shows up nicely on the map, just the way the KML states
> (polygons with colors/opacity etc.).
>
> Now, how can I make my JavaScript code change the colors of some of
> the polygons. It's not event based (e.g. mouseover) but rather a
> change in state in other JavaScript code (primarily while still
> loading the page though).

This is getting to be a FAQ...

You have to either:
1. use an interceptor, as Mike Williams describes here:
Part 36 Tricks with GGeoXml
http://econym.org.uk/gmap/interceptor.htm

pay attention to the warning:
Warning: This trick relies on undocumented details of the GGeoXml
behaviour. It may well fail to work in future releases.

or
2. use a third party KML parser like GeoXml or EGeoXml which gives you
access to the internals.

  -- Larry

>
> A solution similar to the following would be nice (or even simpler):
> map.getOverlayById( "32" ).setFillColor( "EE00FF00" );
>
> Any suggestions?
>
> /Svante
--~--~---------~--~----~------------~-------~--~----~
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