Custom KML icons not showing

1,494 views
Skip to first unread message

Richardmtl

unread,
Jul 13, 2010, 11:38:41 PM7/13/10
to Google Maps JavaScript API v3
Hi!

So I've seen this issue being mentioned a few times in this forum, but
I haven't come across a solution that seems to work.

My map is on my main site (http://mexicometro.org; don't bother
worrying about the other pages, I'm in the process of switching over
to v3 and I'm not done yet, only on my index.php). I have tried to
load a kmz file that has many custom icons, but all I get is the blue
default icon. Same with google maps (though I noticed that on Google
Maps, SOME of the icons appear).

I tried with 2 differently-named files (thinking that it was maybe the
Google cache; I had an error in my kmz before because I wasn;t giving
an absolute href for the icons): http://mexicometro.org/Mexico-Metro.kmz
and http://mexicometro.org/test.kmz


Oh! I just n!oticed that if I turn on and off some of the icons on the
google maps page, some of them turn into the blue default icon! So
there's a limit as to how many will appear on the google maps. But why
would that limit affect my map using the api? And in any case, NO
custom icons appear on my page.

So, any advice?

Thanks,

Richard



Jonathanccwong

unread,
Jul 14, 2010, 2:55:30 PM7/14/10
to Google Maps JavaScript API v3
Hi,
From my experience the icons can either be PNGs or JPGs. it really
doesn't matter.
one thing though is that the icons should be 32x32 (or if it is not,
make it so and fill the voids with a transparent background <-- png)
The size is also an issue. I'm not sure how big the icons can be, but
mine are no more than a few KB and they show up fine.

Jon

On Jul 13, 8:38 pm, Richardmtl <rich...@richardarchambault.ca> wrote:
> Hi!
>
> So I've seen this issue being mentioned a few times in this forum, but
> I haven't come across a solution that seems to work.
>
> My map is on my main site (http://mexicometro.org;don't bother
> worrying about the other pages, I'm in the process of switching over
> to v3 and I'm not done yet, only on my index.php). I have tried to
> load a kmz file that has many custom icons, but all I get is the blue
> default icon. Same with google maps (though I noticed that on Google
> Maps, SOME of the icons appear).
>
> I tried with 2 differently-named files (thinking that it was maybe the
> Google cache; I had an error in my kmz before because I wasn;t giving
> an absolute href for the icons):http://mexicometro.org/Mexico-Metro.kmz
> andhttp://mexicometro.org/test.kmz

Rossko

unread,
Jul 14, 2010, 3:19:16 PM7/14/10
to Google Maps JavaScript API v3
> So
> there's a limit as to how many will appear on the google maps. But why
> would that limit affect my map using the api?

Yes, there are limits
http://code.google.com/apis/kml/documentation/mapsSupport.html
your KML does appear very complex.

The API uses essentially the same KML renderer, which runs at Google's
servers, as maps.google.com

Icons are always rendered 32x32 whatever the original image size.

Richardmtl

unread,
Jul 14, 2010, 3:32:08 PM7/14/10
to Google Maps JavaScript API v3
Hello,

Well, my icons are 25X25, maybe that's causing a problem, I'll see
about changing it.

My KML is a bit complex, but more than that, it's very long.. :)

Funny thing is though that it used to work fine under v2, all icons
showe dup properly, so I don't know why it wouldn't be working
properly anymore.

Thanks,

R

MLSX.NET GMap

unread,
Jul 16, 2010, 6:43:23 AM7/16/10
to Google Maps JavaScript API v3

Hi my friends,

Here is a link to my KML file that no longer
displays my custom icons, and I must say I have tried everything.

http://mlsx.net/v7/scripts/a/kmltest.kml

Here's the same KML opened in google maps,
http://maps.google.com/maps?q=http://mlsx.net/v7/scripts/a/kmltest.kml
As you can see no custom icons.

I have compared my KML to other websites that do work and it seems to
be perfect.
The only thing that makes sense to me is if Google Maps is blocking my
icons.

Please, if you have any idea at all, please help with this issue.
I have been trying to solve this for a while now.

FYI: The custom icons do appear using the Google Earth API.


Thank You,


Robert

Pil

unread,
Jul 16, 2010, 9:25:19 AM7/16/10
to Google Maps JavaScript API v3
Finally I got to work with your icons

http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=http:%2F%2Fsites.google.com%2Fsite%2Fmxamples%2Fkmltest4.kml&sll=37.753366,-121.434074&sspn=0.026602,0.047121&ie=UTF8&ll=37.745404,-121.44227&spn=0.026605,0.047121&z=14

The kml code seems uttermost sensitive to the slightest changes -
beyound validity.



On Jul 16, 12:43 pm, "MLSX.NET GMap" <robertclarkwo...@gmail.com>
wrote:
> Hi my friends,
>
> Here is a link to my KML file that no longer
> displays my custom icons, and I must say I have tried everything.
>
> http://mlsx.net/v7/scripts/a/kmltest.kml
>
> Here's the same KML opened in google maps,http://maps.google.com/maps?q=http://mlsx.net/v7/scripts/a/kmltest.kml

MLSX.NET GMap

unread,
Jul 16, 2010, 12:29:28 PM7/16/10
to Google Maps JavaScript API v3
YES!

Looks like using the tag <Document> instead of the tag <Folder> made
all the difference.

You totally rock \m/(~~)\m/

Thank you so much.

Robert
Reply all
Reply to author
Forward
0 new messages