我有一个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>
解决方法?任何提示?
答案 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>
虽然它似乎在两个Google地图中都有各种缩放级别的问题,并且在Google Maps API v3中使用KmlLayer显示它。