JS API v 1.4

Javascript Store Locator API Reference v 1.4
  1. Loader class
  2. BaseView class
  3. DataSearchSource class
  4. DataSource class
  5. LocatorWindow class
  6. MapsLoader class
  7. TemplateRenderer class
  8. TiledView class
  9. View class
  10. ZipCodeProvider class
  11. BaseLayer class
  12. DataLayer class
  13. TiledDataOverlay class
  14. TiledImageLayer class
  15. BaseRenderer class
  16. DefaultRenderer class
  17. MarkersRenderer class
  18. DirectionsProvider class
  19. DistanceProvider class
  20. GeocoderSearchSource class
  21. LocationProvider class
  22. NearbyStoresSource class
  23. PlacesSearchSource class
  24. Data class
  25. Feature class
  26. LatLng class
  27. LatLngBounds class
  28. Point class
  29. Size class
  30. F class
  31. Field class
  32. Query class
  33. SearchParameters class
  34. SearchQuery class
  35. Styler class
  36. DirectionsResultsDisplayer class
  37. InfoBox class
  38. MailView class
  39. OriginDestinationInput class
  40. SearchView class
  41. TableView class
  42. TravelModeSelector class
  43. DelegateProtocol class
  44. DelegateReturn class
  45. MVCObject class
  46. Address Interface
  47. BaiduDirectionsRouteParams Interface
  48. BaiduDistance Interface
  49. BaiduDuration Interface
  50. BaiduMapsOptions Interface
  51. BaiduPolylineOptions Interface
  52. BaseViewOptions Interface
  53. BoundsPadding Interface
  54. Contact Interface
  55. DataLayerOptions Interface
  56. DataStyle Interface
  57. DeprecatedStyleRule Interface
  58. DirectionsRouteInformationsParams Interface
  59. EventListeners Interface
  60. EventName Interface
  61. FeatureData Interface
  62. GeoJSON Interface
  63. GeocoderOptions Interface
  64. Geometry Interface
  65. GoogleGeocoderErrorCallback Interface
  66. JSONPOptions Interface
  67. LatLngLiteral Interface
  68. LoadOptions Interface
  69. MapsLoaderOptions Interface
  70. MarkerStyleOptions Interface
  71. NearbyOptions Interface
  72. OdInputOptions Interface
  73. OriginDestination Interface
  74. PolylineFilter Interface
  75. RendererOptions Interface
  76. SearchParametersOptions Interface
  77. SelectedAndUnselectedRendererOptions Interface
  78. Store Interface
  79. StoreEventCallback Interface
  80. Style Interface
  81. StyleRule Interface
  82. TileStyle Interface
  83. TiledImageLayerOptions Interface
  84. TiledOverlayOptions Interface
  85. TiledViewOptions Interface
  86. TrafficLayerOptions Interface
  87. TypesRules Interface
  88. createMapOptions Interface
  89. QuerySearchOptions Interface
  90. TextSearchQuery Interface
  91. InfoBoxOptions Interface
  92. SearchViewOptions Interface
  93. ControlPosition Enum
  94. BoolOperators Enum
  95. Operators Enum

Loader class

Loader

Constructs a new WoosmapLoader instance.

Constructor
Loader()
Parameters: None

Constructs a new WoosmapLoader instance.


Methods
load(loadOptions)
Parameters:

Load method with one parameter and no version aliases.


BaseView class

woosmap.BaseView
This class extends MVCObject.
Constructor
BaseView()
Parameters: None

Constructs a new BaseView

  • didLocationMarkerDragEnd is called when the location marker drag did end.

Properties

The user defined location. This property is bindable.

This marker is positioned on the map when location property changes. If this marker is set draggable (marker.setDraggable(true)) the location property will be changed when dropping the marker (ie. when the marker fires the dragend event).

Controls the viewport padding used by fitBounds.

Type: Store

The currently selected store. This property is bindable.

Type: Store[]

List of stores displayed. This property is bindable.


Methods
init(map, options)
Parameters:

Initializer method to call in subclasses. This is splitted from the constructor to allow subclasses to use it as their prototype.

panTo(center, padding?, force?)
Parameters:

Sets the center of the map. Takes in account the padding values to displace the viewport.

fitBounds(bounds, padding?)
Parameters:

Sets the viewport to contain the given bounds. Takes in account the padding values to displace the viewport.

enableZoom(activate)
Parameters:
  • activate: boolean (e.g. true or false)

Enable or Disable zoom when select a store

enablePan(activate)
Parameters:
  • activate: boolean (e.g. true or false)

Enable or Disable pan when select a store

enablePaddedStoreCenter(activate)
Parameters:
  • activate: Boolean

Enable or Disable padded Store Center the padded store center triggers panning only if the selected store is outside the ‘visible zone’ ie. the current map bounds minus padding.

stores_changed()
Parameters: None

This is the function called when the stores property has changed.

selectedStore_changed()
Parameters: None

This function is called when selectedStore property is changed

getDataBounds()
Parameters: None
Return Type: google.maps.LatLngBounds | null

Process each feature in the dataLayer to compute the bounds of the displayed data.

getMap()
Parameters: None
Return Type: google.maps.Map

Returns the google maps used by the BaseView.

removeAllStores()
Parameters: None

Removes all the stores from the map.

displayStore(store)
Parameters:
  • store: Store the store to display

Adds a single store to the map, zoom + pan on it

location_changed()
Parameters: None

This function is called when location property is changed

addListener(eventName, callback)
Parameters:
Return Type: StoreEventListener

Adds a store event listener.

removeListener(storeEventListener)
Parameters:
  • storeEventListener: StoreEventListener

Removes a store event listener.


DataSearchSource class

woosmap.DataSearchSource
This class extends woosmap.utils.MVCObject.

Constructs a new DataSearchSource

Constructor
DataSearchSource(dataSource, searchTextOptions, nearbyOptions, polylineFilter?)
Parameters:
  • dataSource: DataSource an instance of woosmap DataSource
  • searchTextOptions: TextSearchQuery to set initial search parameters if used with autocomplete
  • nearbyOptions: NearbyOptions containing two key : maxStores and maxDistanceFromUser for the nearby search if lat/lng are provided through location property.
  • polylineFilter: PolylineFilter the PolylineFilter if you want filter on a polyline path

Constructs a new DataSearchSource


Properties
Type: string

Observes his query to launch the search into store’s data.

Observes his location to narrow the search around a location. Needs to be completed with a maxStore and a maxDistanceFromUser in constructors option nearbyOptions

Contains options to searchStores


Methods
autocomplete_query_changed()
Parameters: None

Listens the changes of query.

location_changed()
Parameters: None

Listens the changes of location.

updateSearchQuery(key, value)
Parameters:
  • key: string the key of the searchQuery’s field which will be updated.
  • value: SearchQuery the new value of the searchQuery’s field.

Updated the searchQuery value.

updateSearchQueryAndSearch(key, value)
Parameters:
  • key: string the key of the searchQuery’s field which will be update.
  • value: SearchQuery the new value of the searchQuery’s field.

Updated the searchQuery value and launch a search with the new value.

addFieldToSearchTextOptions(fieldName, operator)
Parameters:
  • fieldName: string the new value of the searchTextOptions
  • operator: string the new value of the operator for filtering

Add a new field to searchTextOptions or update an existing field (new field will be used for store filtering).

removeFieldFromSearchTextOptions(fieldName)
Parameters:
  • fieldName: string the name of the field you want to remove

Remove a field from searchTextOptions (so field will not be use anymore for filtering).Update stores list after removal.

updateTextSearchQuery()
Parameters: None

