To embed a map on your page, simply instantiate Atlas and pass in an element where it should be located:
new Atlas($('map'));
For more advanced functionality, you may pass several options, which are explained further below.
new Atlas(Element, [options])
The locations option is an array of JSON object which have the following properties:
Example:
[ { "longitude": "45.497568", "latitude": "-73.576645", "show": "", "html": "Montreal", "icon": { "image": "http://www.google.com/mapfiles/markerA.png", "shadow": "http://www.google.com/mapfiles/shadow50.png", "iconSize": [20, 34], "shadowSize": [37, 34], "iconAnchor": [9, 34], "infoWindowAnchor": [9, 2] } }, { "longitude": "41.682317", "latitude": "-71.460121", "show": "", "html": "Rhode Island", "icon": { "image": "http://www.google.com/mapfiles/markerB.png", "shadow": "http://www.google.com/mapfiles/shadow50.png", "iconSize": [20, 34], "shadowSize": [37, 34], "iconAnchor": [9, 34], "infoWindowAnchor": [9, 2] } }, { "longitude": "37.794128", "latitude": "-122.414582", "show": "", "html": "San Francisco", "icon": { "image": "http://www.google.com/mapfiles/markerC.png", "shadow": "http://www.google.com/mapfiles/shadow50.png", "iconSize": [20, 34], "shadowSize": [37, 34], "iconAnchor": [9, 34], "infoWindowAnchor": [9, 2] } } ]
The icon option is an JSON object which has the following properties:
Example (default style):
{ "image": "http://www.google.com/mapfiles/marker.png", "shadow": "http://www.google.com/mapfiles/shadow50.png", "iconSize": [20, 34], "shadowSize": [37, 34], "iconAnchor": [9, 34], "infoWindowAnchor": [9, 2] }
Please contact me (beaudet.alex [at] Google's mail service) if you have any suggestions or comments.
Thanks to David Chan (http://www.davidchan.com) for his help and input. Also, the data structure used is similar to (and inspired by) gMap (http://gmap.nurtext.de), a great jQuery plugin written by Cedric Kastner.
A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.
Found a bug in this plugin? Please report it this repository's Github Issues.
blog comments powered by Disqus