开发者

How to Create google map polyline from gps points?

开发者 https://www.devze.com 2023-01-12 03:37 出处:网络
I have a collection of gps points in the following format: S 25°35\', W 48°10\' I cannot find a way to pass it to google maps api (v2) , so that I can draw a开发者_C百科 polyline.What you need t

I have a collection of gps points in the following format:

S 25°35', W 48°10'

I cannot find a way to pass it to google maps api (v2) , so that I can draw a开发者_C百科 polyline.


What you need to do is convert the degree-style latitude and longitude into a decimal style geo location point. Then you'll have the style that google is looking for.


You need to convert your degrees, minutes, seconds location into a decimal location:

// 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);
0

精彩评论

暂无评论...
验证码 换一张
取 消