Get the value of ‘autocomplete_query’ and searchTextOptions and update the SearchQuery with them. Then request new store list.

updateTextSearchQueryAndSearch()
Parameters: None

Get the value of ‘autocomplete_query’ and searchTextOptions and update the SearchQuery with them. Then request new store list.

search(querySearchParameters?)
Parameters:
  • querySearchParameters: SearchQuery an object containing a query for search. If no searchParameters is pass then DataSearchSource will use searchQuery property

Use the woosmap API to search into store’s data with nearbyOptions, polylineFilter, searchQuery and location as parameters.

setPolylineFilter(polylineFilter)
Parameters:

Add or update the polylineFilter for the searchSource.To remove the filter set is value to null.

setMaxStores(maxStores)
Parameters:
  • maxStores: Number the new maxStores value.

Update the maxStores value.To remove the search option set is value to null.

setMaxDistanceFromUser(maxDistanceFromUser)
Parameters:
  • maxDistanceFromUser: Number the new maxDistanceFromUser value.

Update the maxDistanceFromUser value.To remove the search option set is value to null.


DataSource class

woosmap.DataSource
Constructor
DataSource(api_url?, api_key?)
Parameters:
  • api_url: String
  • api_key: String

The DataSource object is the bridge to the server API.


Methods
getFromApi(url, callback)
Parameters:
  • url: String url for the request
  • callback: Function callback called if request is successful

Make an ajax call with the url and call the callback if success

getAllStores(callback)
Parameters:
  • callback: Function
Return Type: Promise

Returns all the stores.

getNearbyStores(lat, lng, callback, maxStores, maxDistanceFromUser)
Parameters:
  • lat: Number the latitude.
  • lng: Number the longitude.
  • callback: function the callback to be called with the stores.
  • maxStores: Number the maximum number of stores returned.
  • maxDistanceFromUser: Number radius in meters to filter the stores.
Return Type: Promise

Fetches stores that are near the (lng, lat) position and pass it to the callback. if lat and lng are not defined, we use the IP geolocation to pinpoint the user.

getStoreById(store_id, callback)
Parameters:
  • store_id: String
  • callback: Function
Return Type: Promise

Fetches a store by its store_id.

getStoresBySearchQuery(query, callback)
Parameters:
  • query: string the query
  • callback: function the callback to be called with the stores.
Return Type: Promise

Fetches stores that name matches the search query and pass it to the callback.

searchStores(searchQuery, callback)
Parameters:
  • searchQuery: SearchQuery the query object (composed by query, tags and types)
  • callback: function the callback to be called with the stores.
Return Type: Promise

Fetches stores that matches the search query and pass it to the callback.

searchNearbyStores(searchQuery, lat, lng, callback, maxStores, maxDistanceFromUser)
Parameters:
  • searchQuery: SearchQuery the query object (composed by query, tags and types)
  • lat: Number the latitude.
  • lng: Number the longitude.
  • callback: Function the callback to be called with the stores.
  • maxStores: Number the maximum number of stores returned.
  • maxDistanceFromUser: Number radius in meters to filter the stores.
Return Type: Promise

Fetches nearby stores that matches the search query and pass it to the callback.

searchStoresByParameters(searchParameters, callback)
Parameters:
  • searchParameters: SearchParameters an object containing all the data to do the search.
  • callback: Function the callback to be called with the stores.
Return Type: Promise

Search on store given a list of information

countStoresByParameters(searchParameters, callback)
Parameters:
  • searchParameters: SearchParameters an object containing all the data to do the search.
  • callback: Function the callback to be called with the stores count as an Object.
Return Type: Promise

return the number of stores matching parameters

storesBoundsByParameters(searchParameters, callback)
Parameters:
  • searchParameters: SearchParameters an object containing all the data to do the search.
  • callback: Function the callback to be called with the bounds as google.maps.LatLngBoundsLiteral. returns {} if no stores matched.
Return Type: Promise

return the bounds for all stores matching parameters

getProjectConfig(callback)
Parameters:
  • callback: Function the callback to be called with the config.
Return Type: Promise

Get the config object for the Project.


LocatorWindow class

woosmap.LocatorWindow
This class extends woosmap.utils.MVCObject.
Constructor
LocatorWindow(map, renderer, infoBoxOptions?)
Parameters:

Construct a LocatorWindow.


Properties
Type: Store

The currently selectedStore. This property is bindable


Methods
selectedStore_changed()
Parameters: None

When selectedStore changes open the InfoWindow on the current store. if selectedStore is null then close the InfoWindow.

getAnchorForCoordinates(coordinates)
Parameters:
  • coordinates: Array coordinates to build the anchor from.

Computes the Window anchor for coordinates

getMarkerForCoordinates(coordinates)
Parameters:
  • coordinates: Array to build the marker from.
Return Type: google.maps.Marker

Return a marker for coordinates

openOn(store)
Parameters:
  • store: Object the store that was selected.

Opens the info window on the store.

close()
Parameters: None

Closes the Locatorwindow

setOpeningCallback(openingCallback?)
Parameters:
  • openingCallback: Function a callback fired every time the infowindow open

Adds a listener for domready event of infowindow. This method clears previously added domready listeners.

setInfoBoxOptions(options?)
Parameters:
  • options: InfoBoxOptions containing each options that needs to be changed

Method to set InfoboxOptions if it’s not a google InfoWindow


MapsLoader class

woosmap.MapsLoader
Constructor
MapsLoader(clientIdOrOptions?, librariesToLoad?)
Parameters:
  • clientIdOrOptions: String | MapsLoaderOptions parameters to load Google Maps API or clientId as string Deprecated : clientIdOrOptions and librariesToLoad can be strings .
  • librariesToLoad: String[] Deprecated : a list of String containing additional google libraries to load.

Construct a MapsLoader instance


Methods
load(callback)
Parameters:
  • callback: function the function to be called when done.

Loads the google maps api and calls the callback when done.


TemplateRenderer class

woosmap.TemplateRenderer

Constructs a TemplateRendererInstance

Constructor
TemplateRenderer(template)
Parameters:
  • template: string the hogan.js template string

Constructs a TemplateRendererInstance


Methods
render(properties?)
Parameters:
  • properties: object the template context.
Return Type: any

Renders the compiled template with the context

registerLambda(name, lambda)
Parameters:
  • name: String
  • lambda: Function

Registers a template Lambda


TiledView class

woosmap.TiledView
This class extends BaseView.

TiledView this view is mostly compatible with {woosmap.View}. This object mixes two layers:

  • a tiled image layer for higher zoom levels
  • a tiled vector layer for lower zoom levels
Constructor
TiledView(map, options?)
Parameters:

Methods
setSearchParameters(searchParameters)
Parameters:

Sets the searchParameters used to filter both image and vector layer.

setSearchQuery(searchQuery)
Parameters:

Sets the searchQuery used to filter both image and vector layer.

setPolylineFilter(polylineFilter)
Parameters:

Sets the polylineFilter used to filter both image and vector layer.


View class

woosmap.View
This class extends woosmap.BaseView.

Constructs a View

Constructor
View(map, markersOrOptions?, zoomLevel?)
Parameters:

ZipCodeProvider class

woosmap.ZipCodeProvider
This class extends woosmap.utils.MVCObject.

Constructs a new ZipCodeProvider

Constructor
ZipCodeProvider()
Parameters: None

Constructs a new ZipCodeProvider


Properties

The location used by the reverse geocoding to derive the zipcode. This property is bindable.

Type: string

Stores the zipcode associated the location. This property is bindable.


Methods
getZipCode()
Parameters: None
Return Type: string

