How to change placemark's font & color

5,685 views
Skip to first unread message

Anirudha Deshpande

unread,
Nov 16, 2011, 6:15:28 AM11/16/11
to google-earth-...@googlegroups.com
Hi ,
 
I am using google earth javascript  API . I am refering developers guide for adding placemarks ,ballons etc.
 

I am creating placemark as follows  

var placemark = ge.createPlacemark('');

placemark.setName("Placemark1");

Now I  want to show Text "Placemark1"  in bold  format with different font & in Red color.

Also  I want to keep size for the text in smaller  font

How to achieve this?

 

Thanks & Regards,

Anirudha Deshpande

 

Brendan Kenny

unread,
Nov 23, 2011, 8:25:50 PM11/23/11
to KML Developer Support - Google Earth Plug-in
Hi Anirudha,

If you haven't already found a solution, you should check out
KmlLabelStyle.

http://code.google.com/apis/earth/documentation/reference/interface_kml_label_style-members.html

However, styling of labels is limited, and you'll really only be able
to change size and color of the text (pretty much the same options you
have if you create a placemark through the UI in the Google Earth
desktop client).

Cheers,
Brendan

Brandon Ertis

unread,
Sep 30, 2013, 2:42:42 PM9/30/13
to google-earth-...@googlegroups.com
I came across this trying to figure out if there was a way to edit the font and other appearance attributes of placemark labels. Adding this functionality to Google Earth would be wonderful!

I hope somebody high up at Google reads this and makes it happen :)

Peter Baxter

unread,
Jan 30, 2014, 2:12:41 AM1/30/14
to google-earth-...@googlegroups.com
I agree, the font is too "bold" and pretty annoying when you have a lot of labels - I'd like the option to use a much cleaner font

chandra nadukula

unread,
Mar 19, 2014, 4:16:07 PM3/19/14
to google-earth-...@googlegroups.com
Hi Anirudha,

I am not sure if you had found a solution to your question, but i had a similar challenge to set the color of my label and I achieved it like this. 

var style = instance.createStyle(''); // create a style
style.getIconStyle().setScale(0.4); // this reduces the size of your placemarks
style.getLabelStyle().setScale(0.8); //Sets the scale for the setName label. (This changes the font size of your label)
style.getLabelStyle().getColor().set('ff0000ff'); //This line sets the color of the label in this case red 


I know this is way later than when you expected a reply, but i could not find a concrete solution to setting the color of a label recently, with some trial and error got the solution. Hope this helps.

Thanks,
Chandra
Reply all
Reply to author
Forward
0 new messages