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.
Google Maps can be integrated totally free to any app.
All Maps Embed API requests are available at no charge with unlimited usage.
For example, if Google makes changes in its Maps API, you have to wait for an updated version of the gem or plugin or integrate manually. In fact, there is no major difficulty in integrating Google Maps into Rails app and IMHO it makes sence to do it without gems.
These coordinates can be used to place markers or position the map. There is a great gem for Rails - Geocoder, which can handle all the geocoding related tasks. It's quite simple to set it up. What you have to do is to add two fields - latitude:float and longitude:float - to the table that contains addresses, specify in the model:
Also it's possible to specify geo location with latitude and longitude on markers: So in Rails you can use, for example, image_tag with google map image path helper:
If your requirements are only to show google map of specific region, possibly with some markers, you can use Google Maps Static Image API, for example: Here is a good article on subject. Also it's possible to specify geo location with latitude and longitude on markers:
Fyi, I've finished a stable release of gmaps4rails.
See: https://github.com/apneadiving/Google-Maps-for-Rails
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With