0

在 Google 地球中,我的气球在打开时没有指向我线路上的正确位置。他们太棒了。我读了几个地方,可以通过向多几何地标添加一个点来解决这个问题,它会指向那个。但它不工作!有解决办法吗?我正在使用 Mac 和 Google 地球 7.1

谢谢,艾伦

    <?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
    <name>KmlFile</name>
    <Schema name="Gorge_Trails" id="Trails_Schema_id">
        <SimpleField type="string" name="Trail_number"><displayName>&lt;b&gt;Trail_number&lt;/b&gt;</displayName>
</SimpleField>
        <SimpleField type="string" name="Trail_name"><displayName>&lt;b&gt;Trail_name&lt;/b&gt;</displayName>
</SimpleField>
        <SimpleField type="string" name="Location"><displayName>&lt;b&gt;Location&lt;/b&gt;</displayName>
</SimpleField>
        <SimpleField type="string" name="Difficulty"><displayName>&lt;b&gt;Difficulty&lt;/b&gt;</displayName>
</SimpleField>
        <SimpleField type="string" name="Picture_URL"><displayName>&lt;b&gt;Picture_URL&lt;/b&gt;</displayName>
</SimpleField>
        <SimpleField type="string" name="Link1"><displayName>&lt;b&gt;Link1&lt;/b&gt;</displayName>
</SimpleField>
        <SimpleField type="string" name="Link2"><displayName>&lt;b&gt;Link2&lt;/b&gt;</displayName>
</SimpleField>
        <SimpleField type="string" name="Photo_credit"><displayName>&lt;b&gt;Photo_credit&lt;/b&gt;</displayName>
</SimpleField>
        <SimpleField type="double" name="Hike_Dist"><displayName>&lt;b&gt;Hike_Dist&lt;/b&gt;</displayName>
</SimpleField>
        <SimpleField type="string" name="Trailhead"><displayName>&lt;b&gt;Trailhead&lt;/b&gt;</displayName>
</SimpleField>
        <SimpleField type="string" name="Type"><displayName>&lt;b&gt;Type&lt;/b&gt;</displayName>
</SimpleField>
        <SimpleField type="double" name="TR_Length"><displayName>&lt;b&gt;TR_Length&lt;/b&gt;</displayName>
</SimpleField>
        <SimpleField type="string" name="Hike_Name"><displayName>&lt;b&gt;Hike_Name&lt;/b&gt;</displayName>
</SimpleField>
        <SimpleField type="string" name="State"><displayName>&lt;b&gt;State&lt;/b&gt;</displayName>
</SimpleField>
        <SimpleField type="string" name="Elevation1"><displayName>&lt;b&gt;Elevation1&lt;/b&gt;</displayName>
</SimpleField>
        <SimpleField type="string" name="Hike_Dis_1"><displayName>&lt;b&gt;Hike_Dis_1&lt;/b&gt;</displayName>
