Store Locator Widget Advanced Usage

Listen to advanced user events and customize your widget with your own style.
  1. Events
    1. Supported Events
    2. Handling Events
    3. Example
  2. Custom renderer
    1. Example of simple store custom renderers
    2. Example of advanced store custom renderers
  3. Baidu Map
    1. Autocomplete
    2. Basemap styling
    3. Autocomplete and Basemaps Baidu styling example


The Store Locator Widget provides events you can listen to. Whenever a user triggers an existing event from the HANDLED_EVENT object, the Store Locator Widget will fire a callback function with dedicated parameters.

For example, the Widget will fire a SELECT_STORE event when the user selects a Store either by clicking on a store from the side panel or by clicking a marker on the map. The fired callback function for this event has the store_id parameter.

Supported Events

We mainly focus on User Events. Here is the full list of supported events and the parameters that are passed to the callback function. Check reference for more details.

Event Name Descripition Parameters
FAVORITED Triggered when a store is set as favorite id_store
SELECT_STORE Triggered when a store is selected id_store
PHONE_CLICK Triggered when the phone number of a selected store is clicked id_store, phone
EMAIL_CLICK Triggered when the email of a selected store is clicked id_store, email
LOCATION_SELECTED Triggered when the user select a suggestion from the search results LatlngLocation
GEOCODE Triggered when a geocode request succeeds querystring
AUTOCOMPLETE Triggered when an autocomplete request is sent querystring
GET_DIRECTIONS Triggered when retrieving directions id_store, startLatlng, endLatlng
SELECT_DIRECTION Triggered when an itinerary is selected from the directions list id_store, SelectedDirection

Handling Events

To register for event notifications, use the methods listenOn or listenOnce, event handler. That method takes an event to listen for, and a function to call when the specified event occurs.

var webapp = new WebApp('storeContainerID', 'your-woosmap-public-key');
webapp.listenOn(webapp.HANDLED_EVENT.SELECT_STORE, function(storeId) {
    console.log("store has been selected " + storeId);


The below sample will show you what events are triggered by the Woosmap Store Locator Widget as you interact with it.

view in fullscreen

Custom renderer

Left store panel is fully customizable using setSummaryStoreRenderer setFullStoreRenderer

A more detailed article is available on the Woosmap blog.

The two following examples can be useful for those who want to customize the Store Locator Widget. The simple example is sort of a default theme that you can edit it to add or remove informations. The advanced example has all previous informations plus pictures and ratings.

Example of simple store custom renderers

Example of advanced store custom renderers

Baidu Map


When using Baidu provider for Store Locator Widget, autocomplete allows user to search for city names directly at first character input. As the webapp provides an unified configuration to handle various provider options, you can use the places configuration the same way than with Google provider.

Please see MapsConf object Specification for more details.

Note that the Localities autocomplete service is not available for China yet.

Basemap styling

You can use some Baidu styling options by using the baiduMapStyle property of the WoosmapViewConf object Specification. Currently, only Baidu JsAPI v2 styling is available using the following styles :

Autocomplete and Basemaps Baidu styling example

Was this article helpful?
Have more questions? Submit a request