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

Maps without a model #325

Closed mildfuzz closed 11 years ago

mildfuzz commented 11 years ago

I have no need to add location to a model, I just want one static map

I have deduced that something like the following should work:

@map = {:longitude => "-1.770609", :latitude => "51.442247"}.to_gmaps4rails

but while the map loads, the location is wildly out (should be in Wiltshire, England)

apneadiving commented 11 years ago

It should be:

@map = [{:lng => "-1.770609", :lat => "51.442247"}].to_gmaps4rails

But you'd rather simply insert json. All examples are here