githubの指示に従って、すべてをインストールしました。(Gmaps4Rails-github)
問題は、マップが空白であるということです。cssからマップの境界線しか見えません。
モデル:
class Recipe
include Mongoid::Document
include Gmaps4rails::ActsAsGmappable
acts_as_gmappable
field :name, :type => String
field :city, :type => String
field :country, :type => String
field :latitude, :type => Float
field :longitude, :type => Float
field :gmaps, :type => Boolean
def gmaps4rails_address
"#{self.city}, #{self.country}"
end
end
コントローラ:
class RecipesController < ApplicationController
def index
@location = Recipe.all.to_gmaps4rails
end
end
意見:
= gmaps4rails(@location)
@locationには、次のような配列にlatとlngがあります。
[{"lat":13.055363,"lng":47.811886},{"lat":13.055363,"lng":47.811886}]
必要なJSファイルとCSSファイルが読み込まれています:gmaps4rails.base.js、gmaps4rails.googlemaps.js、gmaps4rails.bing.js、gmaps4rails.mapquest.js、gmaps4rails.openlayers.js、gmaps4rails.css
サーバーログまたはJSコンソールにエラーが表示されません。ここで何が間違っているのかわかりません。
どんな提案も本当に役に立ちます!ありがとう!