How to change placemark shapes

3,813 views
Skip to first unread message

Payal Patel

unread,
Jun 29, 2011, 11:51:39 AM6/29/11
to KML Developer Support - Google Earth Plug-in
Hello,
I'm a Londoner currently interning with an investment company. I'm
new to using Google Earth (but LOVE it!) and new to working with KML.
I'm trying to create a map in Google Earth similar to this:
http://www.nature.com/news/2011/110421/full/472400a/box/2.html#google-gadget-fukushima-large

I have an Excel file with locations and am using a macro to write the
KML code. I'd like to know how I can change the placemark shape from
a pushpin to a circle and how to change the color? Any help would be
MUCH appreciated!

Cheers,
Payal

Nymor

unread,
Jun 29, 2011, 2:07:44 PM6/29/11
to KML Developer Support - Google Earth Plug-in
Hi,

The full KML reference is at:-
http://code.google.com/apis/kml/documentation/kmlreference.html

for placemark icons look at the "Icon" and "IconStyle" sections.

Regards
Nymor



On Jun 29, 4:51 pm, Payal Patel wrote:
> Hello,
> I'm a Londoner currently interning with an investment company.  I'm
> new to using Google Earth (but LOVE it!) and new to working with KML.
> I'm trying to create a map in Google Earth similar to this:http://www.nature.com/news/2011/110421/full/472400a/box/2.html#google...

Payal Patel

