Dynamic Google Maps

My Rails application (Rails: V 2.1.0, Ruby: V 1.8.6) has on it, the
ability for users to submit stories with their address information,
which will be atomised into appropriate fields.

A front end form allows users to submit stories, these stories are saved
into a database table. They are then approved by my client and are
displayed on a map.

Currently, this map is static and has to be changed by my client and
re-embedded every time a story, with a postcode, is submitted. So, the
map displays markers in the position of the postcode that is submitted
with the story.

My question is: what would you recommend as the most effective way to
automate this process to omit the need for my client to re-embed this
code?

If my request is not clear, please post whatever else you may need.

You can use geokit (http://github.com/andre/geokit-gem) + (
http://github.com/andre/geokit-rails) to geocode the story location and
then
use the YM4R-GM plugin to display the geocoded locations on a google map
(
http://github.com/queso/ym4r-gm) .

This article might be a bit dated, but it goes how you can interact with
the
YM4R-GM plugin:
http://www.developer.com/open/article.php/3757576/Adding-Google-Maps-To-Your-Rails-Applications.htm

Patrick R. wrote:

You can use geokit (http://github.com/andre/geokit-gem) + (
http://github.com/andre/geokit-rails) to geocode the story location and
then
use the YM4R-GM plugin to display the geocoded locations on a google map
(
http://github.com/queso/ym4r-gm) .

This article might be a bit dated, but it goes how you can interact with
the
YM4R-GM plugin:
http://www.developer.com/open/article.php/3757576/Adding-Google-Maps-To-Your-Rails-Applications.htm

Does this generate a new map with each post code that I will pass or
will it add a marker to the existing map?

a = Geokit::Geocoders::YahooGeocoder.geocode
“#{ModelName.first.address}”
a.ll

The above works in my console and returns the latitude and longitude as
requested. I cannot get this to work in my (development) application.

When I attempt to run “script/plugin install
svn://rubyforge.org/var/svn/ym4r/Plugins/GM/trunk/ym4r_gm”, it returns
“svn: not found”.

I assume this is a result of me missing subversion. Is there another way
to install this plugin.

Alternatively, can anyone tell me any better ways of finding the geocode
from an address or postcode?

I assume this is a result of me missing subversion. Is there another way

to install this plugin.

Alternatively, can anyone tell me any better ways of finding the geocode

from an address or postcode?

http://github.com/queso/ym4r-gm is a port onto github that I’ve used in
the
past.

If your model is using geokit (acts_as_mappable) , lat/lng are
attributes
from a provided address. Otherwise you have to geocode from calling
that
geocode method. acts_as_mappable provides convenience on top
ActiveRecords
find method as well for a geocodable model.

Pale H. wrote:
[…]

Installing the plugin from that port causes an error:

script/plugin install http://github.com/queso/ym4r-gm

You may need to tack “.git” on to the end of that URL.

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Patrick R. wrote:

I assume this is a result of me missing subversion. Is there another way to install this plugin.

Alternatively, can anyone tell me any better ways of finding the geocode from an address or postcode?

http://github.com/queso/ym4r-gm is a port onto github that I’ve used in
the
past.

If your model is using geokit (acts_as_mappable) , lat/lng are
attributes
from a provided address. Otherwise you have to geocode from calling
that
geocode method. acts_as_mappable provides convenience on top
ActiveRecords
find method as well for a geocodable model.

Installing the plugin from that port causes an error:

script/plugin install http://github.com/queso/ym4r-gm

Is there a way to produce the process of automatically adding custom
markers with info-windows onto Google Maps without a plugin or gem using
a provided address and postcode?

Marnen Laibow-Koser wrote:

Pale H. wrote:
[…]

Installing the plugin from that port causes an error:

script/plugin install http://github.com/queso/ym4r-gm

You may need to tack “.git” on to the end of that URL.

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Thank you, Marnen.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs