admin管理员组文章数量:1316980
can anyone please tell me how to draw a line path in Google-Map using the GPS co-ordinates which i retrieve from database
example of GPS co-ordinates which i get is as shown below
10.013566,76.331549
10.013566,76.331463
10.013503,76.331313
10.013482,76.331205
10.013419,76.330926
10.013334,76.330712
10.013313,76.330411
10.013292,76.330175
10.013228,76.329854
10.013144,76.329553
10.013059,76.329296
10.012996,76.329017
10.012869,76.328802
10.012785,76.328545
10.012700,76.328223
10.012679,76.328030
10.012658,76.327837
10.012637,76.327600
10.012573,76.327322
10.012552,76.327043
10.012552,76.326807
10.012510,76.326613
10.012447,76.326399
10.012404,76.326227
can anyone please tell me how to draw a line path in Google-Map using the GPS co-ordinates which i retrieve from database
example of GPS co-ordinates which i get is as shown below
10.013566,76.331549
10.013566,76.331463
10.013503,76.331313
10.013482,76.331205
10.013419,76.330926
10.013334,76.330712
10.013313,76.330411
10.013292,76.330175
10.013228,76.329854
10.013144,76.329553
10.013059,76.329296
10.012996,76.329017
10.012869,76.328802
10.012785,76.328545
10.012700,76.328223
10.012679,76.328030
10.012658,76.327837
10.012637,76.327600
10.012573,76.327322
10.012552,76.327043
10.012552,76.326807
10.012510,76.326613
10.012447,76.326399
10.012404,76.326227
Share
Improve this question
asked Mar 21, 2013 at 5:35
user2040500user2040500
1 Answer
Reset to default 8try this
DEMO
function initialize(){
var center= new google.maps.LatLng(10.012869,76.328802);
var myOptions = {
zoom: 18,
center: center,
mapTypeControl: true,
mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
navigationControl: true,
mapTypeId: google.maps.MapTypeId.HYBRID
}
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var polylineCoordinates = [
new google.maps.LatLng(10.013566,76.331549),
new google.maps.LatLng(10.013566,76.331463),
new google.maps.LatLng(10.013503,76.331313),
new google.maps.LatLng(10.013482,76.331205),
new google.maps.LatLng(10.013419,76.330926),
new google.maps.LatLng(10.013334,76.330712),
new google.maps.LatLng(10.013313,76.330411),
new google.maps.LatLng(10.013292,76.330175),
new google.maps.LatLng(10.013228,76.329854),
new google.maps.LatLng(10.013144,76.329553),
new google.maps.LatLng(10.013059,76.329296),
new google.maps.LatLng(10.012996,76.329017),
new google.maps.LatLng(10.012869,76.328802),
new google.maps.LatLng(10.012785,76.328545),
new google.maps.LatLng(10.012700,76.328223),
new google.maps.LatLng(10.012679,76.328030),
new google.maps.LatLng(10.012658,76.327837),
new google.maps.LatLng(10.012637,76.327600),
new google.maps.LatLng(10.012573,76.327322),
new google.maps.LatLng(10.012552,76.327043),
new google.maps.LatLng(10.012552,76.326807),
new google.maps.LatLng(10.012510,76.326613),
new google.maps.LatLng(10.012447,76.326399),
new google.maps.LatLng(10.012404,76.326227),
];
var polyline = new google.maps.Polyline({
path: polylineCoordinates,
strokeColor: '#FF0000',
strokeOpacity: 1.0,
strokeWeight: 2,
editable: true
});
polyline.setMap(map);
}
initialize();
本文标签: javascriptdrawing a line path in google map with GPS coordinatesStack Overflow
版权声明:本文标题:javascript - drawing a line path in google map with GPS co-ordinates - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742008349a2412415.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论