Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3871522
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T21:49:55+00:00 2026-05-19T21:49:55+00:00

We are using GMaps with a KML feed to display locations on a map.

  • 0

We are using GMaps with a KML feed to display locations on a map. Here’s an example:

http://jugendinfo.de/themen.php/873/geo.html

The pins on this map should be red, so I used the following PHP4 code in the KML generator to set the color:

$snode = $dom->create_element('Style');
$styleNode = $docNode->append_child($snode);
$styleNode->set_attribute('id', 'normalPlacemark');

$lnode = $dom->create_element('LabelStyle');
$labelNode = $styleNode->append_child($lnode);

$cnode = $dom->create_element('color');
$colorNode = $labelNode->append_child($cnode);

$colorText = $dom->create_text_node('ffcc0000');
$colorNode->append_child($colorText);

This results in the following KML code:

<Style id="normalPlacemark">
  <LabelStyle>
    <color>ffcc0000</color>
  </LabelStyle>
</Style>

The full KML source can be loaded from this location:

http://jugendinfo.de/feeds/geo.php/873.kml

However, the color style seems not to be respected. Without any style element in the KML document, the pins are even not displayed. How do I change the color? The API docs seem to be very limited about this issue and example PHP code snippets are even pretty buggy, I couldn’t get any hints how to get it working. Most examples seem to apply to Google Earth instead of Google Maps.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T21:49:55+00:00Added an answer on May 19, 2026 at 9:49 pm
    • LabelStyle actually refers to the color of the label that is drawn in google earth not the color of the pushpin image.
    • Color in KML is specified in the following format aabbggrr where a if alpha, b is blue, r is red in hex so it is different to rrggbb that is used on the web

    If you would like to change the image use IconStyle. I don’t think that the color spec works in google maps but you can specify a custom icon image url for your placemark.

    <Style id="normalPlacemark">
        <IconStyle>
                 <color>ff00ff00</color>
                             <Icon>
                    <href>http://maps.google.com/mapfiles/kml/pal3/icon21.png</href>
                 </Icon>
              </IconStyle>
    </Style>
    

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

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got a static map link using this wizard http://gmaps-samples.googlecode.com/svn/trunk/simplewizard/makestaticmap.html and the marker is
This is puzzling me. I'm using Google Map's Geocoding to find locations. I am
using jquery-ui-map here is my code $(document).ready(function() {$('#map_canvas').gmap({ 'center': new google.maps.LatLng(3.162456,21.09375), 'zoom': 2, 'streetViewControl':
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
I'm loading a page containing a GMaps using the ajax() method of jQuery. The
I'm fairly new to gmaps and Im using v2 because of the search function
I'm using google map API along with the MarkerManager . I load the 2
What is Google map's spatial reference system using when you enter a lat, long
I am folowing this example to display tabbed infowindo for google maps : combined
If you use the satellite GMapType using this Google-provided example in v3 of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.