Custom (.PNG) icons not displaying in Google Maps

1,832 views
Skip to first unread message

Chris M

unread,
Sep 22, 2009, 7:57:36 PM9/22/09
to KML Developer Support - Getting Started with KML
Hi All,

I've seen this question asked a few times, but have yet to find an
answer that works for me...

I have a KML file, with custom icons, that works perfectly in Google
Earth. A copy of this file can be found here: http://christophermolloy.com/a/Tokyo.kml

But when I create a map in Google Maps and import this KML file, none
of the custom icons are displayed: http://maps.google.com/?mid=1253661696

The icons load fine by themselves (e.g. http://www.christophermolloy.com/ge/0101.png
)

If I inspect the map page source I see the following element in place
of my custom icons:
<img style="border: 0px none ; margin: 0px; padding: 0px; width: 32px;
height: 32px; -moz-user-select: none;" src="http://maps.gstatic.com/
intl/en_ALL/mapfiles/transparent.png"/>

Further investigation led me to: http://code.google.com/apis/kml/documentation/kmlreference.html#placemark
which states that the way to specify an icon (amongst other things) is
to use the '<styleUrl>...</styleUrl>' tag set (which is what I've done
in my KML).

However, http://code.google.com/apis/kml/documentation/kmlelementsinmaps.html
states that '<styleUrl>' is not supported in Maps (as it applies to
<StyleMap>, which is not supported in Maps). The '<Style>' tag is
supported in Maps, however.

And here's where I hit a brick wall. So - am I doing something wrong?
What's the best way to specify a custom icon for a placemark such that
it will display in Google Maps? Alternatively, can anyone point me to
a KML file that uses custom (.PNG) icons that does work in Maps (so I
can dig through the KML myself)?

Any help would be greatly appreciated!

treebles

unread,
Sep 23, 2009, 11:13:07 AM9/23/09
to KML Developer Support - Getting Started with KML
I cannot access your image at
http://www.christophermolloy.com/ge/0101.png
I get an Error 403
which means that my request is forbidden.
I am guessing that the Google servers trying to retrieve your images
from your server might fail for the same reasons.

On Sep 22, 7:57 pm, Chris M wrote:
> Hi All,
>
> I've seen this question asked a few times, but have yet to find an
> answer that works for me...
>
> I have a KML file, with custom icons, that works perfectly in Google
> Earth. A copy of this file can be found here:http://christophermolloy.com/a/Tokyo.kml
>
> But when I create a map in Google Maps and import this KML file, none
> of the custom icons are displayed:http://maps.google.com/?mid=1253661696
>
> The icons load fine by themselves (e.g.http://www.christophermolloy.com/ge/0101.png
> )
>
> If I inspect the map page source I see the following element in place
> of my custom icons:
> <img style="border: 0px none ; margin: 0px; padding: 0px; width: 32px;
> height: 32px; -moz-user-select: none;" src="http://maps.gstatic.com/
> intl/en_ALL/mapfiles/transparent.png"/>
>
> Further investigation led me to:http://code.google.com/apis/kml/documentation/kmlreference.html#place...
> which states that the way to specify an icon (amongst other things) is
> to use the '<styleUrl>...</styleUrl>' tag set (which is what I've done
> in my KML).
>
> However,http://code.google.com/apis/kml/documentation/kmlelementsinmaps.html

Barry Hunter

unread,
Sep 23, 2009, 1:26:07 PM9/23/09
to KML Developer Support - Getting Started with KML
Try pressing F5 - it then appears :) [Or copy/paste the url into a
new browser, rather than click the link]

Seems christophermolloy.com has a anti-hotlinking script installed -
which prevents the hotlinking of the image in Google Maps :)


On Sep 23, 4:13 pm, treebles wrote:
> I cannot access your image athttp://www.christophermolloy.com/ge/0101.png

Chris M

unread,
Sep 23, 2009, 5:58:24 PM9/23/09
to KML Developer Support - Getting Started with KML
Thank you, treebles/Barry.

I moved the images to my other web host and the problem is sorted now.
Not sure what's changed on the first web host though - might need to
look into that...

Thanks, again!

Chris.
Reply all
Reply to author
Forward
0 new messages