Hello. I''ve come up with a new version of the Cartographer library that lets you embed Google Maps into your Rails app with ease. It allows you to do stuff like define your maps and markers in Ruby instead of getting your fingers mucky with Javascript. It doesn''t support the complete Google Maps API yet, but I''d say it''s about 70% of the way there or so. Anyway, if you think it would be fun/useful to play with GMaps, give it a shot. It''s available as a plugin, so all you need is script/plugin install -x svn://dotsx.usc.edu/cartographer/branches/pnh/vendor/plugins/cartographer More info: http://cartographer.rubyforge.org/ -Phil http://technomancy.us
When I install this plugin and start my server, I get this error from Webrick. Any ideas? => Booting WEBrick... ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies .rb:207:in `load'': script/../config/../vendor/plugins/cartographer/lib/cartograp her.rb:148: syntax error (SyntaxError) #{name}.centerAndZoom(new GPoint(#{@center.[0]}, #{@center.[1]}), #{@zoom}); ^ script/../config/../vendor/plugins/cartographer/lib/cartographer.rb:183: syntax error script/../config/../vendor/plugins/cartographer/lib/cartographer.rb:186: class d efinition in method body script/../config/../vendor/plugins/cartographer/lib/cartographer.rb:201: syntax error html << "\nvar #{@name} = new GMarker(new GPoint(#{@position.[0]}, #{@posi tion.[1]}));\n" ^ script/../config/../vendor/plugins/cartographer/lib/cartographer.rb:213: syntax error from ./script/../config/../vendor/rails/activesupport/lib/active_support /dependencies.rb:207:in `load'' from ./script/../config/../vendor/rails/activesupport/lib/active_support /dependencies.rb:39:in `require_or_load'' from ./script/../config/../vendor/rails/activesupport/lib/active_support /dependencies.rb:22:in `depend_on'' On 11/12/05, Phil Hagelberg <lists-Tr7DW4wtY2wdnm+yROfE0A@public.gmane.org> wrote:> > Hello. > > I''ve come up with a new version of the Cartographer library that lets > you embed Google Maps into your Rails app with ease. It allows you to do > stuff like define your maps and markers in Ruby instead of getting your > fingers mucky with Javascript. > > It doesn''t support the complete Google Maps API yet, but I''d say it''s > about 70% of the way there or so. > > Anyway, if you think it would be fun/useful to play with GMaps, give it > a shot. It''s available as a plugin, so all you need is > script/plugin install -x > svn://dotsx.usc.edu/cartographer/branches/pnh/vendor/plugins/cartographer > > More info: http://cartographer.rubyforge.org/ > > -Phil > http://technomancy.us > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- - Ramin http://www.getintothis.com/blog _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On Sat, 2005-11-12 at 12:37 -0500, Ramin wrote:> When I install this plugin and start my server, I get this error from > Webrick. Any ideas?Wow, um.... brain.... turn.... on.... Yes, it is fixed. </embarrasment> -Phil
Cool. that fixed it. There is a small typo on the catrographer.rubyforge.org<http://catrographer.rubyforge.org>website. Instead of gmap_header, it should be gmaps_header. Now i''m getting an uninitialized constant GOOGLE_MAPS_API_KEY, but I am guessing this is because I haven''t put in my API key yet (mainly because I don''t have one.) Since each API key can only be used per url, whats the best way to test my application on localhost w/o having an API key? Thanks On 11/12/05, Phil Hagelberg <lists-Tr7DW4wtY2wdnm+yROfE0A@public.gmane.org> wrote:> > On Sat, 2005-11-12 at 12:37 -0500, Ramin wrote: > > When I install this plugin and start my server, I get this error from > > Webrick. Any ideas? > > Wow, um.... brain.... turn.... on.... > > Yes, it is fixed. </embarrasment> > > -Phil > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- - Ramin http://www.getintothis.com/blog _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Cartographer looks very useful! Does anyone know of a Rails plugin to convert street addresses to Lat/Long ? -eric
#1. Cartographer is useful, but I''m having a slight issue with the markers. Any space in the text is being converted to linebreaks. IE: "This is my marker text" shows up as: This is my marker text in the bubble when I click on the marker icon. Ideally, I''d like to render_to_string( :partial => ''map/marker'' ) to generate marker bubble HTML... which works except for the newline/linebreak problem. #2. You can use geocoder.us <http://geocoder.us> to get coordinates from US addresses. They also have an API. No rails plugin that I know of yet. Adam On 11/12/05, Eric Wagoner <eric-gPcogUOuSIWWkzVdRvz7FA@public.gmane.org> wrote:> > Cartographer looks very useful! Does anyone know of a Rails plugin to > convert street addresses to Lat/Long ? > > -eric > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On 11/12/05, Ramin <i8ramin@gmail.com> wrote:> Since each API key can only be used per url, whats the best way to test my > application on localhost w/o having an API key?Depends on what you mean. You can view source and look at the Javascript that Cartographer's producing and see if it makes sense. But that'd be kind of lame. I assume you mean 'test' in the sense of 'use the map that Cartographer should be cajoling Google into producing for you'. If so, you must have an API key. It won't work otherwise. And Google is happy to give you a key for http://localhost/, so if that's how you're serving your app locally, then no worries. -- Chris Boone http://hypsometry.com/ : website edification http://uvlist.org/ : free classifieds for the Upper Valley _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
I went to google and got an API key for localhost.. everything works fine now. Thanks! On 11/13/05, Chris Boone <hypsometry-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > On 11/12/05, Ramin <i8ramin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Since each API key can only be used per url, whats the best way to test > my > > application on localhost w/o having an API key? > > Depends on what you mean. You can view source and look at the > Javascript that Cartographer''s producing and see if it makes sense. > > But that''d be kind of lame. > > I assume you mean ''test'' in the sense of ''use the map that > Cartographer should be cajoling Google into producing for you''. If so, > you must have an API key. It won''t work otherwise. > > And Google is happy to give you a key for http://localhost/, so if > that''s how you''re serving your app locally, then no worries. > > -- > Chris Boone > > http://hypsometry.com/ : website edification > http://uvlist.org/ : free classifieds for the Upper Valley > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- - Ramin http://www.getintothis.com/blog _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Eric Wagoner <eric@...> writes:> > Cartographer looks very useful! Does anyone know of a Rails plugin to > convert street addresses to Lat/Long ? > > -eric >I''ve put up a site built on ROR that does geocoding. I have a webservice, and an example in Ruby. Check it out at http://www.geocodeamerica.com/home/developer Dave
Sweet! On 11/14/05, Dave Stevenson <dnstevenson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Eric Wagoner <eric@...> writes: > > > > > Cartographer looks very useful! Does anyone know of a Rails plugin to > > convert street addresses to Lat/Long ? > > > > -eric > > > > > I''ve put up a site built on ROR that does geocoding. I have a webservice, > and > an example in Ruby. Check it out at > http://www.geocodeamerica.com/home/developer > > Dave > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- - Ramin http://www.getintothis.com/blog _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On Sun, 2005-11-13 at 01:05 -0600, Adam Roth wrote:> #1. Cartographer is useful, but I''m having a slight issue with the > markers. Any space in the text is being converted to linebreaks. IE: > "This is my marker text" shows up as: > > This > is > my > marker > text > > in the bubble when I click on the marker icon. Ideally, I''d like to > render_to_string( :partial => ''map/marker'' ) to generate marker bubble > HTML... which works except for the newline/linebreak problem.I can''t duplicate this. Do actual ''<br />'' tags occur in the HTML? Could you send me an example? An URL? Is the scheme of storing API keys in a hash keyed on the hostname the kind of thing that would people consider useful? I like it because I can have a separate API key depending on if I deploy on my laptop via webrick or on the production server in lighty. Would it be more useful to store the API key in a separate file so that you can just edit the file on a per-host basis? -Phil Hagelberg
On 11/14/05, Phil Hagelberg <lists-Tr7DW4wtY2wdnm+yROfE0A@public.gmane.org> wrote:> > Is the scheme of storing API keys in a hash keyed on the hostname the > kind of thing that would people consider useful? I like it because I can > have a separate API key depending on if I deploy on my laptop via > webrick or on the production server in lighty. Would it be more useful > to store the API key in a separate file so that you can just edit the > file on a per-host basis? > > -Phil Hagelberg >i think code for this is in the (unforked) cartographer... great work btw!
On 11/14/05, Phil Hagelberg <lists@hagelb.org> wrote:> Is the scheme of storing API keys in a hash keyed on the hostname the > kind of thing that would people consider useful? I like it because I can > have a separate API key depending on if I deploy on my laptop via > webrick or on the production server in lighty. Would it be more useful > to store the API key in a separate file so that you can just edit the > file on a per-host basis?Yes, that's useful, to me at least. When using the old version of Cartographer I had a helper that checked the host and provided the appropriate API key; this is easier and neater. Storing the key separately would be a nuisance. For instance, on the current project I have a key for my laptop, a key for my staging server, a key for the production server with a port (for almost-production testing), and a key for the production server without a port. Keeping track of all of those would be a pain. Oh, and thanks Phil... ;) -- Chris Boone http://hypsometry.com/ : website edification http://uvlist.org/ : free classifieds for the Upper Valley _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails