标记管理器在地图 API 3.10 中不起作用



Marker Manager 在 Google Maps API v3.10 和当前版本中不起作用。

如果您检查它是示例页面http://google-maps-utility-library-v3.googlecode.com/svn/tags/markermanager/1.0/examples/google_northamerica_offices.html您将看到缩放控件未更改地图,并且没有任何标记。您将看到以下JavaScript错误:

捕获的类型错误:无法调用未定义的方法"substr"

但是,如果您为版本 v=3.9 加载地图 API,那么一切都会好起来的(我在测试页面上检查了它)。

我认为经理的脚本文件中存在错误。

标记管理器与 Google Maps API v 3.10 及更高版本不兼容。在包含 Google 地图时指定版本,或者在 markermanager 中更改第 98 行.js(版本 1.0) 从

if (typeof map.mapTypes.get(sType) === 'object' && typeof map.mapTypes.get(sType).maxZoom === 'number') {

if (sType != "constructor" && typeof map.mapTypes.get(sType) === 'object' && typeof map.mapTypes.get(sType).maxZoom === 'number') {

最新更新