GE overrides icons and hotspots

99 views
Skip to first unread message

Adam Schneider

unread,
Nov 29, 2009, 2:35:42 PM11/29/09
to KML Developer Support - Getting Started with KML
This has been driving me crazy for years now: if, in a placemark's KML
code, I supply the URL of an icon on maps.google.com, Google Earth
often seems to say to me, "Oh no no, you didn't want THAT ugly old
icon... here, I've got a better one for you! Oh, and you were wrong
about the hotSpot too, I'll fix that." Here's an example:

<?xml version="1.0" standalone="yes"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Document>
<Placemark>
<Point><coordinates>-67.129444,18.494722,72</coordinates></
Point>
<Style>
<IconStyle>
<Icon><href>http://maps.google.com/mapfiles/kml/pal2/
icon48.png</href></Icon>
<hotSpot x="0.5" xunits="fraction" y="0.5"
yunits="fraction" />
</IconStyle>
</Style>
<name>Aguadilla airport</name>
</Placemark>
</Document>
</kml>

If you open that icon (http://maps.google.com/mapfiles/kml/pal2/
icon48.png) in your Web browser, you'll see a gray airplane inside of
a circle. But in GE, it shows up as a blue-gradient airplane with no
circle -- even though the URL in the "Get Info" dialog hasn't changed.

Now, I've learned to live with this icon-replacement weirdness...
fine, GE thinks it has prettier icons. But now I notice that it's
overriding my hotspots too, and that's NOT COOL. In the case of this
"airport" icon, GE seems to think that the best way to display it is
with the tail of the airplane sitting on the point, rather than
centering the icon on the point. The <hotSpot> tag that I've put in
the icon's style definition, which should place the "anchor" in the
middle of the graphic, has no effect. The only way I can get the
icons where I want them is to make copies of Google's graphics and
host them myself -- which I'd rather not do.

I searched these forums for an answer to this problem and turned up
nothing. Am I really the only one irked by Google Earth having its
own idea of which graphic should be referred to by certain URLs?

Adam Schneider

unread,
Nov 29, 2009, 2:38:14 PM11/29/09
to KML Developer Support - Getting Started with KML
Here's that image on its own line, for easy clicking:
http://maps.google.com/mapfiles/kml/pal2/icon48.png

Jason M

unread,
Nov 30, 2009, 9:41:53 AM11/30/09
to KML Developer Support - Getting Started with KML
I've noticed the same thing and never found any reference to GE's icon
substitution.

There seems to be a bug in GE such that if you choose a icon with url
prefix "http://maps.google.com/mapfiles/kml/pal" when it gets
substituted for one in http://maps.google.com/mapfiles/kml/shapes/xxx
the hotSpot values are ignored and auto-hotspotting is used instead.

However, if you choose the standard icon that gets displayed (e.g.
http://maps.google.com/mapfiles/kml/shapes/airports.png) then the
hotSpot values are used so only work around is to the either the
standard google earth icon, one from external (non-google.com) web
sites, or include icon images in KMZ.

If you likewise bundle the icons in the KMZ then the hotSpot and
correct icon are used. Strange indeed.

This is not the only bug where hotSpot is ignored:
http://code.google.com/p/earth-issues/issues/detail?id=419

--jason

Adam Schneider

unread,
Nov 30, 2009, 6:53:41 PM11/30/09
to KML Developer Support - Getting Started with KML
I wonder if there's a list somewhere of all the "/shapes/"
substitutions. The "airports" icon is easy enough to guess, but in
other cases it might not be obvious what they're replacing it with.
Good to know that the hotspot in that case doesn't get messed with.

Meanwhile, I found an interesting workaround: if you simply replace
maps.google.com with maps.google.ca or maps.google.co.uk, GE leaves
your icons alone and doesn't replace the graphic or the hotspot! So
Canadian icons may be my solution for the time being.

Adam Schneider
Portland, OR
http://www.gpsvisualizer.com/


On Nov 30, 6:41 am, Jason M wrote:
> I've noticed the same thing and never found any reference to GE'sicon
> substitution.
>
> There seems to be a bug in GE such that if you choose aiconwith url
> prefix "http://maps.google.com/mapfiles/kml/pal" when it gets
> substituted for one inhttp://maps.google.com/mapfiles/kml/shapes/xxx
> thehotSpotvalues are ignored and auto-hotspotting is used instead.
>
> However, if you choose the standardiconthat gets displayed (e.g.http://maps.google.com/mapfiles/kml/shapes/airports.png) then thehotSpotvalues are used so only work around is to the either the
> standardgoogleearthicon, one from external (non-google.com) web
> sites, or includeiconimages in KMZ.
>
> If you likewise bundle the icons in the KMZ then thehotSpotand
> correcticonare used. Strange indeed.
Reply all
Reply to author
Forward
0 new messages