gmaps4rails

Google Maps, Ruby on Rails, Zoom level with one marker

浪尽此生 提交于 2019-11-28 00:03:43
I am adding google maps support with apneadiving / Google-Maps-for-Rails (thanks awesome gem) I am finding one slight glitch, however, which very likely is my fault. auto_zoom works great when there are multiple markers. However, when there is only one marker it is zoomed in to the max level which is not pretty. "zoom" will only work when auto_zoom is false, so that's not what I want. So therefore you could use "maxZoom" but now users cannot zoom in manually beyond that point which is not what I want. Is there a way around this? Is my explanation making sense? Is this a limitation of Google

Rails - gmaps4rails gem on postgres

给你一囗甜甜゛ 提交于 2019-11-27 08:47:23
问题 I successfully use the gmaps4rails gem on my local MySQL machine. However, when I deploy to PG on Heroku, I get the following error with respect to code that uses the gmaps4rails "near" function to find locations near the selected location: 2012-05-21T17:58:40+00:00 app[web.1]: ActiveRecord::StatementInvalid (PG::Error: ERROR: operator does not exist: numeric - character varying 2012-05-21T17:58:40+00:00 app[web.1]: ^ 2012-05-21T17:58:40+00:00 app[web.1]: LINE 1: ...8.755864232 * 2 * ASIN

Dynamically load Google Maps Markers with gmaps4rails

点点圈 提交于 2019-11-27 00:39:46
问题 How do I load only markers that are inside the map bounds with gmaps4rails? And of course load new ones after pan and/or zoom. Directly related to that, how can I get the current boundaries and zoomlevel of the map? 回答1: Here is how I did it, I only replace the markers after the user finishes panning or zooming, if you require different behavior then use a different event listener: In your view (index.html.erb): <%= gmaps({ "map_options" => { "zoom" => 15, "auto_adjust" => false, "detect

Google Maps, Ruby on Rails, Zoom level with one marker

痞子三分冷 提交于 2019-11-26 23:22:28
问题 I am adding google maps support with apneadiving / Google-Maps-for-Rails (thanks awesome gem) I am finding one slight glitch, however, which very likely is my fault. auto_zoom works great when there are multiple markers. However, when there is only one marker it is zoomed in to the max level which is not pretty. "zoom" will only work when auto_zoom is false, so that's not what I want. So therefore you could use "maxZoom" but now users cannot zoom in manually beyond that point which is not