Javascript API

Get Started

Display your Store's data on a custom Map

Load the API

In order to load asynchronously our javascript API, we provide our customers a javascript loader. You can host the loader or directly use https://sdk.woosmap.com/locator/loader.js.

<script src="https://sdk.woosmap.com/locator/loader.js"></script>

The first step to use the Woosmap Javascript API on your website is to link this loader.

Then you have to define the callback that will be executed when the API is fully loaded. You need to pass it to the WoosmapLoader object through its load function and probably attach this action to your « onload » event to be sure to have all your scripts and DOM ready. The WoosmapLoader takes 3 arguments :

  • the version of the API you want to load (for now only the version 1 is available).
  • The public key we provided you.
  • a pointer to the callback function mentioned above.
//use WoosmapLoader to load asynchronously the API

var loaderOptions = {version: '1.3', publicKey: config.key, callback: woosmap_main};

if (window.attachEvent)
    window.attachEvent('onload', function () {
        WoosmapLoader.load(loaderOptions)
    });
else
    window.addEventListener('load', WoosmapLoader.load(loaderOptions), false);

//this function is called when the loader finishes to load the API
function woosmap_main() {
    alert('load end');
}
var config = {
    'key': '12345678'
};

Versioning

The Woosmap team will regularly update this Javascript API with new features, bug fixes, and performance improvements. All API changes will be backwards-compatible, ensuring that if you launch an application using the currently documented interfaces, that application will continue to work without modification as the API is updated. Read more about versioning.