我有一个谷歌地图API设置在这里,只有谷歌Chrome将抛出'未捕获的RangeError:无效的数组长度'.
这是有问题的代码:
var map;
var phoenix = new google.maps.LatLng(33.551946,-112.109985);
var locOne = new google.maps.LatLng(33.541061,-112.293369);
var locTwo = new google.maps.LatLng(33.37738,-111.833271);
var locThree = new google.maps.LatLng(33.454742,-112.099701);
var locFour = new google.maps.LatLng(33.673617,-112.020856);
function HomeControl (controlDiv, map){
// create div to hold the controls
var controlDiv = document.createElement('div');
controlDiv.class = 'gmnoprint';
controlDiv.style.marginTop = '5px';
controlDiv.index = 1;
// set CSS for the control border
var controlUI = document.createElement('div');
controlUI.id = 'border';
controlUI.style.backgroundColor = '#fff';
controlUI.style.cursor = 'pointer';
controlUI.textAlign = 'center';
controlUI.title = …Run Code Online (Sandbox Code Playgroud)