Running Custom Javascript with Storemapper Callbacks

There are a number of reasons you might want to run custom Javascript on your store locator:

  • To further customize the layout or design
  • To send store locator events to your analytics tools
  • To trigger other JS-based apps that need to be loaded AFTER Storemapper finishes loading

Storemapper renders normal HTML on your page so you can target elements with your standard Javascript or jQuery selectors (see Using Custom CSS for a breakdown of the HTML elements).

We provide three callbacks that you can use to further customize the behavior and/or presentation of your store locator widget:

function storemapper_callback() {

// Called immediately after Storemapper finishes loading

}


function storemapper_after_search() {

// This function is called after a user makes a search

// but before Storemapper loads the results

}


function storemapper_after_search_result() {

// This function is called after search results

// are displayed in the page

}

You can also access the Map object via the global variable Storemapper.map.


Important: To avoid any conflicts or issues, we recommend putting your callbacks somewhere on the page below where you have added the Storemapper embed code.

Still need help? Contact Us Contact Us