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 6722495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:27:15+00:00 2026-05-26T09:27:15+00:00

I found stackoverflow topic on adding marker add marker with Google-Maps-for-Rails , but failed

  • 0

I found stackoverflow topic on adding marker add marker with Google-Maps-for-Rails ,
but failed even in adding callback 🙁

In https://github.com/apneadiving/Google-Maps-for-Rails/wiki/Javascript-goodies ,
found that there were some changes in addressing to the map, so I tried this

<script type="text/javascript" charset="utf-8">
 Gmaps.map.callback = function ()
 {
   google.maps.event.addListener(Gmaps.map, 'click',
           function(object){alert("it works");}
   );
 }
</script>

but again with no luck.

Please, show where I’m wrong.

In the end, I just want to let the user to point some spot on the map and autopopulate fields with latitude and longitude, try to reverse geocode the address for creating yet another place in db.

  • 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-26T09:27:15+00:00Added an answer on May 26, 2026 at 9:27 am

    I guess the problem comes from Gmaps.map.

    Indeed: Gmaps.map is the default namespace for the whole map stuff (functions, markers, map object, polylines…).

    But, the map object itself is Gmaps.map.map.

    I did this to keep things short but it appears to be pretty confusing and now I am here, I prefer not to change: it could confuse people even more. BTW, it’s described on the first line here.


    Reminder:

    Additional javascript should be put after the gmaps helper AND in a content_for :scripts

    Ex:

    <%= gmaps(whatever args) %>
    
    <% content_for :scripts do %>
       <script type="text/javascript" charset="utf-8">
         //your js here
       </script>
    <% end %>
    

    If you wonder, why, simply keep in mind that js must exist before being used and it’s loaded thanks to the helper (for Rails 3.0.x at least).

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

Sidebar

Related Questions

I browsed around here on Stackoverflow and found this topic : https://stackoverflow.com/questions/279/aspnet-visual-studio-and-subversion-how-to-integrate However that
I found these questions, but a couple of them were a little old: https://stackoverflow.com/questions/191556/should-i-pursue-asp-net-webforms-or-asp-net-mvc
I have been looking around ocn Google and Stackoverflow but haven't found what I
I found there is questions asked in stackoverflow regarding this topic before but i
This is a follow up on a related topic found here https://stackoverflow.com/questions/1987485/conditionally-assign-c-var-as-elegant-as-it-get s if
I've found a answer how to remove diacritic characters on stackoverflow, but could you
I've looked around on stackoverflow for a similar question, but haven't found exactly what
ok, i found some similar posts on stackoverflow, but I couldn't find any that
Thanks to StackOverflow I found out yesterday how to add a custom action to
I found Another StackOverflow answer , but i'm not sure if it answers my

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.