0
2錯誤的螢火表示錯誤在谷歌地圖鋼軌
ReferenceError: Gmaps4Rails is not defined
})(Gmaps4Rails);
ReferenceError: Gmaps4RailsGoogle is not defined
Gmaps.map = new Gmaps4RailsGoogle();
application.html.erb
<%= javascript_include_tag "gmaps4rails/gmaps4rails.googlemaps" %>
<%= javascript_include_tag "gmaps4rails/gmaps4rails.base" %>
<%= javascript_include_tag "gmaps4rails/gmaps4rails.bing" %>
<%= javascript_include_tag "gmaps4rails/gmaps4rails.mapquest" %>
<%= javascript_include_tag "gmaps4rails/gmaps4rails.openlayers" %>
<body>
<%= yield %>
<%= yield :scripts %>
</body>
propertymap.rb(模型)
attr_accessible :title, :place, :prop_details
acts_as_gmappable #:process_geocoding => false (if custom lang and longi tudes)
def gmaps4rails_address
"#{self.title}, #{self.place}"
end
property_map_controller.rb
def index
@properties = PropertyMap.all
@json = PropertyMap.all.to_gmaps4rails
end
查看
<%= gmaps4rails(@json) %>
空盒在視圖中來,什麼都不
'gmaps4rails.base'應包括前'gmaps4rails.googlemaps' – apneadiving
非常感謝你apneadiving。我在這個問題上掙扎了3個多小時 –