All you need to do to use the script is get your own Google Maps key and embed the script in the page you want to analyse, giving it the ID of the main text element as a parameter:
<script src="http://github.com/codepo8/geotoys/raw/master/addmap.js"></script> <script> addmap.config.mapkey = 'YOUR_API_KEY'; addmap.analyse('content'); </script>
Under the hood here is what happens:
- The script grabs the innerHTML of the element and runs it through the open YQL table of Yahoo Placemaker.
- It then takes the data, assembles the HTML and puts together the URI for the map
- The map gets displayed using the Google static map API
The code of addmap.js is available on GitHub.