Class: module:storelocatorjs

module:storelocatorjs(options, onReady)

new module:storelocatorjs(options, onReady)

Instanciate the constructor

Parameters:
Name Type Description
options Object

Storelocatorjs options

onReady function

Callback function executed when the store locator is ready

Source:

Methods

addEvents()

Create event listeners

Source:

addGoogleMapsEvents()

Create Google Maps event listeners

Source:

autocompleteRequest(lat, lng)

Function called on autocomplete changes Trigger a request with the new user research

Parameters:
Name Type Description
lat String

Latitude of the research

lng String

Longitude of the research

Source:

boundsChanged()

Function called on user map moved event

Source:

buildLoader()

Build the loader

Source:

cacheSelectors()

Cache DOM selectors

Source:

checkUserPosition()

Check user position with Google Maps geolocation API Get the user current position if available

Source:

createMarkers(data)

Create a Google Maps markers

Parameters:
Name Type Description
data Object

Marker datas

Source:

createOverlays()

Create custom overlay on the map for the debug mode overlayGlobal: list of all stores according to maxRadius option overlayLimit: list of all stores according to the limitInViewport option

Source:

createViewportWithLimitMarker(options)

Create a custom viewport (boundsWithLimit) Display a minimal list of markers according to the limitInViewport option

Parameters:
Name Type Description
options Object

Datas to create the custom viewport

Source:

destroyMarkers()

Destroy all created Google Map markers

Source:

extend(deep, …objects) → {Object}

Extends multiple object into one

Parameters:
Name Type Attributes Default Description
deep Boolean false

Enable extend for deep object properties

objects Array <repeatable>

List of objects to merged

Source:
Returns:

Objects merged into one

Type
Object

generateSVG(Style) → {Object}

Generate SVG from the associated SVG file

Parameters:
Name Type Description
Style Object

datas to customize the SVG

Source:
Returns:

Custom SVG to generate a Google Maps marker icons

Type
Object

getIconMarkerByCategory(category) → {Object}

Get SVG icon by category styles

Parameters:
Name Type Description
category String

Marker category

Source:
Returns:

Icon datas to generate a Google Maps markers

Type
Object

getMarkerStylesByCategory() → {Object}

Get marker styles by category, from options

Source:
Returns:

Formatted object with category name into key and marker styles datas

Type
Object

initAutocomplete()

Initialize Google Maps Autocomplete

Source:

initGeolocation()

Initialize the user geolocation

Source:

initMap()

Initialize the Google Maps

Source:

isBrowserIE()

Check if browser is an old Internet Explorer

Source:

loadAPI(apiKey)

Load the Youtube API

Parameters:
Name Type Description
apiKey String

Youtube API key

Source:

loading(state)

Update the loader status

Parameters:
Name Type Description
state Boolean

Status of the loader

Source:

onChangeSearchFormFilter(e)

On change on search form filters

Parameters:
Name Type Description
e Object

Event listener datas

Source:

onClickGeolocationButton(e)

On click on geolocation button

Parameters:
Name Type Description
e Object

Event listener datas

Source:

onClickSidebarNav(e)

Click on sidebar navigation item

Parameters:
Name Type Description
e Object

Event listener datas

Source:

onClickSidebarResultItem(e)

On click on sidebar result item

Parameters:
Name Type Description
e Object

Event listener datas

Source:

openInfoWindow(currentMarker)

Open the Google Maps native InfoWindow

Parameters:
Name Type Description
currentMarker Object

Marker data display inside the infoWindow

Source:

parseStores(options)

Parse store datas from the web service Create all markers Create all store results

Parameters:
Name Type Description
options Object

Store datas from the web service

Source:

refreshMapOnBoundsChanged(options)

Refresh the map on user map moved Trigger a request with the new map position

Parameters:
Name Type Description
options Object

Options to refresh the map

Source:

serializeForm(lat, lng) → {Object}

Serialize form datas

Parameters:
Name Type Description
lat String

Latitude

lng String

Longitude

Source:
Returns:

formData Datas required for the request (lat, lng, storesLimit, input, categories, radius)

Type
Object

triggerRequest(lat, lng, fitBounds)

Trigger a request to the web service to get all store results according to the position (lat, lng)

Parameters:
Name Type Description
lat String

Latitude of the research

lng String

Longitude of the research

fitBounds Boolean

Fit bounds on the map

Source: