Questions tagged [gmaps4rails]

gmaps4rails is a Ruby on Rails 3 gem, which provides a clear interface with GoogleMaps, OpenLayers, Bing and Mapquest

Enables easy display of items (taken from a Rails 3 model) with Google Map, OpenLayers, Bing or Mapquest.

Geocoding + Directions included.

Provides much options:

  • markers customization
  • infowindows
  • auto-adjusted zoom
  • polylines
  • polygons
  • circles
  • rich markers
  • multi maps etc...

See wiki for full description and examples.

700 questions
6
votes
4 answers

undefined local variable or method 'acts_as_gmappable'

I attempted to install the gmaps4rails gem. I added gem 'gmaps4rails' to my Gemfile, and ran 'bundle install. It said that my bundle installed successfully. I can find "Using gmaps4rails (0.8.8)" with 'gem list'. I added the specified columns to my…
6
votes
2 answers

gmaps4rails not rendering in specified div id

I am using Gmaps4Rails (Google Maps for Rails) in Active Admin. Everything well so far except for when I had to add multiple maps on the same show page. gem 'gmaps4rails', '~> 2.1', '>= 2.1.2' I extracted the importing of scripts to an html that I…
Leticia Esperon
  • 2,499
  • 1
  • 18
  • 40
5
votes
1 answer

Does gmaps4rails conflict with geocoder gem?

I am using gmaps4rails to easily generate a google map on my app. gmaps4rails requires a lat and long attributes in the model. however, gmaps4rails isn't very friendly with ambiguous addresses. For example, it doesn't know what address to show when…
Matthew Berman
  • 8,481
  • 10
  • 49
  • 98
5
votes
1 answer

gmaps4rails validates before validates presence set to true

I encountered the following error when I submit an empty address field. Gmaps4rails::GeocodeInvalidQuery in LocationsController#create You must provide an address My Model class Location < ActiveRecord::Base validates :address, :presence =>…
5
votes
2 answers

Dynamically load Google Maps Markers with gmaps4rails

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?
jmk
  • 1,778
  • 15
  • 18
5
votes
1 answer

Different Markers in Google Maps with gmaps4rails

With gmaps4rails there is a way to define a custom marker. But the same one is then shown for each database entry. How would I show a different marker for each database entry, like in Google Latitude? Preferably through their own database column or…
jmk
  • 1,778
  • 15
  • 18
5
votes
1 answer

google map reload marker refreshes the zoom

I have been following the gmaps4rails gem and i was able to reload the marker with setinterval function. the problem i'm facing is after each interval the map goes back to original, i.e if i'm zoomed in it goes back to normal. This is the code…
Anbazhagan p
  • 943
  • 1
  • 14
  • 27
5
votes
4 answers

gmap4rails - can't find file underscore / Gmaps is not defined

I am following the simple tutorial here: https://github.com/JonKernPA/gmaps I keep getting the error: couldn't find file 'underscore' (/app/assets/javascripts/application.js:16) with the following line highlighted: <%=…
chiefkikio
  • 275
  • 2
  • 11
5
votes
1 answer

RoR: Check for a location within a radius of the other location, using google maps api

I am using google maps fo rails gem https://github.com/apneadiving/Google-Maps-for-Rails/ . I am trying to find out a way through which I can see if a location is inside the map circle. For instance @circles_json = '[ {"lng": -122.214897, "lat":…
psharma
  • 1,279
  • 2
  • 19
  • 47
5
votes
1 answer

How to stub gmaps4rails geocode functions in rspec tests?

I'm using gmaps4rails, and trying to develop some tests. I have a factory factory :country do sequence(:name) { |n| "Country#{n}" } end which is obviously not recognized by Google. Validation failed: Gmaps4rails address Address invalid The API…
Andy Harvey
  • 12,333
  • 17
  • 93
  • 185
5
votes
4 answers

gmaps4rails shows just half of the map when iside tab. Any idea why?

I have been looking around but I have not found a problem like this. Gmaps4rails works great for me! The trouble is when inserted into a JQuery tab. It loads half of the map. It actually looks like is missing pictures. I can move/resize as usual.…
4
votes
1 answer

Gmaps4rails - longitude and latitude in database no updated.

I have a model place with attributes name, state, longitude, and latitude. A model travel_plan has many places. I'm using nested form gem for places in the travel plan form. My problem is that the longitude and latitude were not updated when name…
4
votes
0 answers

drawing a map with gmaps4rails *after* the initial page load

I want to load a map using gmaps4rails on-demand by loading html from the server into the current page without a full page load. I am essentially faking tabs using ajax like in pjax: http://pjax.heroku.com/ This technique special links that triggers…
4
votes
1 answer

gmaps4rails display location based on latitude and longitude

I am using gmaps4rails with Rails 3.0.9. I would like to add a marker based on the latitude and longitude coordinates to the map, but I can't figure out how should I do it. I managed to use the map with an andress only. Thanks. The code I'm…
SpeedyWizard
  • 568
  • 6
  • 13
4
votes
3 answers

Adjust Zoom Gmaps4Rails

I'm using the Gmaps4Rails gem and cannot figure out how to adjust the default zoom settings. In my view I have the following code: <%= gmaps({ "map_options" => {"auto_adjust" => false, "auto_zoom" => false, "zoom" => 15 }, "markers" =>…
pruett
  • 2,101
  • 3
  • 22
  • 36
1
2
3
46 47