Get the currently saved zipcode

getZipCodeType()
Parameters: None
Return Type: string

Get the zipcode type

location_changed()
Parameters: None

This method is called when the location has changed. It updates the zipcode by reverse geocoding


BaseLayer class

woosmap.layers.BaseLayer
Constructor
BaseLayer(options)
Parameters:
  • options: Object

BaseLayer.


Methods
setMap(map)
Parameters:

Set the map instance

getMap()
Parameters: None
Return Type: google.maps.Map

Getter to access to the map instance

setHidden(isHidden)
Parameters:
  • isHidden: Boolean

Set the visibility of the data

getHidden()
Parameters: None
Return Type: Boolean

Getter to access to the visibility state

selectStore(selectedStore)
Parameters:
  • selectedStore: Store the store to select.

Set the map instance


DataLayer class

woosmap.layers.DataLayer
This class extends woosmap.layers.BaseLayer.
Constructor
DataLayer(options?)
Parameters:

DataLayer


Methods
displayStores(stores)
Parameters:
  • stores: Store[] the stores to display.

Displays on the map the stores passed as parameter.

displayNumberedStores(stores)
Parameters:
  • stores: Store[] the stores sorted by distance.

Displays the stores with numbered icons.


TiledDataOverlay class

woosmap.layers.TiledDataOverlay
This class extends BaseLayer.

TiledDataOverlay Uses marker vector tiles and displays it using a renderer.

Constructor
TiledDataOverlay(options?)
Parameters:

TiledDataOverlay.


Methods
clear()
Parameters: None

Clears the overlay data and cache.

setMap(map)
Parameters:

Set the map instance

setSearchParameters(searchParameters)
Parameters:

Sets the search parameters used to filter the displayed data.

setSearchQuery(searchQuery)
Parameters:

Sets the searchQuery used to filter the displayed data.

setPolylineFilter(polylineFilter)
Parameters:

Sets the polylineFilter used to filter the displayed data.

onAdd()
Parameters: None
onRemove()
Parameters: None
tileDidLoad(data)
Parameters:

Called when a tile has finished loading

tilesDidLoad()
Parameters: None

Called when all the tiles requested from the api server were fetched.


TiledImageLayer class

woosmap.layers.TiledImageLayer
Constructor
TiledImageLayer(options?)
Parameters:

Constructs a new TiledImageLayer


Methods
setMap(map)
Parameters:
  • map: google.maps.Map the map to set the overlay FIXME: Not sure if it’s the best way of doing this.

Set an overlay to a map with the tiles generated by the tiler server

getMap()
Parameters: None
Return Type: google.maps.Map | null

Returns the google map bound to the image layer.

setSearchParameters(searchParameters)
Parameters:

Sets the search parameters used to filter the displayed data.

setSearchQuery(searchQuery)
Parameters:

Sets the searchQuery used to filter the displayed data.

setPolylineFilter(polylineFilter)
Parameters:

Sets the polylineFilter used to filter the displayed data.


BaseRenderer class

woosmap.layers.renderers.BaseRenderer

Base renderer.

Constructor
BaseRenderer(options)
Parameters:
  • options: Object

Methods
addEventListener(event, listener)
Parameters:
  • event: EventName
  • listener: StoreEventListener

Adds an eventListener triggered when the event is triggered on markers.

setClick(callback)
Parameters:
  • callback: StoreEventListener

Build the click listener with the callback argument

getMap()
Parameters: None
Return Type: google.maps.Map

Getter to access to the map instance

setMap(map)
Parameters:

Set the map instance

displayStores(stores)
Parameters:

Call to display the stores with the basic style

displayNumberedStores(stores)
Parameters:

Call to display the stores with the numbered style

tileDidLoad(data)
Parameters:

Call on each tiles request.

tilesDidLoad()
Parameters: None

Called once all tiles request are finished.

selectStore(selectedStore)
Parameters:
  • selectedStore: Store the store to select.

Use the selected style for the selectedStore

clear()
Parameters: None

Removes all the data and style from the layer.


DefaultRenderer class

woosmap.layers.renderers.DefaultRenderer

Default renderer.

Constructor
DefaultRenderer(options)
Parameters:
  • options: Object

Methods
getMap()
Parameters: None
Return Type: google.maps.Map

Getter to access to the map instance

setMap(map)
Parameters:

Set the map instance

displayStores(stores)
Parameters:

Call to display the stores with the basic style

displayNumberedStores(stores)
Parameters:

Call to display the stores with the numbered style

tilesDidLoad()
Parameters: None

Called once all tiles request are finished.

selectStore(selectedStore)
Parameters:
  • selectedStore: Store the store to select.

Use the selected style for the selectedStore

clear()
Parameters: None

Removes all the data and style from the layer.


MarkersRenderer class

woosmap.layers.renderers.MarkersRenderer
This class extends DefaultRenderer.
Constructor
MarkersRenderer(options)
Parameters:

Markers renderer.


Methods
displayMarkers(features, markers?)
Parameters:

Display the markers of each features

clear()
Parameters: None

Hide the markers and remove the idleListener

setMap(map)
Parameters:

Set the map instance.

getMap()
Parameters: None
Return Type: undefined | google.maps.Map

Return the map instance

getDisplayingMarkers()
Parameters: None
Return Type: google.maps.Marker[]

Return the markers object for the current bounds

getDisplayingFeatures()
Parameters: None
Return Type: Array

Return the features objects for the current bounds

tileDidLoad(geojson)
Parameters:
displayCurrentMarkers()
Parameters: None

Display the markers in the current bounds

displayMarkersForStores(stores)
Parameters:

Display the marker for a stores list

displayStores(stores)
Parameters:

Display the stores list

displayNumberedStores(stores)
Parameters:

Display the stores list with a numbered style

tilesDidLoad()
Parameters: None
selectStore(data)
Parameters:

DirectionsProvider class

woosmap.location.DirectionsProvider
This class extends MVCObject.
Constructor
DirectionsProvider(directionRendererOptions?, googleDirectionsRequestOptions?, directionsRequestErrorCallback?)
Parameters:
  • directionRendererOptions: google.maps.DirectionsRendererOptions options for Google Maps. Deprecated since 1.2 Set options into {DirectionsResultsDisplayer} instead.
  • googleDirectionsRequestOptions: google.maps.DirectionsRequest options for Google Maps.
  • directionsRequestErrorCallback: function callback call if directions request status is not OK. The callback arguments are response (the google response) and status ( StatusCodes ).

Constructs a new DirectionsProvider


Properties
Type: String

This property is observable A link to open google map with the current itinerary

This property is observable An array containing renderer about each route

This property is observable An array containing information about each route

This property is observable

Type: String

This property is observable


Methods
originDestination_changed()
Parameters: None

Triggered when originDestination attribute changed (observer)

selectedTravelMode_changed()
Parameters: None

Triggered when selectedTravelMode attribute changed (observer)

cleanMapFromRoutes()
Parameters: None

Trigger setMap and setPanel with null parameter for each renderer to remove their polyline and panel details

getRouteEncodedPolyline(rendererIndex)
Parameters:
  • rendererIndex: Number
Return Type: string
getDirectionsFromOrToStore()
Parameters: None

Get directions from, or to, store with google directions services and set results in directionsRenderers

route(requestParams, successCallback, failCallback)
Parameters:
  • requestParams: Object
  • successCallback: Function
  • failCallback: Function
Return Type: any
setDirectionsObjectsWithResponse(response)
Parameters:

Set directionsRenderers and directionsSummary objects

