【发布时间】:2019-08-29 00:15:17
【问题描述】:
尝试使用 Google Maps API 初始化地图。以数字形式输入中心的纬度和经度。收到一个错误,指出它们不是数字。
var map; // Variable used to create new map
var mapDiv = document.getElementById('ippudo-map'); // Location of the map in the html
// Create a function to initialize the map
function initMap() {
map = new google.maps.Map(mapDiv, {
center: {lat: 42.3601, long: 71.0589},
zoom: 8
});
}
【问题讨论】:
-
你解决了吗?即使我 parseFloat() 值,我也会收到此错误。不知道为什么....
标签: javascript api google-maps google-maps-api-3