Grails Google Maps - Render map as index it can't pick up the places saved in db
I have successfully followed the Google Maps example at IBM DeveloperWorks. The map 开发者_如何学Gois currently located at: localhost:8080/myapp/trip/map and I want to move the map to be as the index page, localhost:8080/myapp.
I can easily render the map if I replace the code in index.gsp, but the points in the db are missing. It seems that the array of points (lat and lng) are not following / are empty because I'm outside the trip views.
Do I have to make the array in my trip controller which holds the points global? And how do I do that? Or is there another way, I think it's a very simple problem.
See documentation for URL mappings. Just edit grails-app/conf/UrlMappings.groovy
Change following
"/"(view:"/index")
to
"/"(controller:"trip", action:"map")
精彩评论