Tuesday, June 24, 2014

Pharo and GoogleMaps

By accident I found http://smalltalkhub.com/#!/~smaass/GMaps a small project to access google maps from Pharo. Allows you to easily work with Google maps by querying for an address:

|g|
g := GoogleMaps geocode: 'Rue du Bel air, Paris'.
^ g address inspect

or visiting a location in the browser:

|g url|
g := GoogleMaps geocode: 'Rue du Bel air, Paris'.
url := String streamContents: [:s |
 s nextPutAll: 'https://www.google.de/maps/@';
    nextPutAll: g location x asString;
    nextPut: $,;
    nextPutAll: g location y asString;
    nextPutAll: ',16z' 
].
NBWin32Shell shellBrowse: url

Requires NeoJSON, so load this first from configuration browser.

1 comment:

Leo Paniceres said...

Thank you very much....
excellent implementation!!!