Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6529677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:39:50+00:00 2026-05-25T09:39:50+00:00

I am successfully using GMaps4Rails to render markers from a Rails/Mongoid/Spacial model, and I

  • 0

I am successfully using GMaps4Rails to render markers from a Rails/Mongoid/Spacial model, and I am generally finding GMaps4Rails just unbelievably cool.

However, one thing keeps nagging in the back of my mind (although I got it to work OK): in all examples and answers I’ve seen the Google map object accessed through Gmaps4Rails.map, e.g.

google.maps.event.addListener(Gmaps4Rails.map, 'click', function(object){ 
  alert(object.latLng);
});

(Taken from add marker with Google-Maps-for-Rails)

However, I never got this to work. If I log the Gmaps4Rails.map object to the console, it is undefined. The Gmaps.map object is of type Gmaps4RailsGoogle, so to get to the actual Google map, I need to write e.g.

google.maps.event.addListener(Gmaps.map.map, 'click', ...)

I am instantiating the map via

 = gmaps(:map_options => {"detect_location" => true, "center_on_user" => true, 
   "zoom" => 12})

Any hints would be much appreciated, as I have a nagging feeling that I am doing something incorrectly.

Update: I should have read https://github.com/apneadiving/Google-Maps-for-Rails/wiki/From-0.x.x-to-1.x.x

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T09:39:51+00:00Added an answer on May 25, 2026 at 9:39 am

    I can’t see any question here 🙂

    Since my 1.0.0 release, some things have changed, so yes you’re finding dated indications. But you’ve found the answer using Gmaps.map.map.

    Here:

    • Gmaps is a namespace containing all the maps you could create ion your page

    • all maps containers are found by id and default id is map (I like short expressions)

    • to get the map object from the map container, you append another .map (this is a bit annoying but I kept this to avoid users to become mad)

    But all details for migration from 0.x.x to 1.x.x can be found here (there are few).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an HBITMAP containing alpha channel data. I can successfully render this using
So far I've been successfully using fiddler to sniff web service traffic from both
I'm successfully using Ninject in my web applications by deriving my Global from NinjectHttpApplication
I was successfully using dojo.dnd.Source with Dojo 1.4.3 loaded from my webserver. However, as
I'm successfully using AVPlayer to stream audio from a server and what I want
I have two iOS devices finding each other successfully using the Bonjour API, but
Now I am successfully using WebClient.DownloadString to get file content from ESX server. My
I've been successfully using Django's admin panel for internal users for a while but
Is anyone successfully using Expression Blend Preview for .NET 4 with the RC of
I'm successfully using Paypal Express Checkout in a marketplace web app passing for every

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.