[英]How to Create google map polyline from gps points?
我有以下格式的gps點集合:
S 25°35',W 48°10'
我找不到將它傳遞給google maps api(v2)的方法,這樣我就可以繪制折線了。
您需要做的是將度數樣式的緯度和經度轉換為小數風格的地理位置點。 那么你將擁有谷歌正在尋找的風格。
您需要將度,分,秒位置轉換為小數位:
// For 25°35'0''
var degrees = 25;
var minutes = 35;
var seconds = 0;
// need to calculate the decimal 25.5833333
var longitude = degrees + (minutes / 60) + (seconds / 60 / 60);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.