Forum: Ruby on Rails New cartographer

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2a3d402b459dc1c1194762d647322419?d=identicon&s=25 lists (Guest)
on 2005-11-12 12:50
(Received via mailing list)
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
B7c24a7df391a1c318a90974537afc43?d=identicon&s=25 Ramin Bozorg (i8ramin)
on 2005-11-12 18:40
(Received via mailing list)
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'
2a3d402b459dc1c1194762d647322419?d=identicon&s=25 lists (Guest)
on 2005-11-12 18:55
(Received via mailing list)
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
B7c24a7df391a1c318a90974537afc43?d=identicon&s=25 Ramin Bozorg (i8ramin)
on 2005-11-12 22:58
(Received via mailing list)
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
0f1fa6b6ea69391ae1d1f64b33cb77b8?d=identicon&s=25 eric (Guest)
on 2005-11-13 01:25
(Received via mailing list)
Cartographer looks very useful! Does anyone know of a Rails plugin to
convert street addresses to Lat/Long ?

-eric
7a5ed48939fc288a4c70778140b203f6?d=identicon&s=25 Adam Roth (aroth)
on 2005-11-13 08:08
(Received via mailing list)
#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
7077206baf3a50094dcdbf81c46a0e08?d=identicon&s=25 hypsometry (Guest)
on 2005-11-13 23:56
(Received via mailing list)
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
B7c24a7df391a1c318a90974537afc43?d=identicon&s=25 Ramin Bozorg (i8ramin)
on 2005-11-14 00:56
(Received via mailing list)
I went to google and got an API key for localhost.. everything works
fine
now. Thanks!
28668141f2faf4eb9f90fbaab79d220c?d=identicon&s=25 dnstevenson (Guest)
on 2005-11-14 16:56
(Received via mailing list)
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
B7c24a7df391a1c318a90974537afc43?d=identicon&s=25 Ramin Bozorg (i8ramin)
on 2005-11-14 17:35
(Received via mailing list)
Sweet!
2a3d402b459dc1c1194762d647322419?d=identicon&s=25 lists (Guest)
on 2005-11-14 23:26
(Received via mailing list)
On Sun, 2005-11-13 at 01:05 -0600, Adam Roth wrote:
> 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
F7d94c4c159ec28690c0190bbd304ec4?d=identicon&s=25 court3nay (Guest)
on 2005-11-15 10:37
(Received via mailing list)
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?
>
> -Phil Hagelberg
>

i think code for this is in the (unforked) cartographer... great work
btw!
7077206baf3a50094dcdbf81c46a0e08?d=identicon&s=25 hypsometry (Guest)
on 2005-11-16 17:35
(Received via mailing list)
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
This topic is locked and can not be replied to.