31
Addmap.js – automatically analyse a text for geo locations and add a map
0 Comments | Posted by news in Javascript
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.
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:
PLAIN TEXT
XML:
<script src=”http://github.com/codepo8/geotoys/raw/master/addmap.js”></script>
<script>
addmap.config.mapkey = ‘YOUR_API_KEY’;
addmap.analyse(‘content’);
</script>
The script uses YQL and Yahoo PlaceMaker under the hood, for more info and updates on this, check the blog…













