快速解决。
下载此文件:
http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclusterer/1.0/src/markerclusterer.js
放进去:
公共/javascripts/markerclusterer.js
并将第 90 行的代码更改为
var maxZoom = 18; //that.map_.mapTypes[that.map_.getMapTypeId()].maxZoom;
在 app/views/layouts/applications.html.erb 中包含文件
<%= javascript_include_tag "https://maps.google.com/maps/api/js?sensor=false&libraries=geometry" %>
<%= javascript_include_tag "markerclusterer_compiled.js" %>
对于 0.8.x
<%= javascript_include_tag "gmaps4rails.js" %>
对于 1.xx
<%= javascript_include_tag "gmaps4rails.base.js" %>
<%= javascript_include_tag "gmaps4rails.googlemaps.js" %>
之后,您必须使用:
<%= gmaps4rails(@json, true, false) %>
或者
<%= gmaps({ "markers" => { "data" => @json } },true, false) %>
不从默认位置下载谷歌地图 JS 文件。
来源:
https://github.com/apneadiving/Google-Maps-for-Rails/wiki/View-helper
ClusterMarkerer - 没有出现集群 - this.map_.mapTypes[this.map_.getMapTypeId()] 是未定义的 markerclusterer.js:304
高温高压
编辑
好吧谷歌解决了这个问题,但我会把解决方案留给其他人。