getDirectionsLink(origin, destination, travelMode)
Parameters:
  • origin: woosmap.maps.utils.LatLng | null route origin
  • destination: woosmap.maps.utils.LatLng | null route destination
  • travelMode: string | null travelMode for Baidu if needed

Get the direct link to google or baidu directions from the user’s input

getAvailableTravelModes()
Parameters: None
Return Type: any

Gets available travel modes.


DistanceProvider class

woosmap.location.DistanceProvider
This class extends MVCObject.

Constructs a new DistanceProvider. It should be bound to a location property or it needs to be set manually.

Constructor
DistanceProvider(options?)
Parameters:

Constructs a new DistanceProvider. It should be bound to a location property or it needs to be set manually.


Properties

The location to compute a distance from. This property is bindable.


Methods
updateStoresDistanceWithGoogle(stores, user_callback, orderby)
Parameters:
  • stores: Store[] the stores array to be updated
  • user_callback: Function the callback method which will be called with the new store’s array
  • orderby: String should be distance or duration. By default it will use distance.

This method updates or adds the following properties of each stores in the array :

  • duration: the duration in seconds.
  • distance: the distance in meters.
  • duration_text: a String representation of the duration.
  • distance_text: A string representation of the distance value, using the unitSystem specified in the constructor options.

GeocoderSearchSource class

woosmap.location.GeocoderSearchSource
This class extends MVCObject.

GeocoderSearchSource

Constructor
GeocoderSearchSource(geocoderOptions?)
Parameters:

Constructs a new GecoderSearchSource


Properties

When google answer a geocoding requests with only one result, it sets this property. If maxResultsReturn is set to one then google’s answer always set this property. This property is bindable

Type: Array

When google answer a geocoding requests with more than one result, it sets this property. This property is bindable

Type: string

Observes his query to launch the geocoding.


Methods
query_changed()
Parameters: None

Listens the changes of query.

search(query)
Parameters:
  • query: String

Use the google maps geocoder to geocode the query.


LocationProvider class

woosmap.location.LocationProvider
This class extends MVCObject.

Constructs a new LocationProvider, in order to track browser location

Constructor
LocationProvider()
Parameters: None

Constructs a new LocationProvider, in order to track browser location


Properties

When the LocationProvider returns a result it sets this property. This property is bindable


Methods
askForLocation(geoLocationProvider)
Parameters:
  • geoLocationProvider: GeolocationProvider | undefined if provider is undefined or if user refuse geolocation then ip location is used

Set user location given provider.


NearbyStoresSource class

woosmap.location.NearbyStoresSource
This class extends MVCObject.
Constructor
NearbyStoresSource(dataSource, maxStores, maxDistanceFromUser)
Parameters:
  • dataSource: DataSource
  • maxStores: Number maximum number of stores which will be retrieved from data source
  • maxDistanceFromUser: Number the maximum distance from user in meters

Builds a NearbyStoresSource


Properties

The location to search stores from. This property is bindable.

Type: Array

An array of stores. This property is bindable.


Methods
location_changed()
Parameters: None

This method is called when the location has changed.


PlacesSearchSource class

woosmap.location.PlacesSearchSource
This class extends MVCObject.

Constructs a new PlacesSearchSourceAutocompleteRequest can be biased using location, radius or bounds property through the options param

Constructor
PlacesSearchSource(options?, minQuerySize?, searchCallback?)
Parameters:
  • options: google.maps.places.AutocompletionRequest The Google Places AutocompletionRequest
  • minQuerySize: Number if the size of the input is smaller than minQuerySize then no request to googleMap is done (default 0)
  • searchCallback: null | Function Callback to execute after search if set

Constructs a new PlacesSearchSourceAutocompleteRequest can be biased using location, radius or bounds property through the options param


Properties
Type: String

Observes his autocomplete_query to launch the autocomplete.

Type: Number

If autocomplete query change but with a length smaller than minQuerySize then no request to google map is done.

Type: Object

Observes this property to launch configure autocomplete. should comply to google’s specifications See : AutocompletionRequest

Type: Array

When Places returns a prediction list it sets this property. This property is observable

Type: null | Function

Callback to execute after search if needed


Methods
autocomplete_query_changed()
Parameters: None

Listens the changes of autocomplete_query.


Data class

woosmap.maps.data.Data

A layer for displaying geospatial data. Points can be displayed.

Constructor
Data()
Parameters: None

Creates an empty collection.


Methods
add(feature)
Parameters:

Adds the feature passed as parameter.

remove(feature)
Parameters:

Remove the feature passed as parameter.

addGeoJson(geojson, options?)
Parameters:

Adds GeoJSON features to the collection. Give this method a parsed JSON. The imported features are returned. Throws an exception if the GeoJSON could not be imported.

toGeoJson(callback)
Parameters:
  • callback: Function

Exports the features in the collection to a GeoJSON object.

contains(feature)
Parameters:
Return Type: boolean

Checks whether the given feature is in the collection.

forEach(callback)
Parameters:
  • callback: Function

Repeatedly invokes the given function, passing a feature in the collection to the function on each invocation. The order of iteration through the features is undefined.

getFeatureById(id)
Parameters:
  • id: String
Return Type: Feature | null

Returns the feature matching the id.

getMap()
Parameters: None
Return Type: google.maps.Map | BMap.Map

Returns the map on which the features are displayed.

setMap(map)
Parameters:

Renders the features on the specified map. If map is set to null, the features will be removed from the map.

setStyle(style)
Parameters:

Sets the style for all features in the collection. Styles specified on a per-feature basis via overrideStyle() continue to apply. Pass either an object with the desired style options, or a function that computes the style for each feature. The function will be called every time a feature’s properties are updated.

getStyle()
Parameters: None
Return Type: any

Gets the style for all features in the collection.

overrideStyle(feature, style)
Parameters:

Changes the style of a feature. These changes are applied on top of the style specified by setStyle(). Style properties set to null revert to the value specified via setStyle().

revertStyle(feature?)
Parameters:

Removes the effect of previous overrideStyle() calls. The style of the given feature reverts to the style specified by setStyle(). If no feature is given, all features have their style reverted.

addListener(event, callback)
Parameters:
  • event: any
  • callback: Function

Adds a listener for event

trigger(event, eventData)
Parameters:
  • event: String
  • eventData: any

Trigger event listeners.


Feature class

woosmap.maps.data.Feature
Constructor
Feature(featureData)
Parameters:

Methods
getGeometry()
Parameters: None

Returns the feature geometry.

getId()
Parameters: None
Return Type: String

Returns the feature id.

getProperty(name)
Parameters:
  • name: String
Return Type: any

Returns the feature property

removeProperty(name)
Parameters:
  • name: String

Removes property

setProperty(name, newValue)
Parameters:
  • name: String
  • newValue: any
toGeoJson(callback)
Parameters:
  • callback: Function

Exports the feature to a GeoJSON object.


LatLng class

woosmap.maps.geometry.LatLng
Constructor
LatLng(lat, lng)
Parameters:
  • lat: Number the latitude.
  • lng: Number the longitude.

Properties
Type: Number

The latitude.

Type: Number

The latitude.


Methods
toJSON()
Parameters: None
Return Type: LatLngLiteral

LatLngBounds class

woosmap.maps.geometry.LatLngBounds
Constructor
LatLngBounds(ne, sw)

Methods
getNorthEast()
Parameters: None
Return Type: LatLng
getSouthWest()
Parameters: None
Return Type: LatLng
getCenter()
Parameters: None
Return Type: LatLng | null

Computes the center of the latlng bounds.

isEmpty()
Parameters: None
Return Type: Boolean

