Friday, January 29th, 2010

Addmap.js – automatically analyse a text for geo locations and add a map

Category: Examples, Geo, Google, JavaScript, Mapping, Yahoo!

<>p>As part of an upcoming article on geo location I am putting together a few Geo Toys for myself and here is the first one. Addmap.js is a JavaScript that analyses an elements text content, finds geographical locations and links them to Google Maps. It also adds a map preview and a list of the found locations to the element.

See addmap.js in action below – all the content in the green box is generated from the paragraph of text above it. You can try it out for yourself by clicking the screenshot.

Demonstration screenshot of addmap.js

Using addmap.js is easy – sign up for a Google Maps Key and provide it as a configuration parameter. Then call the analyse function with the ID of the element to analyse as the parameter:

  1. <script src="http://github.com/codepo8/geotoys/raw/master/addmap.js"></script>
  2. <script>
  3. addmap.config.mapkey = 'YOUR_API_KEY';
  4. addmap.analyse('content');
  5. </script>

The script uses YQL and Yahoo PlaceMaker under the hood, for more info and updates on this, check the blog.

Posted by Chris Heilmann at 10:17 am
1 Comment

+++--
3.1 rating from 19 votes

1 Comment »

Comments feed TrackBack URI

Maybe is a off topic but when I ‘ve seen the example I wonder if is it a good practice load js files directly from github instead of copy them in a hosting. Can I build an application with all js files on github, or only for examples and testing? Google code doesn’t allow it as I read in the TOS

Comment by gonzalo123 — January 29, 2010

Leave a comment

You must be logged in to post a comment.