unread,
Jul 1, 2011, 8:37:29 AM7/1/11
to KML Developer Support - Google Earth Plug-in
Thanks so much. Is there any way to do use Google Earth polygons? My
concern is using external free icon sites that won't necessarily
always be around. I was very impressed with this (http://
www.nature.com/news/2011/110421/full/472400a/box/2.html#google-gadget-fukushima-large)
and am trying to replicate it for a different purpose.



On Jun 29, 1:07 pm, Nymor wrote:
> Hi,
>
> The full KML reference is at:-http://code.google.com/apis/kml/documentation/kmlreference.html
>
> for placemark icons look at the "Icon" and "IconStyle" sections.
>
> Regards
> Nymor
>
> On Jun 29, 4:51 pm,PayalPatel wrote:
>
>
>
> > Hello,
> > I'm a Londoner currently interning with an investment company.  I'm
> > new to using Google Earth (but LOVE it!) and new to working with KML.
> > I'm trying to create a map in Google Earth similar to this:http://www.nature.com/news/2011/110421/full/472400a/box/2.html#google...
>
> > I have an Excel file with locations and am using a macro to write the
> > KML code.  I'd like to know how I can change the placemark shape from
> > a pushpin to a circle and how to change the color?  Any help would be
> > MUCH appreciated!
>
> > Cheers,
> >Payal- Hide quoted text -
>
> - Show quoted text -

Josh L

unread,
Jul 6, 2011, 8:24:43 PM7/6/11
to KML Developer Support - Google Earth Plug-in
Just to be clear, they are using icons not polygons. And you should
be able to create your own simple circle icons in any image editing
program if you want.

That said you can of course also use polygons (http://code.google.com/
apis/kml/documentation/kml_tut.html#polygons) if you want, but this
sounds like it would just add unnecessary complexity for your use
case, as I understand it.

Cheers,

-Josh

On Jul 1, 5:37 am, Payal Patel wrote:
> Thanks so much.  Is there any way to do use Google Earth polygons?  My
> concern is using external free icon sites that won't necessarily
> always be around.  I was very impressed with this (http://www.nature.com/news/2011/110421/full/472400a/box/2.html#google-gadget...)

Payal Patel

unread,
Jul 7, 2011, 2:44:21 PM7/7/11
to KML Developer Support - Google Earth Plug-in
Hi Josh!
I'm struggling to understand the difference between icons/polygons.
Essentially, I am mapping buildings located aound the world.

I'd like to use circles for each building and use a different color to
designate whether it is an office building or an apartment. Is that
even possible? If so, what's the easiest method? Would it be
possible to alter the size of the circles (i.e. big circles for big
buildings and smaller circles for small buildings)?

I'm a generally bright individual, but this is new territory to me.
So any basic help would be appreciated!

-Payal


On Jul 6, 7:24 pm, Josh L wrote:
> Just to be clear, they are using icons not polygons.  And you should
> be able to create your own simple circle icons in any image editing
> program if you want.
>
> That said you can of course also use polygons (http://code.google.com/
> apis/kml/documentation/kml_tut.html#polygons) if you want, but this
> sounds like it would just add unnecessary complexity for your use
> case, as I understand it.
>
> Cheers,
>
>  -Josh
>
> On Jul 1, 5:37 am,PayalPatel wrote:
>
>
>
> > Thanks so much.  Is there any way to do use Google Earth polygons?  My
> > concern is using external free icon sites that won't necessarily
> > always be around.  I was very impressed with this (http://www.nature.com/news/2011/110421/full/472400a/box/2.html#google......)
> > and am trying to replicate it for a different purpose.
>
> > On Jun 29, 1:07 pm, Nymor wrote:
>
> > > Hi,
>
> > > The full KML reference is at:-http://code.google.com/apis/kml/documentation/kmlreference.html
>
> > > for placemark icons look at the "Icon" and "IconStyle" sections.
>
> > > Regards
> > > Nymor
>
> > > On Jun 29, 4:51 pm,PayalPatel wrote:
>
> > > > Hello,
> > > > I'm a Londoner currently interning with an investment company.  I'm
> > > > new to using Google Earth (but LOVE it!) and new to working with KML.
> > > > I'm trying to create a map in Google Earth similar to this:http://www.nature.com/news/2011/110421/full/472400a/box/2.html#google...
>
> > > > I have an Excel file with locations and am using a macro to write the
> > > > KML code.  I'd like to know how I can change the placemark shape from
> > > > a pushpin to a circle and how to change the color?  Any help would be
> > > > MUCH appreciated!
>
> > > > Cheers,
> > > >Payal- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -

Josh L

unread,
Jul 7, 2011, 6:50:28 PM7/7/11
to KML Developer Support - Google Earth Plug-in
Yes, this is quite possible. You should use Point Placemarks, with an
icon in the shape of a circle. You can use <scale> to set the
relative size of your icon.

See http://code.google.com/apis/kml/documentation/kmlreference.html#icon
for more info.

Cheers,

-Josh

Payal Patel

unread,
Jul 14, 2011, 3:04:58 PM7/14/11
to KML Developer Support - Google Earth Plug-in
Thanks, Josh. That's great to know. I really am a coding beginner
and can generally get the gist of creating placemarks. I don't know
how to write the code for a circle. Is there a specific example for
what the output should look like? Also, I'm confused in whether I
need to use icons, icon styles, stylemaps, styleIDs, or polygons from
the Google searches I've done. Can anyone provide a layman's
explanation?

-Payal

On Jul 7, 5:50 pm, Josh L wrote:
> Yes, this is quite possible.  You should use Point Placemarks, with an
> icon in the shape of a circle.  You can use <scale> to set the
> relative size of your icon.
>
> Seehttp://code.google.com/apis/kml/documentation/kmlreference.html#icon

Payal Patel

unread,
Jul 14, 2011, 3:58:32 PM7/14/11
to KML Developer Support - Google Earth Plug-in
Also, I've struggled with this for over 3 weeks and am sure it's a 2
min answer. Could I give you a call and compensate you if necessary?

-Payal


On Jul 14, 2:04 pm, Payal Patel wrote:
> Thanks, Josh.  That's great to know.  I really am a coding beginner
> and can generally get the gist of creating placemarks.  I don't know
> how to write the code for a circle.  Is there a specific example for
> what the output should look like?  Also, I'm confused in whether I
> need to use icons, icon styles, stylemaps, styleIDs, or polygons from
> the Google searches I've done.  Can anyone provide a layman's
> explanation?
>
> -Payal
>
> On Jul 7, 5:50 pm, Josh L wrote:
>
>
>
> > Yes, this is quite possible.  You should use Point Placemarks, with an
> > icon in the shape of a circle.  You can use <scale> to set the
> > relative size of your icon.
>
> > Seehttp://code.google.com/apis/kml/documentation/kmlreference.html#icon
> > for more info.
>
> > Cheers,
>
> >  -Josh
>

chris2

unread,
Jul 14, 2011, 4:56:45 PM7/14/11
to KML Developer Support - Google Earth Plug-in
Try

<Placemark>
<name>Fuchstanz</name>
<visibility>1</visibility>
<LookAt>
<longitude>8.468658036892315</longitude>
<latitude>50.21580014058542</latitude>
<altitude>0</altitude>
<heading>-7.689030780332044</heading>
<tilt>0</tilt>
<range>411.2722717815587</range>
</LookAt>
<Style>
<IconStyle>
<scale>0.9</scale>
<heading>0</heading>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pal2/icon26.png</
href>
</Icon>
<gx:headingMode>northUp</gx:headingMode>
</IconStyle>
<LabelStyle>
<scale>1.1</scale>
</LabelStyle>
</Style>
<Point>
<coordinates>8.467683672957108,50.21600747754157,0</coordinates>
</Point>
</Placemark>

GuyKelly

unread,
Jul 15, 2011, 12:29:47 PM7/15/11
to KML Developer Support - Google Earth Plug-in
Payal,

A Polygon is used to draw an "area" or a "zone" in Google Earth.
Example: Draw a zone around a commercial district and color it red.

You do not want to use the Polygon feature for your application. If I
understand, you are just trying to draw a point for each building.

To make different icons for each building type, just create different
Styles in the top of your KML.

<Style id="bigYellowBuilding">
<IconStyle>
<color>ff00ffff</color> <!-- yellow -->
<scale>2</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png</
href>
</Icon>
</IconStyle>
</Style>

<Style id="smallRedBuilding">
<IconStyle>
<color>ff00ffff</color> <!-- red -->
<scale>1</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png</
href>
</Icon>
</IconStyle>
</Style>

etc.

Just modify the styles as you like, and then reference them in your
Placemarks for each Point through use of the
<styleUrl>#smallRedBuilding</styleUrl> or <styleUrl>#yourStyleHere</
style>.

Hopefully this is the 2 minute answer you were seeking.

In your macro, just put in an IF statement to control which style to
associate with each building.

Example (pseudo-code):

IF (buildingType == APARTMENT) THEN
print(<styleUrl>#apartmentStyle</styleUrl>);
ELSEIF (buildingType == OFFICE) THEN
print(<styleUrl>#officeStyle</styleUrl>);
END

Hopefully this helps!
-Kelly

Payal Patel

unread,
Jul 20, 2011, 4:05:39 PM7/20/11
to KML Developer Support - Google Earth Plug-in
THANKS!
> On Jul 14, 2:58 pm,PayalPatel wrote:
>
>
>
> > Also, I've struggled with this for over 3 weeks and am sure it's a 2
> > min answer.   Could I give you a call and compensate you if necessary?
>
> > -Payal
>

mikemcc

unread,
Jul 21, 2011, 3:50:48 AM7/21/11
to KML Developer Support - Google Earth Plug-in
Hello Payal. You might find this discussion useful:

http://groups.google.com/group/kml-support-advanced/browse_thread/thread/28c2174df4f3e9dc/d5f6b87481ed0407?lnk=gst&q=mikemcc+%2Bicons#d5f6b87481ed0407

It allows you to display combinations of different icons and different
colours according to different data categories. I'm not a professional
programmer but managed to use the Google Charts API.
Reply all
Reply to author
Forward
0 new messages