首页 > 其他 > 详细

Chrome下使用百度地图报错Cannot read property 'minZoom' of undefined

时间:2017-02-09 18:37:37      阅读:3054      评论:0      收藏:0      [点我收藏+]

问题:工作中在Google chome下面的js console里面测试百度地图API

var map = new BMap.Map("container");

map.centerAndZoom(new BMap.Point(116.404, 39.915), 11);
 
TypeError: Cannot read property ‘minZoom‘ of undefined
message: "Cannot read property ‘minZoom‘ of undefined"
stack: (...)
get stack: function () { [native code] }
set stack: function () { [native code] }
__proto__: Error

解决办法:把js代码放到地图DIV容器的下面即可。

Chrome下使用百度地图报错Cannot read property 'minZoom' of undefined

原文:http://www.cnblogs.com/mophy/p/6383273.html

(1)
(1)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!