I have the basis for a working JavaScript– needs some touch-up work and then converted to a basic jQuery plugin.
– Needs to work in all modern browsers – IE7+, Safari 4+, Firefox 3.5+, Netscape 4 (nah, just kidding on the last one. Making sure you are reading this.)
– The script tries to determine the user’s address based on HTML5 GeoLocation.
– If that fails, it uses the Google Maps API to do that.
– The script runs through an unordered list with ID attribute equal to “locations”
– It looks to see if there are HTML5 data- attributes in the markup of each address (data-longitude and data-latitude) If there are, it uses that information and passes it to the Google Maps API.
– If the data- attributes aren’t there, it uses Google Maps API to determine the longitude and latitude of the addresses.
– Once the script has all that information, it re-assembles the list so that the address that is closest to the user is first and so on.
– Once the script is working, please convert it to a jQuery Plugin (See http://docs.jquery.com/Plugins/Authoring )