Checks if the current bounds are empty.

intersects(other)
Parameters:
Return Type: Boolean

Checks if bounds are intersecting with other.

union(other)
Parameters:
contains(latlng)
Parameters:
Return Type: Boolean

Checks if current bounds contain latlng.

extend(point)
Parameters:
Return Type: LatLngBounds

Extends the current bounds with point.

toJSON()
Parameters: None

Returns the bounds as JSON.


Point class

woosmap.maps.geometry.Point
Constructor
Point(x, y)
Parameters:
  • x: Number
  • y: Number

Properties
Type: Number

x coordinate.

Type: Number

y coordinate.


Size class

woosmap.maps.geometry.Size
Constructor
Size(width, height)
Parameters:
  • width: Number
  • height: Number

Properties
Type: Number
Type: Number

F class

woosmap.query.F

Function helper to instantiate a Field, used to form queries.

Constructor
F(key, value, operator?)
Parameters:
  • key: String
  • value: String | Number
  • operator: Operators

Function helper to instantiate a Field, used to form queries.


Field class

woosmap.query.Field

Represents a field filter

Constructor
Field(key, value, operator?)
Parameters:
  • key: String
  • value: String | Number
  • operator: Operators

Methods
toString()
Parameters: None
Return Type: string

Returns the field clause in query format.


Query class

woosmap.query.Query

Represents a Query

Constructor
Query(children, connector, negate)
Parameters:

Methods
toString()
Parameters: None
Return Type: String

Returns the Query as a string usable for the search endpoint query parameter.


SearchParameters class

woosmap.search.SearchParameters
Constructor
SearchParameters(searchParametersOptions?)
Parameters:

Constructs a new SearchParameters


Properties
Type: String

Allowed values for the groupBy parameter.

Bounds in which the search will be performed

Type: woosmap.search.SearchParameters.GroupByValues

Count the stores by group values

Type: Number

Latitude of the position to search nearest stores

Type: Number

Longitude of the position to search nearest stores.

Type: Number

Maximum distance from user (in meter).

Type: Number

Maximum number of stores to return.

Type: Number

The expected page

PolylineFilter to filter on polyline path

Type: Query | Field | String

Query to filter on store’s properties (text, types and tags).

Type: Number

Number of store in one page (default: 100, max: 300)

Type: Boolean

Whether the search should perform an intersection between point and zones.


Methods
buildUrl()
Parameters: None
Return Type: String

Build encoded parameters of an url to search stores (&max_number=3).


SearchQuery class

woosmap.search.SearchQuery
This class extends MVCObject.
Constructor
SearchQuery(querySearchOptions)
Parameters:

Constructs a new SearchQuery


Properties
Type: string

AND query operator

Type: string

OR query operator

Property for text search

Type: String[]

Property for tag search

Type: String[]

Property for type search


Methods
addTagFilter(tagName, operator)
Parameters:
  • tagName: String the tag name
  • operator: Boolean the boolean operator to use in the query.

Adds a tag filter to the query.

addTypeFilter(typeName, operator)
Parameters:
  • typeName: String the type name
  • operator: Boolean the boolean operator to use in the query.

Adds a type filter to the query.

setQuery(queryText, options?)
Parameters:
  • queryText: String the query text
  • options: Object

Sets the query text

addQueryOption(name, operator)
Parameters:
  • name: String the option to add
  • operator: Boolean the boolean operator to use in the query.

Adds a query option

removeQueryOption(name)
Parameters:
  • name: String

Removes a QueryOption by name.


Styler class

woosmap.style.Styler

Styler duty is to style google maps Data Layer

Constructor
Styler(options)
Parameters:

Methods
getStyle()
Parameters: None
Return Type: Style

Returns the the current style.

getDefaultStyle()
Parameters: None
Return Type: StyleRule

Returns the default style.

getMarkerStyleForStore(store, options)
Parameters:
Return Type: google.maps.Icon

Resolves style for the store feature using options.


DirectionsResultsDisplayer class

woosmap.ui.DirectionsResultsDisplayer
This class extends MVCObject.

You must bind directionsLink property to directionsProvider if you want to handle the click button on an object with the CSS class woosmap-mobile-link-button to redirect mobile user on Gmaps app.

Constructor
DirectionsResultsDisplayer(map, summaryTemplate, displayNewRenderersCallback, selectedAndUnselectedRendererOptions)
Parameters:
  • map: google.maps.Map the google map which will display route polyline
  • summaryTemplate: String html template for the route summary
  • displayNewRenderersCallback: Function callback calling after all renderers are set
  • selectedAndUnselectedRendererOptions: SelectedAndUnselectedRendererOptions options for both selected an unselected renderers.

You must bind directionsLink property to directionsProvider if you want to handle the click button on an object with the CSS class woosmap-mobile-link-button to redirect mobile user on Gmaps app.


Methods
displayRouteSteps(rendererIndex)
Parameters:
  • rendererIndex: Number the index of the renderer which contain direction to display

Display route’s steps on panel

cleanRoutes()
Parameters: None

Clean all routes on panel

cleanRouteSteps()
Parameters: None

Clean all route’s step on panel

cleanMapFromRoutes()
Parameters: None

Hide all route’s Polyline on map

displayAllRoutes()
Parameters: None

Display all the route on the map

displayRouteOnMap(rendererIndex)
Parameters:
  • rendererIndex: Number the index of the renderer which contain the route to display

Display a selected route polyline on map

setSelectedRenderer(rendererIndex)
Parameters:
  • rendererIndex: Number the index of the renderer to set options.

Set renderer options to selectedRendererOptions and set others renderers options to unselectedRenderersOptions


InfoBox class

woosmap.ui.InfoBox

Creates an InfoBox with the options specified in InfoBoxOptions. Call InfoBox.open to add the box to the map.

Constructor
InfoBox(opt_opts?)
Parameters:

Creates an InfoBox with the options specified in InfoBoxOptions. Call InfoBox.open to add the box to the map.


Methods
onRemove()
Parameters: None

Invoked when close is called. Do not call it directly.

draw()
Parameters: None

Draws the InfoBox based on the current map projection and zoom level.

setInfoBoxOptions(opt_opts)
Parameters:

Sets the options for the InfoBox. Note that changes to the maxWidth, closeBoxMargin, closeBoxURL, and enableEventPropagation properties have no affect until the current InfoBox is closed and a new one is opened.

setContent(content)
Parameters:
  • content: string | Node

Sets the content of the InfoBox. The content can be plain text or an HTML DOM node.

setPosition(latlng)
Parameters:

Sets the geographic location of the InfoBox.

setZIndex(index)
Parameters:
  • index: number

Sets the zIndex style for the InfoBox.

setVisible(isVisible)
Parameters:
  • isVisible: boolean

Sets the visibility of the InfoBox.

getContent()
Parameters: None
Return Type: string

Returns the content of the InfoBox.

getPosition()
Parameters: None
Return Type: LatLng

Returns the geographic location of the InfoBox.

getZIndex()
Parameters: None
Return Type: number

Returns the zIndex for the InfoBox.

getVisible()
Parameters: None
Return Type: boolean

Returns a flag indicating whether the InfoBox is visible.

show()
Parameters: None

Shows the InfoBox. [Deprecated; use setVisible instead.]

hide()
Parameters: None

Hides the InfoBox. [Deprecated; use setVisible instead.]

open(map, anchor?)
Parameters:
  • map: Map | StreetViewPanorama
  • anchor: MVCObject

Adds the InfoBox to the specified map or Street View panorama. If anchor (usually a google.maps.Marker) is specified, the position of the InfoBox is set to the position of the anchor. If the anchor is dragged to a new location, the InfoBox moves as well.

close()
Parameters: None

Removes the InfoBox from the map.


Events

This event is fired when the DIV containing the InfoBox’s content is attached to the DOM.

This event is fired when the InfoBox’s close box is clicked.

This event is fired when the content of the InfoBox changes.

This event is fired when the position of the InfoBox changes.

This event is fired when the zIndex of the InfoBox changes.


MailView class

woosmap.ui.MailView
This class extends woosmap.utils.DelegateProtocol.

Constructs a new MailView, in order to ask our API endpoint to send a mail for directions

Template example

HTML
        <div>
     <input type="text" placeholder="email" class="woosmap-mail-input"/>
     <button class="woosmap-send-button">Send mail</button>
</div>

    

Delegates

  • mailSending called when mail is in sending state.
  • mailError called when mail is in error state.
  • mailSent called when mail is in sent state.
Constructor
MailView(template, custom_params)
Parameters:
  • template: String The template used to render mail form. It should contain at least two inputs the text input with the class woosmap-mail-input and the send button with woosmap-send-button class
  • custom_params: Object The custom params to pass in return url.

Constructs a new MailView, in order to ask our API endpoint to send a mail for directions


Properties
Type: mailStatus

When the MailView returns a result it sets this property. This property is bindable

Type: String

When the MailView sends an email with directions, it needs to have the currently selected store set in in order to send the proper directions. This property is bindable

Type: Object

Contains all the available status for the MailView. Status states Sent, Sending, Initialized, and Error


Methods
sendDirectionsMail(receiver_mail)
Parameters:
  • receiver_mail: String The mail to send the mail to.

Sends a request to the datastore to send a mail with directions link to the mail provided

getContainer()
Parameters: None
Return Type: any

OriginDestinationInput class

woosmap.ui.OriginDestinationInput
This class extends MVCObject.

Take the template for an Origin Destination Panel and link with an originDestination object

Constructor
OriginDestinationInput(originDestinationPanelTemplate, odInputOptions?)
Parameters:
  • originDestinationPanelTemplate: String template of the origin destination panel
  • odInputOptions: OdInputOptions

Take the template for an Origin Destination Panel and link with an originDestination object


Properties

The location to use to compute the directions.

Type: Store

The selected store. This property is bindable.

Type: boolean

Flag to decide where to put the store name.


Methods
isSelectedStoreName(name)
Parameters:
  • name: String the name which will be compared to selectedStore.name

Return true if the selectedStore has a name equal to the name in parameters

updateOriginDestination()
Parameters: None

Set the originDestination object {origin: **, destination: **} with value containing in woosmap-origin and woosmap-destination input If one name is the same that selectedStore’s name then store position is set instead of the name

setOriginValue(newOriginValue)
Parameters:
  • newOriginValue: String the value to set

Set the value of woosmap-origin input

setDestinationValue(newDestinationValue)
Parameters:
  • newDestinationValue: String the value to set

Set the value of woosmap-destination input

getOriginValue(useLatLng?)
Parameters:
  • useLatLng: boolean if param is set to true and the selectedStore is the origin store then return lat,lng instead of input value

Get the value of woosmap-origin input return selectedStore position is value is the same tha store name

getDestinationValue(useLatLng?)
Parameters:
  • useLatLng: boolean if param is set to true and the selectedStore is the destination store then return lat,lng instead of input value

Get the value of woosmap-destination input return selectedStore position is value is the same tha store name

onKeyUp(event)
Parameters:
  • event: Event

Method called when keyUp on origin or destination input

selectedStore_changed()
Parameters: None

Method called when selectedStore changed

location_changed()
Parameters: None

Method called when location changed

getODContainer()
Parameters: None

Return the container instantiated with origin-destination panel


SearchView class

woosmap.ui.SearchView
This class extends woosmap.utils.DelegateProtocol.

Constructs a SearchView

  • didSearchClear is called when the search query is validated.
Constructor
SearchView(searchViewOptions?)
Parameters:

Constructs a SearchView

  • didSearchClear is called when the search query is validated.

Methods
setupInteraction()
Parameters: None

Setups the interactions with the input, button, and clear button

setSearchQueryWithInputValue(property)
Parameters:
  • property: String

Sets the query property with the value of the input.

clearResults()
Parameters: None

Method called when searchView need to clear its results.

clearInput()
Parameters: None

Method called when searchView need to clear its input.

getContainer()
Parameters: None
Return Type: any
locationResults_changed()
Parameters: None

Method called when locationResults changed.When changed is trigger searchView will display location results into resultSelector container.

getResultsSelector()
Parameters: None
Return Type: any

Return resultsSelector container.


TableView class

woosmap.ui.TableView
This class extends MVCObject.

Constructs a new TableView

TableView container

HTML
        <div class="woosmap-tableview-container"></div>

    

TableView Store Cell template example

HTML
        <div>{{name}}</div>
<a class="title">{{name}}</a><br/>
<small class="quiet">{{address.city}}</small>
<div>{{address.lines}} {{address.city}} {{address.zip}}</div>
<div>Tel : <a href="tel:{{phone}}">{{phone}}</a></div>

    

TableView Places Cell template example

HTML
        <div>{{description}}</div>

    

If a card is selected its container will bear woosmap-tableview-selected-cell class. If a card is highlighted using arrow keys, its container will bear woosmap-tableview-highlighted-cell class.

Constructor
TableView(templates, placesSearchSource?)
Parameters:
  • templates: Object should contain two templates accessible through keys “cell_store” and “cell_place”. Store’s template can also use deprecated key “cell”
  • placesSearchSource: PlacesSearchSource the placesSearchSource instance to use for getDetails.

Constructs a new TableView


Properties
Type: Object

When user selects a places prediction it sets this property with places details This property is observable

Type: Object

When user click on a Places cell, it sets this property This property is observable

Type: Array

An array of Places predictions. This property is bindable.

Type: Object

When user click on a Store cell, it sets this property This property is observable

Type: Array

An array of stores. This property is bindable.


Methods
setupInteraction()
Parameters: None

Setups the interactions with the keyboard

selectedStore_changed()
Parameters: None

When the selectedStore changes select the right cell in the table view. If the table view cell is not visible then scroll the list to render it visible.

scrollToCell($cell)
Parameters:
  • $cell: jQuery

Scrolls the table view to show the $cell

stores_changed()
Parameters: None

When the stores list changes update the table view accordingly.

predictions_changed()
Parameters: None

When the predictions list changes update the table view accordingly.

getContainer()
Parameters: None
Return Type: any

Returns the container of the TableView.

update()
Parameters: None

Displays the stores by rendering a cell for each store.

setStoresTemplate(storesTemplate)
Parameters:
  • storesTemplate: string new templates for stores cells.

Set new template for stores cells.

setPlacesTemplate(placesTemplate)
Parameters:
  • placesTemplate: string new templates for places cells.

Set new template for places cells.

setOnCellCreatedCallback(callback)
Parameters:
  • callback: function function call by the tableView. Params of the callback are store_container a jquery object which contain cell’s html and storeData a json containing the data of the store.

Set a function to be called by the tableView after the rendering of the cells.


TravelModeSelector class

woosmap.ui.TravelModeSelector
This class extends MVCObject.

Take the template of travelModePanel to generate an object

Constructor
TravelModeSelector(travelModeSelectionPanelTemplate)
Parameters:
  • travelModeSelectionPanelTemplate: string template of the travel mode pane

Take the template of travelModePanel to generate an object


Methods
initializedTravelModeChoice()
Parameters: None

