kml全球范围

时间:2012-11-28 15:38:03

标签: google-maps kml

我有一个kml文档,其中包含一个应覆盖整个世界的多边形,但它在Google地图中呈现为沿着antimeridian(即国际日期行)的一条线。这是令人讨厌的片段:

<Polygon>
    <outerBoundaryIs>
        <LinearRing>
            <coordinates>-180.0,-90.0 -180.0,90.0 180.0,90.0 180.0,-90.0 -180.0,-90.0</coordinates>
        </LinearRing>
    </outerBoundaryIs>
</Polygon>

解决方法?任何提示?

1 个答案:

答案 0 :(得分:0)

添加一些额外的点(看起来它很简单,但并不是那么简单),这似乎有用:

  <Placemark>
  <MultiGeometry>
    <Polygon>
      <outerBoundaryIs>
        <LinearRing>
          <coordinates>180.0,-85.0 180.0,0.0 180.0,85.0 90.0,85.0 0.0,85.0 0.0,0.0 0.0,-85.0 90.0,-85.0 180.0,-85.0</coordinates>
        </LinearRing>
      </outerBoundaryIs>
    </Polygon>
    <Polygon>
      <outerBoundaryIs><LinearRing>
          <coordinates>-180.0,-85.0 -90.0,-85.0 0.0,-85.0 0.0,0.0 0.0,85.0  -90.0,85.0 -180.0,85.0 -180.0,0.0 -180.0,-85.0</coordinates>
        </LinearRing>
      </outerBoundaryIs>
    </Polygon>
  </MultiGeometry>
</Placemark>

not quite Working Example

虽然它似乎在两个Google地图中都有各种缩放级别的问题,并且在Google Maps API v3中使用KmlLayer显示它。

geoxml3 seems to work OK