Closed pistiolasm closed 10 years ago
This is what I have so far:
class Location < ActiveRecord::Base
attr_accessible :address, :latitude, :longitude, :title, :gmaps
acts_as_gmappable
def gmaps4rails_address self.address end
geocoded_by :address, :latitude => :fetched_latitude, # this will be overridden by the below :longitude => :fetched_longitude # same here
reverse_geocoded_by :latitude, :longitude
after_validation :geocode, :reverse_geocode, :if => :address_changed?
Geocoder.configure.units = :km Geocoder.configure.distances = :spherical
end
<%= gmaps("map_options" => { "zoom" => 14, "auto_adjust" => false, "center_latitude" => :latitude, "center_longitude" => :longitude }, "markers" => { "data" => @json }, "direction" => { "data" => { "from" => "Boston, MA", "to" => "Cleveland, OH" }, "travelMode" => "DRIVING", "display_panel" => true, "panel_id" => "instructions" }) %>
please ask questions on stackoverflow, issues are meant to receive code issues
Hi, I am new into to Ruby programming. I am using your gem which is absolutely awesome! I would also love to know how can i show directions from one place to another. Any help will be very appreciated. Thank you!