Google Maps API: markerwithlabel.js - Uncaught ReferenceError: google is not defined

匿名 (未验证) 提交于 2019-12-03 02:00:02

问题:

I have read the docs and examples, but I it seems I cannot solve the initialization error ("Uncaught ReferenceError: google is not defined" + Uncaught ReferenceError: homeLatLng is not defined) when trying to include markerwithlabel.js file and it's reminds me to the "you cannot load something before the map is done" prob.

What can I do?

What was tried:

    

..

回答1:

markerwithlabel.js requires a already loaded maps-API.

When you load the maps-API asynchronously(as you do in your code), there is no guarantee that the maps-API is loaded when markerwithlabel.js will be loaded.

solution: load the maps-API synchronously

   


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!