gmaps4rails

Custom Markers in Google Maps not Showing up in Firefox

☆樱花仙子☆ 提交于 2020-01-24 02:08:31
问题 I have a map that I have created in rails using the google maps for rails gem. It works in Chrome and Safari but it does not display custom .svg markers in Firefox 29. It does display the custom image for clusters (which is a png). I have bumped into a number of threads from the far past (FF 8 and 9) that said there was an issue that was resolved in 9 or 10 related to cors. However, it does not seem like it has been an issue for awhile, and especially not for 29. Does anyone know if this is a

In gmaps4rails, how do I move the map so the marker is in view?

拟墨画扇 提交于 2020-01-15 10:42:55
问题 I have a set of locations that I want to bring up, individually through ajax calls, and some of them aren't within the current bounds of the map. Is there a way to move the map so the marker is in view? I don't need it to be in the center, just as long as it's in view. 回答1: I figured it out after some research. I'd still be curious to know how to NOT have to center if the marker is visible on the map. var centerpoint = new google.maps.LatLng(lat_value, long_value); Gmaps4Rails.map.setCenter

Zoom bar disfigured in Google-Maps-for-Rails (gmaps4rails)

时间秒杀一切 提交于 2019-12-30 01:48:09
问题 For some reason my zoom bar is all pixelated and I'm not sure why. Any ideas? I used the basic setup: Controller: @json = User.all.to_gmaps4rails View: <%= gmaps4rails(@json) %> I'm not passing any special parameters or anything. The markers that I have on my models show up beautifully. 回答1: Add this to your css... there you will also have an issue with the terrain and overlays dropdowns... #mapCanvas label { width: auto; display:inline; } #mapCanvas img { max-width: none; } 回答2: With the

Gmaps4rails Maximum call stack size exceeded?

一世执手 提交于 2019-12-29 08:57:18
问题 I've got the following setup, what I want to do is update the markers when a map is moved: https://gist.github.com/277894809fe04cbc29c7 The json endpoint returns for example: [{"_id":"4ecc19ca8de17b2f0f000001","latitude":47.413358,"location":[47.413358,9.744583],"longitude":9.744583,"name":"d2"},{"_id":"4ecc14e68de17b2924000001","latitude":47.413417,"location":[47.413417,9.744417],"longitude":9.744417,"name":"another"}] but I get the following error when moving the map: Uncaught RangeError:

Gmaps4rails doesn't display my marker until reload

老子叫甜甜 提交于 2019-12-25 07:15:39
问题 I implemented a Gmaps4Rails Map in my app: Link to one Location, you may go back to the list with the link at the bottom and check another location ---http://immosmap.herokuapp.com/locations/37 My problem ist that I get this error and it only displays a blue map: Uncaught TypeError: Object # has no method 'setMap' But when I reload, it does display the way I want it to work. Do I have to implement a callback here? How? Didn't find my topic in the wiki... 来源: https://stackoverflow.com

Gmaps4rails looping through array

╄→гoц情女王★ 提交于 2019-12-25 06:54:56
问题 I have an array with 30+ locations I would like to display on my map. However, I have not found one source that demonstrates how to iterate through an array so that the markers appear on a map, but instead opt to strictly hard code the map lat/long values. For example, this is the code I have at present but it returns errors: allLocations = root.table.rows().data() root.forMap = [] for aLocation in allLocations root.forMap.push(aLocation[9] + ', ' + aLocation[10]) $('#multi_markers').map ->

scope of markers variable for google maps (gmaps4rails gem)

偶尔善良 提交于 2019-12-25 01:24:51
问题 I'm trying to understand javascript, and the way variables are passed around, but I'm not doing too well. I'm trying to refresh a google map's markers with ajax, but nothing is happening. I submit a form, which sends some variables to the controller. Some stuff is processed, and it responds with .js to... find.js.erb $('#collapseTwo ul').html("<%= j render partial: 'events/sidebar', collection: @events %>"); alert(<%= raw @hash.to_json %>); clearMarkers(); markers = handler.addMarkers(<%= raw

Rails 3 google maps

谁都会走 提交于 2019-12-24 22:47:54
问题 I'm trying to create a sample project with gmaps4rails gem: But getting an error: undefined method `gmaps’ for # Rails.root: /var/www/brandbk Application Trace | Framework Trace | Full Trace app/controllers/locations_controller.rb:46:in `block in create’ app/controllers/locations_controller.rb:45:in `create’ Request Parameters: {“utf8″=>”вњ“”, “authenticity_token”=>”CSpi+VhUe8CtF+4R6zxMEXbB8ofa0QxUF1ntGl+N1Ss=”, “location”=>{“address”=>”rwr”}, “commit”=>”Create Location”} Like this: http:/

Gmaps4rails: scaling (not zooming) a gmap

时光毁灭记忆、已成空白 提交于 2019-12-24 14:58:40
问题 I am using gmaps4rails and I have a set of dynamic generated markers, about 14, that I display across the globe. I use auto_adjust and it looks good, however, it seems that the size that I have chosen for the map fits perfectly between two zoom levels. It either shows too much of the map (e.g. you see asia on both sides) or if I zoom in one level, I don't see some markers. The css width and height we have chosen is what we want to fit in the window. Smaller or larger (to match the two zooming

Google Map infowindow not opening

我是研究僧i 提交于 2019-12-24 12:16:18
问题 I'm using Google Maps in my Rails app and I face some difficulties. I want to show an infowindow when a user clicks on a circle. It works fine when he clicks on a marker but now that I have circles it does not work. Here is my code: markers_json = <%= raw @circles %>; var map; var infoWindow; buildMap = function(){ var mapStyle = [ // https://snazzymaps.com/style/70/unsaturated-browns {"elementType":"geometry","stylers":[{"hue":"#ff4400"},{"saturation":-68},{"lightness":-4},{"gamma":0.72}]},{