当我使用“center: new google.maps.LatLng”这个命令时,通常我们使用这种格式(22.621177,120.298311)
。
但我的来源是7 05.16' N, 171 21.88' E
有人知道下一步该怎么做吗?
function load(User_Id) {
var map = new google.maps.Map(document.getElementById("map_canvas"), {
center: new google.maps.LatLng(22.601914,120.283186),
zoom: 13,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var infoWindow = new google.maps.InfoWindow;
var geocoder = new google.maps.Geocoder();
downloadUrl("db_2_xml.php?id="+User_Id, function(data) {
var xml = data.responseXML;
var markers = xml.documentElement.getElementsByTagName("markers");
for (var i = 0; i < markers.length; i++) {
var vessel = markers[i].getAttribute("vessel");
var geocoder = new google.maps.Geocoder(
geocoder.geocode(markers[i].getAttribute("GPS")));
var speed = markers[i].getAttribute("speed");
var icon = customIcons[type] || {};
var marker = new google.maps.Marker({
map: map,
position: geocoder,
icon: icon.icon,
shadow: icon.shadow
});
bindInfoWindow(marker, map, infoWindow, html);
}
});