0
votes

I am trying to attach some extended data (non typed) to a gx:track (finally, inside a gx:multitrack) such that if I click a track, i'd like to see a balloon with the text I put.

UPD Note: I need different data for different tracks inside a multitrack (which is inside a placemark), i.e.:

<Placemark>
    <name>2010-05-28T01:16:35.000Z</name>
    <gx:Track>
        <when>2010-05-28T02:02:09Z</when>
        <when>2010-05-28T02:02:35Z</when>
        <when>2010-05-28T02:02:44Z</when>
        <gx:coord>-122.207881 37.371915 156.000000</gx:coord>
        <gx:coord>-122.205712 37.373288 152.000000</gx:coord>
        <gx:coord>-122.204678 37.373939 147.000000</gx:coord>
        <ExtendedData>
            <Data name="number">
                <displayName>Some number</displayName>
                <value>1</value>
            </Data>
            <Data name="desc">
                <displayName>Some string</displayName>
                <value>abc</value>
            </Data>
        </ExtendedData>
    </gx:Track>
    <gx:Track>
        <when>2010-05-28T02:02:53Z</when>
        <when>2010-05-28T02:02:54Z</when>
        <when>2010-05-28T02:02:55Z</when>
        <when>2010-05-28T02:02:56Z</when>
        <gx:coord>-122.203572 37.374630 142.199997</gx:coord>
        <gx:coord>-122.203451 37.374706 141.800003</gx:coord>
        <gx:coord>-122.203329 37.374780 141.199997</gx:coord>
        <gx:coord>-122.203207 37.374857 140.199997</gx:coord>
        <ExtendedData>
            <Data name="number">
                <displayName>Some number</displayName>
                <value>2</value>
            </Data>
            <Data name="desc">
                <displayName>Some string</displayName>
                <value>defghj</value>
            </Data>
        </ExtendedData>
    </gx:Track>
</Placemark>

But in the example the extended data I define does not appear in Google Earth. How can I do it right way in kml?

KML example with extended typed data (SchemaData) work fine, I can see the data in the evaluation profile (not what I need)

KML example with <Data> works for placemarks. But I can't make work <Data> inside <ExtendedData> of <gx:Track>

I'm getting empty balloons (Google Earth 7.1.1.1871 on Linux 3.9.0.0 64 bits) Any ideas? Thanks.

1

1 Answers

1
votes

If you want extended data to appear in the Balloon not the elevation profile then you need to add an ExtendedData element directly to the Placemark not the gx:Track as in the example below.

Adding data in schema in the gx:Track as a <gx:SimpleArrayData> will appear in the elevation profile as described in this example.

<Placemark>
    <name>2010-05-28T01:16:35.000Z</name>
    <ExtendedData>
        <Data name="number">
            <value>1</value>
        </Data>
        <Data name="field">
            <value>4</value>
        </Data>
        <Data name="yardage">
            <value>234</value>
        </Data>
    </ExtendedData>
    <styleUrl>#multiTrack</styleUrl>
    <gx:Track>
        <when>2010-05-28T02:02:09Z</when>
        <when>2010-05-28T02:02:35Z</when>
        <when>2010-05-28T02:02:44Z</when>
        <when>2010-05-28T02:02:53Z</when>
        <when>2010-05-28T02:02:54Z</when>
        <when>2010-05-28T02:02:55Z</when>
        <when>2010-05-28T02:02:56Z</when>
        <gx:coord>-122.207881 37.371915 156.000000</gx:coord>
        <gx:coord>-122.205712 37.373288 152.000000</gx:coord>
        <gx:coord>-122.204678 37.373939 147.000000</gx:coord>
        <gx:coord>-122.203572 37.374630 142.199997</gx:coord>
        <gx:coord>-122.203451 37.374706 141.800003</gx:coord>
        <gx:coord>-122.203329 37.374780 141.199997</gx:coord>
        <gx:coord>-122.203207 37.374857 140.199997</gx:coord>
        <ExtendedData>
            <SchemaData schemaUrl="#schema">
                <gx:SimpleArrayData name="cadence">
                    <gx:value>86</gx:value>
                    <gx:value>103</gx:value>
                    <gx:value>108</gx:value>
                    <gx:value>113</gx:value>
                    <gx:value>113</gx:value>
                    <gx:value>113</gx:value>
                    <gx:value>113</gx:value>
                </gx:SimpleArrayData>
                ...
            </SchemaData>
        </ExtendedData>
    </gx:Track>
</Placemark>