Icon scaling in Google Maps

1,070 views
Skip to first unread message

PaulC

unread,
Jun 9, 2010, 4:28:24 PM6/9/10
to KML Developer Support - Getting Started with KML
Google map appears to be ignoring my icon scale. The relevant code
looks like,

<Style id='icon0'>
<IconStyle>
<scale>1</scale>
<Icon>
<href>http://www.ats.amherst.edu/countytest/parks.png</href>
</Icon>
</IconStyle>
</Style>
<Style id='icon1'>
<IconStyle>
<scale>1.4</scale>
<Icon>
<href>http://www.ats.amherst.edu/countytest/parks.png</href>
</Icon>
</IconStyle>
</Style>
<Style id='icon2'>
<IconStyle>
<scale>1.8</scale>
<Icon>
<href>http://www.ats.amherst.edu/countytest/parks.png</href>
</Icon>
</IconStyle>
</Style>
<Placemark>
<name>Connecticut</name>
<styleUrl>#icon0</styleUrl>
<Point>
<coordinates>-72.5372314453125,41.7016273437892</coordinates>
</Point>
</Placemark>

The are six different placemarks, each using one of the three
different styles. However, all are the same size on the map.

What don't I understand?

Nymor

unread,
Jun 9, 2010, 6:14:07 PM6/9/10
to KML Developer Support - Getting Started with KML
Hi,

I don't believe Maps recognises the <scale> tag - see
http://code.google.com/intl/en/apis/kml/documentation/kmlelementsinmaps.html#
for a list of KML elements Maps supports.

Also look at this thread
http://groups.google.com/group/google-earth-browser-plugin/browse_thread/thread/6e3ffda6836f0760
where it was confirmed (and I assume is still relevent) that Maps
resizes all icons to 32x32. There is also a suggested workaround that
may help you in getting your icons to look smaller than that although
there doesn't seem to be a way of getting them bigger.

Hope that helps

Nymor

PaulC

unread,
Jun 10, 2010, 8:56:06 AM6/10/10
to KML Developer Support - Getting Started with KML
Thanks Nymor.

I wondered about that in the list of supported tags, but since it was
being using in all the examples, I hoped that the documentation was
simply out of date. seems to me to be a pretty big hole in the
functionality.

The work-around is kludgy, but most work-arounds are. I may have to
look at going back to using standard Google maps icons for this
application. That would be slower but more flexible.
Reply all
Reply to author
Forward
0 new messages