I've had really inconsistent success getting the custom icons to
display correctly in KML files that are being displayed using the
Google Maps API.  Some days the icons all display perfectly (back in
October), and then they started to be sporadically replaced with the
default blue icon (early November).  Then they started working again
(November 22nd), but it's all blue markers again (with a very
occasional and sporadic custom icon rendering).  I read some threads
on the My Maps forum and saw that Google has been making some code
changes that could be affecting this so I just don't know what to
troubleshoot!

These are large KML files (several hundreds of points) which in which
I use style-sheet like references to custom icon files (see example
below).  The KML files are generated with code which I can re-write if
the style-sheet-like approach to referencing custom icons is just not
going to be reliable, but this would take some time and I'd like to be
sure it's necessary.  Is the Google Maps API supposed to reliably
handle this kind of icon reference in KML's?  If not, what would be
the preferred way to reference custom icon files for placemarks, if
the KML is going to be rendered with the Google Maps API?

Here are some details about my approach.  Should this be working?

The custom icons are referenced by establishing Style id's at the top
of each KML:
<Style id='diversion'>
  <IconStyle>
    <Icon><href>diversion.png</href></Icon>
  </IconStyle>
  <LabelStyle>
    <scale>0</scale>
  </LabelStyle>
</Style>

Each placemark references the appropriate style id:
<Placemark>
<name>MEEKER DEMAND</name>
<description>Node ID: 950810</description>
<styleUrl>#diversion</styleUrl>
<Point><coordinates>-107.914918196241743,40.032954697618642</
coordinates></Point>
</Placemark>

We are calling the KML's using the Google Maps API like so:

var mapNodeSelection = new
google.maps.Map(document.getElementById("map_canvas"), myOptions);

var kmlNodeLayer = new google.maps.KmlLayer('http://
www.publicwebfolder.com/Nodes.kml', {supressInfoWindows:false,
preserveViewport: true, map: mapNodeSelection}

And then rendering the "map_canvas" element in html with a div tag.

Thanks!  ~Kelly

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" 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