小编JSW*_*t91的帖子

未捕获RangeError:Chrome版本36.0.1985.5 dev -m中的数组长度无效

我有一个谷歌地图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)

javascript google-maps google-chrome

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

google-chrome ×1

google-maps ×1

javascript ×1