我正在嘗試在Google地圖上顯示圖片(切片)。它工作正常,除非圖像與Google地圖不完全一致。我的圖片切片與Google地圖不對齊
在我生成圖像之前,我首先使用SphericalMercator通過從某個縮放比例(例19)的緯度和經度轉換爲像素位置來計算圖像大小的寬度,高度。如圖谷歌例如https://developers.google.com/maps/documentation/javascript/examples/map-coordinates
例如:
Left Corner Lat,Lng = 23.635069377090115 ,58.09107364729487
Pixel projection using SphericalMercator for zoom 19 , x= 88766786 , y=58035976
bottom, right Lat,Lng = 23.598520856653636, 58.14957298218598
Pixel projection using SphericalMercator for zoom 19 , x= 88788596 , y=58050848
一次,我得到的像素值對於頂部,左上角和底部,右側拐角。餘計算在x三角洲和其餘用作寬度Y增量,高度爲所生成的圖像
例如:
x2-x1= 21810
y2-y1= 14872
我使用的工具爲AutoCAD計劃轉換成圖像與上述圖像寬度,高度。
比,我切使用imageMagic圖像成瓦片:
convert -crop 256x256 test4.png tile%d.png
和比我顯示這些瓷磚。
瓷磚顯示,但它不是很好地對齊。我錯過了什麼嗎?