KLM Marker distorted

33 views
Skip to first unread message

Phild

unread,
May 1, 2009, 10:01:06 PM5/1/09
to KML Developer Support - Getting Started with KML
I am generating a Google KML file with a number of points. For some
set of these points I want to have markers which are say Red and for
the others I want markers which are say Blue. For all the markers I
want a unique label eg: 'A', 'B', 'C'.

I found a downloaded a large set of markers from the net (http://
www.benjaminkeen.com/?p=105), with different colors and labels.. eg
all red A-Z, all blue, A-Z. so it is fairly easy to generate a url to
select the correct marker eg .../markers/blue_markerB.png. and this is
what I was in the process of doing. However, when the marker is
displayed Google has distorted the shape (squat and wide) and is quite
dissimilar from the original shape.

So my question(s) are:

Why is Google doing this?
Can I fix it.?

Or:

Is there a set of compound/layered markers which Google supplies eg
Blue+Letter that I can use and how are they used (code example please)
that I can use with KLM?

Below is my test code: It should be possible to import this into
mymaps to see the result.

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>test.kml</name>
<Style id="marker1">
<IconStyle>
<scale>1.1</scale>
<Icon>
<href>http://97.85.145.94/joomla/CourseDetails/mapMarkers/
green_MarkerA.png</href>
</Icon>
</IconStyle>
</Style>
<Style id="marker2">
<IconStyle>
<scale>1.5</scale>
<Icon>
<href>http://97.85.145.94/joomla/CourseDetails/mapMarkers/
blue_MarkerA.png</href>
</Icon>
</IconStyle>
</Style>
<Placemark>
<name>Newport</name>
<description>Newport beach golf club</description>
<styleUrl>#marker1</styleUrl>
<Point>
<coordinates>-117.88117110729218,33.610348371131316,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Bar</name>
<description>Nice Bar</description>
<styleUrl>#marker2</styleUrl>
<Point>
<coordinates>-117.87686884403229,33.60939229911372,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>

Roman N

unread,
May 6, 2009, 12:26:15 PM5/6/09
to KML Developer Support - Getting Started with KML
Hi Phild,

Google Maps automatically resizes all marker icons to 32x32 (or is it
34x34?). If you generate your marker icons at that size, with
transparent pixels at the sides of the actual pushpin/paddle image,
Maps won't distort it. I believe there's an issue for this in the
issue tracker:

http://code.google.com/p/kml-samples/issues/list

If not, feel free to file a new report there.

Thanks,
Roman

On May 1, 7:01 pm, Phild wrote:
> I am generating a Google KML file with a number of points.  For some
> set of these points I want to have markers which are say Red and for
> the others I want markers which are say Blue.   For all the markers I
> want a unique label eg: 'A', 'B', 'C'.
>
> I found a downloaded a large set of markers from the net (http://www.benjaminkeen.com/?p=105), with different colors and labels.. eg

Phild

unread,
May 11, 2009, 11:47:44 AM5/11/09
to KML Developer Support - Getting Started with KML
Roman,

thank you for your response. That is exactly the issue and when I
create markers as you suggest, the problem is solved.

Best
Phil
Reply all
Reply to author
Forward
0 new messages