</SimpleField>
    </Schema>
    <Style id="Hikes_highlight_traillink">
        <IconStyle>
            <color>0000ffff</color>
            <scale>0.1</scale>
        </IconStyle>
        <BalloonStyle>
            <text><![CDATA[<table border="0">
          <table width="250" border="0" cellspacing="0" cellpadding="1" bgcolor="#e8e9cb" align="center">
            <tr>
              <td colspan="2" align="center">
                <img src="http://gorgefriends.org/img/gorge_index_02.gif" alt="picture" width="100%" height="50"/>
              </td>
            </tr>
            <tr>
              <td colspan="2" align="center" valign="bottom" cellpadding="1">
                <font color='#3a493e'size=+2> <b>$[Gorge_Trails/Hike_Name]</b></font>
             <tr>
          <td colspan="2" align="center" valign="bottom" cellpadding="1">
                <font color='#3a493e' size=+1 <b>$[Gorge_Trails/Location], $[Gorge_Trails/State]</b></font>
              </td>
            </tr>
            <tr>
             <td colspan="2" align="center">
               <img src=$[Gorge_Trails/Picture_URL] alt="picture" width="100%" height="140"/>    
             </td>
             <tr>
            <td colspan="2" align="center">
                <font color="#999999" size="1">Photo:$[Gorge_Trails/Photo_credit]</font>
             </td>
            </tr>
         <table width="250" border="0" cellspacing="3" cellpadding="0" bgcolor="#e8e9cb" align="center">    
      <tr><td><b>Trailhead</b></td><td>$[Gorge_Trails/Trailhead]</td></tr>
      <tr><td><b>Hike Distance</b></td><td>$[Gorge_Trails/Hike_Dist] miles</td></tr>
      <tr><td><b>Difficu
      lty</b></td><td>$[Gorge_Trails/Difficulty]</td></tr>
      <tr><td><b>Type</b></td><td>$[Gorge_Trails/Type]</td></tr>
      <tr><td><b>Trail Name</b></td><td>$[Gorge_Trails/Trail_name]</td></tr>
    <table width="250" border="0" cellspacing="4" cellpadding="0" bgcolor="#e8e9cb" align="center">
              <tr><td><a href="$[Gorge_Trails/Link2]"><font color=#993300>Rails-to-Trails</font color></a>
            </td></tr>
          <table width="250" border="0" cellspacing="1" cellpadding="0" bgcolor="#e8e9cb" align="center">           <tr>
              <td colspan="2" align="center" valign="bottom">
    <font color="#999999" size="1">Copyright: Friends of the Columbia Gorge/Portlandhikers.org is a proud partner of the</font><a href= http://gorgefriends.org/section.php?id=81><font color="#993300" size="1"> Gorge Towns to Trails Initiative</font></a>
              </td>
            </tr>
          </table>]]></text>
            <bgColor>ff689a9a</bgColor>
        </BalloonStyle>
        <ListStyle>
            <maxSnippetLines>0</maxSnippetLines>
        </ListStyle>
        <LineStyle>
            <color>ff1eede9</color>
            <width>4</width>
        </LineStyle>
    </Style>
    <Style id="Hikes_normal_traillink">
        <IconStyle>
            <color>0000ffff</color>
            <scale>0.1</scale>
        </IconStyle>
        <LabelStyle>
            <scale>0</scale>
        </LabelStyle>
        <BalloonStyle>
            <text><![CDATA[<table border="0">
          <table width="250" border="0" cellspacing="0" cellpadding="1" bgcolor="#e8e9cb" align="center">
            <tr>
              <td colspan="2" align="center">
                <img src="http://gorgefriends.org/img/gorge_index_02.gif" alt="picture" width="100%" height="50"/>
              </td>
            </tr>
            <tr>
              <td colspan="2" align="center" valign="bottom" cellpadding="1">
                <font color='#3a493e'size=+2> <b>$[Gorge_Trails/Hike_Name]</b></font>
             <tr>
          <td colspan="2" align="center" valign="bottom" cellpadding="1">
                <font color='#3a493e' size=+1 <b>$[Gorge_Trails/Location], $[Gorge_Trails/State]</b></font>
              </td>
            </tr>
            <tr>
             <td colspan="2" align="center">
               <img src=$[Gorge_Trails/Picture_URL] alt="picture" width="100%" height="140"/>    
             </td>
             <tr>
            <td colspan="2" align="center">
                <font color="#999999" size="1">Photo:$[Gorge_Trails/Photo_credit]</font>
             </td>
            </tr>
         <table width="250" border="0" cellspacing="3" cellpadding="0" bgcolor="#e8e9cb" align="center">    
      <tr><td><b>Trailhead</b></td><td>$[Gorge_Trails/Trailhead]</td></tr>
      <tr><td><b>Hike Distance</b></td><td>$[Gorge_Trails/Hike_Dist] miles</td></tr>
      <tr><td><b>Difficulty</b></td><td>$[Gorge_Trails/Difficulty]</td></tr>
      <tr><td><b>Type</b></td><td>$[Gorge_Trails/Type]</td></tr>
      <tr><td><b>Trail Name</b></td><td>$[Gorge_Trails/Trail_name]</td></tr>
    <table width="250" border="0" cellspacing="4" cellpadding="0" bgcolor="#e8e9cb" align="center">
              <tr><td><a href="$[Gorge_Trails/Link2]"><font color=#993300>Rails-to-Trails</font color></a>
            </td></tr>
          <table width="250" border="0" cellspacing="1" cellpadding="0" bgcolor="#e8e9cb" align="center">            <tr>
              <td colspan="2" align="center" valign="bottom">
    <font color="#999999" size="1">Copyright: Friends of the Columbia Gorge/Portlandhikers.org is a proud partner of the</font><a href= http://gorgefriends.org/section.php?id=81><font color="#993300" size="1"> Gorge Towns to Trails Initiative</font></a>
              </td>
            </tr>
          </table>]]></text>
            <bgColor>ff689a9a</bgColor>
        </BalloonStyle>
        <ListStyle>
            <maxSnippetLines>0</maxSnippetLines>
        </ListStyle>
        <LineStyle>
            <color>ff000080</color>
            <width>2</width>
        </LineStyle>
    </Style>
    <StyleMap id="Hikes_style_traillink">
        <Pair>
            <key>normal</key>
            <styleUrl>#Hikes_normal_traillink</styleUrl>
        </Pair>
        <Pair>
            <key>highlight</key>
            <styleUrl>#Hikes_highlight_traillink</styleUrl>
        </Pair>
    </StyleMap>
    <Placemark>
        <name>The Dalles Trail</name>
        <LookAt>
            <longitude>-121.1675204504952</longitude>
            <latitude>45.63510133211322</latitude>
            <altitude>0</altitude>
            <heading>-1.634887800693966e-09</heading>
            <tilt>45.00165866539888</tilt>
            <range>11801.15617415238</range>
            <gx:altitudeMode>relativeToSeaFloor</gx:altitudeMode>
        </LookAt>
        <styleUrl>#Hikes_style_traillink</styleUrl>
        <ExtendedData>
            <SchemaData schemaUrl="#Trails_Schema_id">
                <SimpleData name="Trail_number">4406</SimpleData>
                <SimpleData name="Trail_name">The Dalles Trail</SimpleData>
                <SimpleData name="Location">Eastern Gorge</SimpleData>
                <SimpleData name="Difficulty">Easy</SimpleData>
                <SimpleData name="Picture_URL">http://blog.oregonlive.com/terryrichard/2009/05/large_TR.TheDallesTrail.jpg</SimpleData>
                <SimpleData name="Link1">http://gorgefriends.org/display.php?modin=51&amp;uid=4921</SimpleData>
                <SimpleData name="Link2">http://www.traillink.com/trail/the-dalles-riverfront-trail.aspx#tabPhotoGallery</SimpleData>
                <SimpleData name="Photo_credit">Terry Richard/The Oregonian</SimpleData>
                <SimpleData name="Hike_Dist">11.2</SimpleData>
                <SimpleData name="Trailhead">The Dalles Trailhead</SimpleData>
                <SimpleData name="Type">Out and Back</SimpleData>
                <SimpleData name="TR_Length">0</SimpleData>
                <SimpleData name="Hike_Name">The Dalles Rail Trail</SimpleData>
                <SimpleData name="State">Oregon</SimpleData>
                <SimpleData name="Elevation1">200 ft.</SimpleData>
                <SimpleData name="Hike_Dis_1">miles</SimpleData>
                <SimpleData name="POINT_X">-121.197</SimpleData>
                <SimpleData name="POINT_Y">45.6276</SimpleData>
            </SchemaData>
        </ExtendedData>
        <gx:balloonVisibility>1</gx:balloonVisibility>
        <MultiGeometry>
            <LineString>
                <tessellate>1</tessellate>
                <coordinates>
                    -121.2191227996079,45.65623491828678,0 -121.2078460984247,45.641231128264,0 -121.2081174642494,45.62199596450162,0 -121.2013742163807,45.61232779014134,0 -121.1763471207253,45.60147362786477,0 -121.1389784963313,45.6012101599156,0 -121.1150449368218,45.61651025155123,0 -121.1141521992769,45.62130724242957,0 
                </coordinates>
            </LineString>
            <Point>
                <coordinates>-121.197032272514,45.62764529609835,0</coordinates>
            </Point>
        </MultiGeometry>
    </Placemark>
</Document>
</kml>
4

1 回答 1

0

气球在地图上的定位点被计算为要素中几何图形的中心点。在您的示例中的 MultiGeometry 的情况下,它是线的中心和组合的点。线的范围使中心向右倾斜。

如果您希望气球锚定在该点,则将LineString移动到第二个要素。

您可以通过将checkHideChildren类型的ListStyle添加到根级 Document 来隐藏您有两个功能而不是一个的事实,以隐藏子功能,如下所示:

  <Document>
    <name>KmlFile</name>
    <styleUrl>#checkHide</styleUrl>

    <Style id="checkHide">
      <ListStyle>
        <listItemType>checkHideChildren</listItemType>
      </ListStyle>
    </Style>
    ...
    <Placemark> 
      <name>The Dalles Trail</name>
      <!-- LookAt, ExtendedData, etc. -->
      <Point>...</Point>
    </Placemark>
    <Placemark>
      <LineString>...</LineString>
    </Placemark>
  </Document>
于 2013-06-18T13:05:58.853 回答