javascript - 仅引用错误 : google is not defined, (mozilla)

标签 javascript google-maps-api-3

我尝试使用带有自定义标记的谷歌地图 API,在 Chrome 上工作正常,但在其他浏览器上有错误。

第一个错误:

ReferenceError: google is not defined

第二个错误:

InvalidValueError: mapInitialize is not a function

JSfiddle 示例:example

测试站点:testsite

我做错了什么?请帮忙!

最佳答案

mapInitialize 函数末尾添加此代码:

var mapCenter = new google.maps.LatLng(56.946528, 24.118665);
map.setCenter(mapCenter);

Image result

关于javascript - 仅引用错误 : google is not defined, (mozilla),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38178370/

相关文章:

Javascript/Ember 语法 '%@'

javascript - 用于匹配星号、波浪号、破折号和方括号的正则表达式

javascript - Oracle Jet 不显示来自 Web 服务的数据

javascript - 通过 Flash 跟踪设置区域内的鼠标按下坐标

google-maps - maps.googleapis结果与maps.google.com不同

google-maps - 无法在 Google map 中隐藏某些特征类型

angularjs - 使用 angular-google-maps 设置 Google map 范围

google-maps - 使用谷歌地图API计算两点之间X分钟的位置(纬度,经度)?

javascript - 将 HTMLElement 的引用传递给 Polymer 元素

php - 如何从 php 中的谷歌地图转换纬度和经度的任何地址?