Initialized comportement of travel mode panel’s objects

getSelectorContainer()
Parameters: None

Return the container instantiated with travel mode panel


DelegateProtocol class

woosmap.utils.DelegateProtocol
This class extends MVCObject.
Constructor
DelegateProtocol()
Parameters: None

Constructs a new DelegateProtocol


Properties
Type: Object

The delegate object.


Methods
callDelegateMethod(methodName)
Parameters:
  • methodName: String the method to call.
Return Type: DelegateReturn

Calls the method methodName on the delegate.


DelegateReturn class

woosmap.utils.DelegateReturn
This class extends MVCObject.
Constructor
DelegateReturn()
Parameters: None

Builds a delegate return value.


Methods
or(defaultValue)
Parameters:
  • defaultValue: any
Return Type: any

Returns defaultValue when the delegate was not called. Else return the delegate return value.


MVCObject class

woosmap.utils.MVCObject

Constructor for MVCObject.

Constructor
MVCObject()
Parameters: None

Constructor for MVCObject.


Methods
bindTo(key, target, target_key?, notify?)
Parameters:
  • key: string the property to be bound
  • target: object the object to bind to
  • target_key: string optional the name of the property on the target, if different from the name of the property on the observer
  • notify: boolean optional do not call _changed callback upon binding
Return Type: void

Binds the property identified by ‘key’ to the specified target.

isPropertyBound(key)
Parameters:
  • key: string the property to set
Return Type: boolean

Is this property a complex object - is it bound as either observer or target

get(key)
Parameters:
  • key: string the property to fetch
Return Type: mixed

Returns the value of the property specified by ‘key’

set(key, value, force_callback?)
Parameters:
  • key: string the name of the property to set
  • value: mixed the new value of the property identified by ‘key’
  • force_callback: boolean optional call callbacks, regardless of whether the value has changed or not.
Return Type: void

Sets ‘value’ to ‘key’ on ‘this’.

setValues(key_value_pairs)
Parameters:
  • key_value_pairs: object an object containing ‘key’ => ‘value’ of properties to change
Return Type: void

Set all the values of the properties contained in ‘key_value_pairs’

unbind(key)
Parameters:
  • key: string
Return Type: void

Un-bind the property identified by ‘key’ from its current target

unbindAll()
Parameters: None
Return Type: void

Unbind all bound properties on this object


Address Interface

Address

Properties
Type: String
Type: String[]

the address lines.

Type: String

BaiduDirectionsRouteParams Interface

BaiduDistance Interface

Properties
Type: string

A string representation of the distance value.

Type: number

The distance in meters.


BaiduDuration Interface

Properties
Type: string

A string representation of the duration value.

Type: number

The duration in seconds.


BaiduMapsOptions Interface

Type: object
Properties
Type: BMap.MapStyle

Baidu Map Style


BaiduPolylineOptions Interface

BaiduPolylineOptions

Properties
Type: BMap.Map

Map on which to display Polyline.

Type: BMap.Point[]

The ordered sequence of coordinates of the Polyline

Type: string
Type: number | string
Type: string
Type: number

BaseViewOptions Interface

Properties
Type: Style
Type: Number

BoundsPadding Interface

BoundsPadding All properties values are expected to be in pixels.

Properties
Type: Number
Type: Number
Type: Number
Type: Number

Contact Interface

Contact

Properties
Type: String

the location email contact.

Type: String

the location phone.

Type: String

the location website.


DataLayerOptions Interface

Properties
Type: Styler

DataStyle Interface

Properties

deprecated marker style format used in BaseView.

Type: Style

DeprecatedStyleRule Interface

Properties
Type: String

base url for the marker icon.

Type: String

base url for the marker icon in its selected state.

Type: String

the type for which the rules applies. Use default to define the default style.


DirectionsRouteInformationsParams Interface

Properties
Type: number

distance

Type: String

durationInTrafficLong

Type: number

durationInTrafficShort

Type: String

durationLong

Type: number

durationShort

Type: number

rendererIndex

Type: String

summary

Type: String

travelMode


EventListeners Interface

Properties

event handler function for click google maps event.

event handler function for mousedown google maps event.

event handler function for mouseout google maps event.

event handler function for mouseover google maps event.

event handler function for mouseup google maps event.


EventName Interface

Type: String

EventName EventName should be one of the following: click, mousedown, mouseout, mouseover, mouseup.

FeatureData Interface

FeatureData

Properties
Type: String | Number
Type: Object

GeoJSON Interface

GeoJSON

Properties
Type: Store[]

GeocoderOptions Interface

Properties

The function to call when a geocoder error occurs. Google Maps only

Type: Number

Maximum number of geocoding results return by the geocoder. If google find more result then only the N first results will be returned.


Geometry Interface

Geometry

Properties
Type: Number[]

WGS84 longitude, latitude.


GoogleGeocoderErrorCallback Interface

Type: Function

The function to call when a google geocoder error occurs.

Function
GoogleGeocoderErrorCallback(status)
Parameters:

The function to call when a google geocoder error occurs.


JSONPOptions Interface

Properties
Type: String

callback prefix (defaults to __jp)

Type: String

parameter (defaults to callback)

Type: Number

how long after the request until a timeout error is emitted (defaults to 15000)


LatLngLiteral Interface

Location

Properties
Type: Number

the latitude.

Type: Number

the longitude.


LoadOptions Interface

Properties
Type: Function
Type: Boolean
Type: String
Type: Object
Type: String

MapsLoaderOptions Interface

MapsLoaderOptions example

JavaScript
        var mapsOptions = {
   clientId: "a_client_id",
   librariesToLoad: ["places"],
   channelId: "a_channel_id",
   language: "fr",
   region: "FR"
   version: "3.26"
}

    
Properties
Type: String

is a string to track usage across different applications using the same client ID

Type: string

the google client id.

Type: String

a google maps api key.

Type: String

desired for google maps api

Type: Array

a list of String containing additional google libraries to load.

Type: String

desired for google maps api

Type: String

desired for google maps api


MarkerStyleOptions Interface

NearbyOptions Interface

Properties
Type: Number

the maximum distance allowed between the user and a store.

Type: Number

the maximum number of stores to return


OdInputOptions Interface

Properties
Type: String

Text to display in input field after geolocation


OriginDestination Interface

Properties
Type: String
Type: String

PolylineFilter Interface

Properties
Type: String

a polyline encoded to the google format

Type: Number

max distance to retrieve store from the polyline (in meter). Default value is 10000


RendererOptions Interface

Properties
Type: StoreEventListener

The click callback.

Type: Styler

SearchParametersOptions Interface

Properties

Bounds in which the search will be performed

Type: woosmap.search.SearchParameters.GroupByValues

Aggregate stores by type or tag. Only available when using DataSource.countStoresByParameters method

Type: Number

latitude of the position to search nearest stores.

Type: Number

longitude of the position to search nearest stores.

Type: Number

maximum distance from user (in meter).

Type: Number

maximum number of stores to return (deprecated use pagination instead).

Type: Number

the request page

to filter on polyline path.

Type: Query | Field | String

search query that replaces the searchTextOptions.

options to filter on store’s text properties.

Type: Number

the number of store by page (default:100, max:300)

Type: Boolean

whether the search should perform an intersection between point and zones.


SelectedAndUnselectedRendererOptions Interface

Properties

options for selected renderer.

options for unselected renderers.


Store Interface

Store

Properties
Type: Address

the Store address

Type: Contact

the contact information.

Type: Geometry

The geometry associated to this store

Type: String

the store name.

Type: String

the unique Id for this store.

Type: String[]

the store tags.

