apneadiving / Google-Maps-for-Rails

Enables easy Google map + overlays creation in Ruby apps
https://apneadiving.github.io/
MIT License
2.26k stars 382 forks source link

Blank map under jQueryMobile #295

Closed nordbit closed 11 years ago

nordbit commented 11 years ago

I'm trying use gmaps4rails under JQM framework - on first load got only blank container for map. After reloading page - map and markers are displayed correcly. Is this a gem issue?

apneadiving commented 11 years ago

What is JQM?

Sent from my iPhone

On 23 nov. 2012, at 01:23, nordbit notifications@github.com wrote:

I'm trying use gmaps4rails under JQM framework - on first load got only blank container for map. After reloading page - map and markers are displayed correcly. Is this a gem issue?

— Reply to this email directly or view it on GitHub.

mildfuzz commented 11 years ago

I think this is a JQM issue. JQM navigates with ajax, and doesn't execute scripts from these pages. To test, add data-ajax="false" to any link that links to the map page. This will cause a standard HTTP page load.

If you want to keep JQM navigation, I suggest looking through the JQM documentation for events you can use to trigger the proper behaviour with gmaps.

apneadiving commented 11 years ago

Sounds like a correct and clever explanation, with solution! :)

Sent from my iPhone

On 25 nov. 2012, at 22:21, John notifications@github.com wrote:

I think this is a JQM issue. JQM navigates with ajax, and doesn't execute scripts from these pages. To test, add data-ajax="false" to any link that links to the map page. This will cause a standard HTTP page load.

If you want to keep JQM navigation, I suggest looking through the JQM documentation for events you can use to trigger the proper behaviour with gmaps.

— Reply to this email directly or view it on GitHub.

nordbit commented 11 years ago

Added, tested. It's working. @mildfuzz - your answer solved not only this issue, but my second related to JQM too, now I'm reading more about JQM. @apneadiving - thanks for gmaps4rails, it's a great gem