0

I have a kml document that contains a polygon that should cover the whole world but it is rendered as a line along the antimeridian (i.e. the international date line) in Google Maps. Here is the offending snippet:

<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>

Workaround? Any hints?

4

1 回答 1

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>

不太工作的例子

尽管在 Google Maps 和在Google Maps API v3中使用 KmlLayer 显示它的不同缩放级别似乎确实存在问题。

geoxml3 似乎工作正常

于 2012-11-29T00:37:52.883 回答