我正在尝试从变量中获取纬度和经度,但我一直在获取Unexpected token ,
. 我试过使用var coordinates = 59.328615,13.485699
, var coordinates = '59.328615,13.485699'
但我只得到了同样的错误。现在我没有想法了。怎么了?!
var coordinate_latitude = 59.328615;
var coordinate_longitude = 13.485699;
var marker;
var gm_map;
function initialize() {
var latlong = new google.maps.LatLng(coordinate_latitude, coordinate_longitude);
var googlemaps_options = {
zoom: 18,
minZoom: 4,
maxZoom: 18,
center: latlong,
mapTypeId: google.maps.MapTypeId.SATELLITE,
streetViewControl: false
}
gm_map = new google.maps.Map(document.getElementById('google-maps'), googlemaps_options);
marker = new google.maps.Marker({
position: latlong,
draggable: true,
map: gm_map
});
}
$(document).ready(function() {
// INITIERA GOOGLE MAPS
initialize();
});
提前致谢。