Welcome to Nome, a tiny Javascript library that extends the geolocation api for your website.
Download the latest version of Nome
After downloading Nome, extract the Javascript file into your current infrastructure. Then link to that Javascript file in the normal way.
<script type="text/javascript" src="[PATH TO JAVASCRIPT FILE]"></script>
Once loaded Nome is accessible from the global namespace of:
nome.method(properties)
Nome asynchronously downloads data from the internet to allow for the extended information to be ready for your viewers session. This data load will have a small lag time associated with it due to the way the internet works.
There are a couple of options built into Nome that allows you to speed up the experience for your end user.
Depending on your use of Nome you may not need the extra weather data we inject into the browser, disabling the weather feed into the browser does offer a speed increase.
nome.weatherFeed(true|false);
To give your users the best experience we've added a ready state function to Nome.
Before working with Nome directly it is recommended that you put your Nome queries within this ready state function, similar to what you normally do with jQuery when wanting to know when the DOM is ready to be worked with.
nome.ready(function() { ... });
Initially we need to tell Nome where it is. This will allow all distance calculations performed by Nome to work. You do this by setting the latitude and longitude values before the ready state function.
nome.setLocation(24,54);
Note: You may be developing the website in a different location to your clients outlet or place of business, so make sure that before you put Nome into a production environment that the location of Nome is correct.
By using basic Javascript your can switch this value if needs be for easier development and debugging.