Closed shayani closed 9 years ago
Hi,
please ask questions on stackoverflow, way easier for people to browse them afterwards.
Just quickly, there is no handler.getMap().callback
.
Actually the callback is the second arg of the handler.buildMap
function
Thanks. I tried to put the callback inside the second parameter. I also posted the question (still have doubts) in StackOverflow (http://stackoverflow.com/questions/27317767/drag-and-update-location-how-to-do-this)
I'm trying to follow the information on your wiki, stackExchange, etc to make this work. The idea is to create a new location for the user. The app displays a map, put a marker on the 0,0 location and then the user drag this marker to any place and the form is updated with the new lat and log. Seems trivial and there's doc in the wiki, but I could not make it work.
I'm using gem version 2.1.2 and Rails 4.1. I had success showing maps, markers, etc, but I cannot make the callback and others functions to work. I'm using this doc to try: https://github.com/apneadiving/Google-Maps-for-Rails/wiki/Javascript-goodies#drop-a-marker-and-update-fields-attribute-in-a-form
Follow my view code:
The rest of the javascript code is the same as the link provided before, but I'm replacing all "Gmaps.map" for "handler.getMap()"
Example:
becomes
but nothing happens... not even an error :/