joshuamiller / cartographer

Google Maps on Rails
72 stars 39 forks source link

Errors and Missing Info in README File #12

Open gordonbanderson opened 13 years ago

gordonbanderson commented 13 years ago

The examples in the readme are too brief and also do not work.

1) No mention of the use of cartographer-config.yml to be placed in the config directory 2) No examples setting the centre of the map explicitly, which to me is a basic first example

e.g. @map = Cartographer::Gmap.new( 'map' ) @map.zoom = 4 @map.center = [-40,174] @map.debug = true

3) The example with markers fails, because the default icon is not an icon object, but the symbol :normal. When the name instance variable is evaluated when creating the javascript for the marker, failure occurs. Fix to README:

@map = Cartographer::Gmap.new( 'map' )
@map.zoom = :bound
@map.debug = true
normal_icon = Cartographer::Gicon.new
@map.icons << normal_icon
marker1 = Cartographer::Gmarker.new(:name=> "taj_mahal", :marker_type => "Building",
          :position => [27.173006,78.042086], :icon => normal_icon,
          :info_window_url => "/url_for_info_content")
marker2 = Cartographer::Gmarker.new(:name=> "raj_bhawan", :marker_type => "Building",
          :position => [28.614309,77.201353],
          :icon => normal_icon,
          :info_window_url => "/url_for_info_content")

@map.markers << marker1
@map.markers << marker2