views:

962

answers:

4

I'm using the GGeoXml object to overlay KML on an embedded Google Map. I need to customize the popup balloon for placemarks, so I'm trying to use the <BalloonStyle> element:

<?xml version="1.0" encoding="utf-8"?>
<Document xmlns="http://earth.google.com/kml/2.0"&gt;
    <name>Concessions</name>
    <Style id="masterPolyStyle">
        ...
        <BalloonStyle>
            <text>
                <![CDATA[
                  <h6>Concession</h6>
                  <h4>$[name]</h4>
                  <p>$[description]</p>
                ]]>
            </text>
            <displayMode>default</displayMode>
            <bgColor>DDA39B81</bgColor>
        </BalloonStyle>
    </Style>

    ...

</Document>

This works as expected in Google Earth, but the embedded map API appears to ignore this altogether. I suppose I could just leave out the <name> element altogether and just put everything in HTML inside the <description> element, but I'd like to be able to take advantage of the <ExtendedData> element to display custom data in a structured way.

+1  A: 

No, like you have mentioned, html in the description is the only way I know that you can control the style of balloons through kml/georss feed.

smazurov
+2  A: 

This is now documented here (2009/04):

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

  • < BalloonStyle > no

(When did you ask this ? This forum/service needs a big fat DATE on each question, with a year in it :-) )

2$c, *pike

pike
Thanks for the update. If you hover over the date in my signature above, you can get the full date and time of the original post.
Herb Caudill
A: 

I have built a html page with google map and I have created a polygon kmz file this file ALLOW TO SHOW polygon information in google map contrary to what described by http://code.google.com/apis/kml/documentation/kmlelementsinmaps.html but I do not know how I have obtained the result. Someone can help me to discover how I have obtained it ?

If you are interested please write me

my e-mail is [email protected]

please not spam me.

Francis

A: 

Actually, the document referenced above (http://code.google.com/apis/kml/documentation/kmlelementsinmaps.html) must have changed, b/c now it says:

<BalloonStyle> partially only <text> is supported

My problem is that the <text> seems to work for one KML file, but not another. The one that works for has polygon placemarkers, the other has points represented by icons - I wonder if that is why...

Tom