gmaps4rails

Rendering a Gmap through an AJAX call with Gmaps4rails

北慕城南 提交于 2019-12-20 03:19:09
问题 There are topics that try to cover this here: Gmaps4rails : map not showing when loaded dynamically and especially here: Rendering google map using gmaps4rails through Ajax, also watched the screencast in which a gmap is dynamically updated but I still don't seem to get it work. I am trying to load the map in a drop-down tab only if a button is clicked displaying the direction between a user and an offer. In my _location.html.erb partial I have: <%= gmaps({ "direction" => { "data" => { "from"

Google maps autocomplete js is working on localhost but not on heroku

别等时光非礼了梦想. 提交于 2019-12-19 04:10:14
问题 I'm a junior ruby on rails developer. I developed a web app that uses Google maps javascript API and I use the autocomplete function on a form input. The autocomplete works fine on localhost but does not work anymore after deploying on heroku. Here is my html.erb below. For your perfect information, the form is in the page footer. This form is partially hidden and the only visible part corresponds to a button used to upload a video file. Once this button has been clicked and the video file

Displaying a polygon with gmaps4rails

允我心安 提交于 2019-12-18 17:33:32
问题 Ruby noob here. Trying to display a list of points as a polygon on a google map using the gmaps4rails gem (awesome gem by the way). Any suggestions based on code sample below would be much appreciated! I can see the outline for the map, but no map and no polygon. Update: this code has been updated and the problem is solved. Class Schoolpoint is a list of lat/long pairs that belong to School In my controller: @polyjson = [] schoolpoints = [] Schoolpoint.where(:school_id => params[:id]).each do

Displaying a polygon with gmaps4rails

妖精的绣舞 提交于 2019-12-18 17:33:06
问题 Ruby noob here. Trying to display a list of points as a polygon on a google map using the gmaps4rails gem (awesome gem by the way). Any suggestions based on code sample below would be much appreciated! I can see the outline for the map, but no map and no polygon. Update: this code has been updated and the problem is solved. Class Schoolpoint is a list of lat/long pairs that belong to School In my controller: @polyjson = [] schoolpoints = [] Schoolpoint.where(:school_id => params[:id]).each do

Ruby on rails gem for google map integration

笑着哭i 提交于 2019-12-18 11:03:53
问题 I would like to ask which is the best solution for integrating google maps into ruby on rails apps. Is a specific gem worth it or should we write our own views for it? Thanks for any input. 回答1: I've used the YM4R, Georuby and spatial adapter gems with good results before. see this description. 回答2: Fyi, I've finished a stable release of gmaps4rails. See: https://github.com/apneadiving/Google-Maps-for-Rails 回答3: If your requirements are only to show google map of specific region, possibly

Google Maps, Rails and Jquery

一世执手 提交于 2019-12-13 21:04:18
问题 Update 7/17 SOLVED I've updated my code to the Solved version. Original Question I'm trying to show Google Maps via the Gem gmaps4rails. After researching the following 2 questions that were posted here & here it seems Google Maps has issues with a tab that hides and shows content from Jquery or Javascript and will not display a Google Map properly without some code in the Jquery. I'm stuck on resizing the map in my javascript can someone point out my errors? Thanks! My code: Javascript

Show infowindow on mouseover event [closed]

可紊 提交于 2019-12-13 17:09:23
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . How can I show/hide a Infowindow on mouseover/mouseout event? How can I substitue the Infowindow to tooltip like in this site: http://flowplayer.org/tools/demos/tooltip/index.html? Thanks, Luciano 来源: https://stackoverflow.com/questions/6921456/show-infowindow-on-mouseover-event

gmaps4rails: Uncaught ReferenceError: Gmaps is not defined

喜你入骨 提交于 2019-12-13 13:59:02
问题 I want to inclued maps into my rails application (I am using Rails 3.2.11 with asset pipeline) via the Gmaps4Rails gem. Following the setup instructions for this gem on https://github.com/apneadiving/ , I have included the gem in the Gemfile via gem gmaps4rails copied the assets to my rails app using the generator provided by the gem rails generate gmaps4rails:install . After doing that, there is the gmaps4rails.css in the app\assets\stylesheets folder and 5 coffeescripts in the àpp\assets

No route matches {:action=>“show”, :controller=>“restaurants”}

随声附和 提交于 2019-12-13 08:36:10
问题 If I want to go with my home page clicking on the map localhost:3000/maps gets out this error No route matches {:action=>"show", :controller=>"restaurants"} controllers/maps_controller.rb def index @maps = Map.all @json = Map.all.to_gmaps4rails do |map, marker| marker.infowindow info_for_restaurant(map.restaurant) end respond_to do |format| format.html # index.html.erb format.json { render json: @maps } end end def show @map = Map.find(params[:id]) respond_to do |format| format.html # show

gmaps4rails with Google Maps searchbox

时光总嘲笑我的痴心妄想 提交于 2019-12-13 06:40:13
问题 I'm writing a map applcication with Ruby-on-Rails 3 and gmaps4rails gem. I have the map setup and everything works fine but I would like to have a google maps like searchbox on the top with a dropdown list of possible places, like this: Is there any easy way of doing this or a plugin that gives this functionality with not to much coding? Preferably I would like to limit the search results to just one country if that is possible. Regards, Johann 回答1: I'm in a similar boat. In the past my