How to Create google map polyline from gps points?
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);
精彩评论