问题:工作中在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容器的下面即可。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-11
猜你喜欢
  • 2021-09-27
  • 2022-12-23
  • 2021-11-30
  • 2021-09-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案