0

我在 rails 4、ruby 2 和 gmaps4rails '1.5.6' 中为我的项目使用谷歌地图,但问题是我没有在地图中心找到标记以及放大缩小侧栏也没有出现.

如果有人对此问题有任何想法,请回复?

模型动作
acts_as_gmappable

def gmaps4rails_address
   html = full_address(city_id,state_id,country_id)
   self.location = (location + html)
   location
end

def full_address(city_id,state_id,country_id)
   city_name = MdmCity.get_city_name(city_id)
   state_name = MdmState.get_state_name(state_id)
   country_name = MdmCountry.get_country_name(country_id)
   html = "#{city_name} #{state_name} #{country_name}"
   html
结尾

控制器动作

def edit_content
  @location_json = SeoContent.where(:id => params[:id]).first.to_gmaps4rails
end

查看

<%= gmaps4rails(@location_json) %>

对我来说问题。
1)放大和缩小栏没有出现。
2) 标记不在中心。
3) 如何给出信息窗口。
4)如何提出该地址无效,谷歌地图上不存在该地址(例如:kdjfkdfhdkfhd)
5)为什么此操作(def gmaps4rails_address)会自动调用。
6) 我也想从更新操作中调用 def gmaps4rails_address 怎么办?
7) 地图只出现了四分之一?为什么
8) 我可以在地图上显示方向吗?

谢谢

4

0 回答 0