Type: String[]

the store types.

Type: Object

user definied properties


StoreEventCallback Interface

Type: Function

The marker parameter is only valued when the event is generated from a MarkersRenderer.

Function
StoreEventCallback(store, marker?)
Parameters:
  • store: Store the store data that generated the event.
  • marker: google.maps.Marker the marker object associated, valued only when using

The marker parameter is only valued when the event is generated from a MarkersRenderer.


Style Interface

Style Example

JavaScript
        {
    rules: [
        {
            type: 'value1',
            icon: {url: 'http://url/img/marker1.png'},
            selectedIcon: {url: 'http://url/img/marker1-selected.png'}
        },
        {
            type: 'value2',
            icon: {url: 'http://url/img/marker2.png'},
            selectedIcon: {url: 'http://url/img/marker2-selected.png'}
        }
    ],
    default: {
        icon: {url: 'http://url/img/marker.png'},
        numberedIcon: {url: 'http://url/img/{number}.png'},
        selectedIcon: {url: 'http://url/img/selected.png'}
    }
}

    
Properties
Type: StyleRule

the default styling rules, applies when no typed rule matched.

Type: StyleRule[]

the typed rules, each rule bears a store type, the last one matching prevails.


StyleRule Interface

Properties
Type: String

a store type that controls the rule application.


TileStyle Interface

TileStyle Object specifications.

Properties
Type: String

a color rgba formatted

Type: Number

the minimum size acceptable for the marker.

Type: Number

the size of the marker in pixels, between 1 and 16.

Type: TypesRules[]

rules to display different color depending of types. Two different rules cannot be applied to the same store. In case of conflict the latest type in the array win. If a store has no rule, the default type is apply.

Type: Number

the timestamp at which the data was updated.


TiledImageLayerOptions Interface

TiledImageLayerOptions

Properties

the map where the layer will be displayed.

Type: Number

the layer will be visible between 0 and maxZoom.

Type: TileStyle

object that contains style parameters for the current layer.


TiledOverlayOptions Interface

Properties
Type: Number

Deprecated - use searchParameters

Deprecated - use searchParameters


TiledViewOptions Interface

TiledViewOptions

Properties
Type: Number

the zoom level to change the representation.

Type: Boolean

when gentleCenter is true the view will center on the selectedStore only if it’s not already in the padded zone.

the renderer used to display search results.

Type: Boolean

sets the paddedStoreCenter

a polylineFilter to filter stores.

Deprecated - use searchParameters. a searchQuery to filter stores.

Type: Style

the style for the tiled vector layer.

Type: TileStyle

the style for the tiled image layer.

the renderer used to display vector tiles.


TrafficLayerOptions Interface

Properties
Type: boolean

Whether the traffic layer refreshes with updated information automatically. This is true by default.

Map on chich to display the traffic layer.


TypesRules Interface

TypesRules Object specifications.

Properties
Type: String

a color rgba formatted

Type: String

of a store

Type: Number

the zIndex priority of the points


createMapOptions Interface

Properties
Type: LatLng

Zoom center.

Type: boolean

Enable scroll wheel zoom with Baidu.

Type: Number

If set and positive, set zoom level.


QuerySearchOptions Interface

Example value

JavaScript
        var querySearchOptions = {
  'query': {
    'value': 'string to search',
    'options': {
      'name': SearchQuery.OR,
      'city': SearchQuery.AND
    }
  },
  'tags': [{
    'value': 'a tag name',
    'operator': SearchQuery.OR
  }],
  'types': [{
    'value': 'a type name', 'operator': SearchQuery.AND
  }]
}

    
Properties

search string and its options.

Type: String[]

a list of tags object

Type: String[]

a list of types object


TextSearchQuery Interface

Example value

JavaScript
        var textSearchQuery = {
  'value': 'string to search',
  'options': {
    'name': SearchQuery.OR,
    'city': SearchQuery.AND
  }
}

    
Properties
Type: Object

keys are the attributes of the store where the search will be performed, attached value are operator that will be used. Attributes can be name, city, and idstore. Operators can be SearchQuery.AND, and SearchQuery.OR

Type: String

the text to be searched.


InfoBoxOptions Interface

This object represents the optional parameter passed to the InfoBox constructor.

Properties
Type: boolean

Align the bottom left corner of the InfoBox to the position location (default is false which means that the top left corner of the InfoBox is aligned).

Type: string

The name of the CSS class defining the styles for the InfoBox container.

Type: Object

An object literal whose properties define specific CSS style values to be applied to the InfoBox. Style values defined here override those that may be defined in the boxClass style sheet. If this property is changed after the InfoBox has been created, all previously set styles (except those defined in the style sheet) are removed from the InfoBox before the new style values are applied.

Type: string

The CSS margin style value for the close box. The default is “2px” (a 2-pixel margin on all sides).

Type: string

The URL of the image representing the close box. Note: The default is the URL for Google’s standard close box. Set this property to “” if no close box is required.

Type: string | Node

The content of the InfoBox (plain text or an HTML DOM node).

Type: boolean

Disable auto-pan on open.

Type: boolean

Propagate mousedown, mousemove, mouseover, mouseout, mouseup, click, dblclick, touchstart, touchend, touchmove, and contextmenu events in the InfoBox (default is false to mimic the behavior of a google.maps.InfoWindow). Set this property to true if the InfoBox is being used as a map label.

Type: Size

Minimum offset (in pixels) from the InfoBox to the map edge after an auto-pan.

Type: boolean

Hide the InfoBox on open. [Deprecated in favor of the visible property.]

Type: number

The maximum width (in pixels) of the InfoBox. Set to 0 if no maximum.

Type: string

The pane where the InfoBox is to appear (default is “floatPane”). Set the pane to “mapPane” if the InfoBox is being used as a map label. Valid pane names are the property names for the google.maps.MapPanes object.

Type: Size

The offset (in pixels) from the top left corner of the InfoBox (or the bottom left corner if the alignBottom property is true) to the map pixel corresponding to position.

Type: LatLng

The geographic location at which to display the InfoBox.

Type: boolean

Show the InfoBox on open.

Type: number

The CSS z-index style value for the InfoBox. Note: This value overrides a zIndex setting specified in the boxStyle property.


SearchViewOptions Interface

Template sample

HTML
        <div>
     <input class="woosmap-search-input"/>
     <span class="woosmap-search-clear"></span>
     <span class="woosmap-my-location-button">My location</span>
     <button class="woosmap-search-button">Search</button>
<div>

    

CSS classes purpose

  • woosmap-search-input The input used to fill the search query
  • woosmap-search-clear The element used to clear the search input
  • woosmap-search-button The element used to trigger the search on click.
  • woosmap-my-location-button The element used to trigger geolocation based search

Additionaly the search is triggered when the search input is validated (ie: Enter key is pressed).

Location template sample

HTML
        <div>
     {{formattedAddress}}
</div>

    
Properties
Type: string

text to display on input field after a geolocation

Type: string

location results template.

Type: string

Search input template.


ControlPosition Enum

Allowed values for control position.

Constants

Position control to the very bottom left of the map (alongside google watermark).

Position control to the very bottom right of the map (alongside google watermark).

Position control to the bottom left of the map.

Position control to the bottom right of the map.

Position control to the top left of the map.

Position control to the top right of the map.


BoolOperators Enum

Represents Query Boolean operators.

Constants

And boolean operator

Not boolean operator

Or boolean operator


Operators Enum

Represents Query operators.

Constants

Greater-than operator

Greater-than or equal-to operator

Less-than-or-equal-to operator

Less-than-or-equal-to operator


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