2012-11-28 167 views
0

我有一個kml文檔,其中包含一個應覆蓋整個世界的多邊形,但它在Google Maps中沿着反經絡(即國際日期線)呈現爲一條線。以下是違規摘錄:kml全球範圍

<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

添加一些額外的點數(好像它是怎麼回事了一小段路,但沒有想象中的那麼簡單),這似乎工作:

<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