Different size custom icons in a kml file

142 views
Skip to first unread message

az az

unread,
Oct 25, 2011, 9:12:00 AM10/25/11
to Google Maps JavaScript API v3
Hi
I have a custom icons in this kml file:
http://www.bgstreet.co.uk/bgstr/people23.kml
there are different styles for the icons.
Is it possible to use different sizes as well? How do I do this? Do I
have to create more styles in the kml, i.e. for this
http://www.bgstreet.co.uk/bgstr/images/a1.png
which is 90x90 px, if I create one called a1-2.jpg which is 120x120px
is it going to be bigger on the map?
Thanks

Joseph Elfelt

unread,
Oct 26, 2011, 8:48:52 AM10/26/11
to Google Maps JavaScript API v3
To the best of my knowledge you need to create a separate style in
your KML file for each icon size.
Each style will point to a different png file.

Rossko

unread,
Oct 26, 2011, 11:47:09 AM10/26/11
to Google Maps JavaScript API v3
I believe kmlLayer is restricted to 32x32 icons. You may not be using
kmlLayer, can't guess.

Here's a group for general KML discussions
http://groups.google.com/group/kml-support

Here's the KML tutorial
http://code.google.com/apis/kml/documentation/kml_tut.html

Joseph Elfelt

unread,
Oct 26, 2011, 11:58:52 AM10/26/11
to Google Maps JavaScript API v3
I thought the size limit for KML icons displayed via the API was 64x64.

Rossko

unread,
Oct 26, 2011, 12:24:46 PM10/26/11
to Google Maps JavaScript API v3

az az

unread,
Oct 27, 2011, 4:52:01 AM10/27/11
to Google Maps JavaScript API v3
Thanks,
after reading about the scale element here
http://code.google.com/apis/kml/documentation/kmlreference.html#scale

and after setting my icons to be 30x30px

and after

<Style id="a3"><IconStyle><scale>2</scale><Icon> <href>http://
www.bgstreet.co.uk/bgstr/images/a3.png</href> </Icon></IconStyle></
Style>

<Style id="a2"><IconStyle><scale>0.5</scale><Icon> <href>http://
www.bgstreet.co.uk/bgstr/images/a3.png</href> </Icon></IconStyle></
Style>

in my kml file

still all icons on the map look exactly the same. Am I doing something
wrong and is this the right way to go.
Actually is it possible to have different sized icons in a kml?
That is to say, if the base icon is 30x30px, something of scale 0.5 to
look 15x15px and something of scale 2 to be 60x60px on the map.

Joseph Elfelt

unread,
Oct 27, 2011, 7:26:09 AM10/27/11
to Google Maps JavaScript API v3
Rossko,

You're right. If you put a 64x64 icon in a KML file, then Google will
scale it down to 32x32.

By contrast, the API allows 64x64 icons.

geoco...@gmail.com

unread,
Oct 27, 2011, 9:17:51 AM10/27/11
to Google Maps JavaScript API v3
On Oct 27, 1:52 am, az az <lefte...@bgnet.bg> wrote:
> Thanks,
> after reading about the scale element here

http://code.google.com/apis/kml/documentation/kmlreference.html#scale

True, kml (and I believe Google Earth support the <scale> tag on
icons, but...

If you look at what is supported in Google Maps (and the APIs):

http://code.google.com/apis/kml/documentation/kmlelementsinmaps.html

you will see:
<scale> no

(scale is not supported)

-- Larry


>
> and after setting my icons to be 30x30px
>
> and after
>
> <Style id="a3"><IconStyle><scale>2</scale><Icon> <href>http://www.bgstreet.co.uk/bgstr/images/a3.png</href> </Icon></IconStyle></
> Style>
>
> <Style id="a2"><IconStyle><scale>0.5</scale><Icon> <href>http://www.bgstreet.co.uk/bgstr/images/a3.png</href> </Icon></IconStyle></

Garthan

unread,
Oct 28, 2011, 1:00:45 PM10/28/11
to google-map...@googlegroups.com
The scale parameter being supported is one of the new
 features coming in my GeoXmlV3 parser.

geoco...@gmail.com

unread,
Oct 30, 2011, 6:47:26 PM10/30/11
to Google Maps JavaScript API v3
On Oct 28, 10:00 am, Garthan <lancealand...@gmail.com> wrote:
> The scale parameter being supported is one of the new
>  features coming in my GeoXmlV3 parser.

I might be doing something wrong, but it doesn't seem to work:

http://www.geocodezip.com/geoxml3_test/v3_geoxmlv3_kmltest_linkto.html?filename=http://www.geocodezip.com/geoxml3_test/councilsites_co_uk_carparks_scale_kml.xml

Doesn't seem to work in IE (at all) either, I'll investigate when I
get a chance.

-- Larry
Reply all
Reply to author
Forward
0 new messages