2015-10-30 41 views
2

我有畫我的矢量圖形的一個問題 - 當我放大不夠,看起來有些座標被跳過,形狀被扭曲 - 見附件圖片:Openlayer distors矢量形狀

enter image description here

的形狀從geojson文件加載,其定義如下:

"coordinates":[[[18.58235,49.81784],[18.58545,49.81738],[18.59252,49.81296] 
,[18.59279,49.80395],[18.59986,49.79953],[18.60013,49.79051] 
,[18.60719,49.78609],[18.61425,49.78168],[18.61093,49.7663] 
,[18.07565,49.432],[18.07509,49.43198],[18.06119,49.43289] 
,[18.04734,49.43411],[18.03356,49.43564],[18.01987,49.43747] 
,[18.00628,49.4396],[17.99281,49.44204],[17.98218,49.44422]]] 

任何想法,有什麼不對?

Marek

回答

1

您的多邊形幾何圖形無效。您必須在最後添加另一個座標對,其值與第一個座標對相同:

"coordinates":[[[18.58235,49.81784],[18.58545,49.81738],[18.59252,49.81296] 
    ,[18.59279,49.80395],[18.59986,49.79953],[18.60013,49.79051] 
    ,[18.60719,49.78609],[18.61425,49.78168],[18.61093,49.7663] 
    ,[18.07565,49.432],[18.07509,49.43198],[18.06119,49.43289] 
    ,[18.04734,49.43411],[18.03356,49.43564],[18.01987,49.43747] 
    ,[18.00628,49.4396],[17.99281,49.44204],[17.98218,49.44422] 
    ,[18.58235,49.81784]]] 
+0

非常感謝,就是這樣! – user3523426