Chrome下使用百度地圖報錯Cannot read property 'minZoom' of undefined


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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM