JS API v 1.4
Javascript Store Locator API Reference v 1.4Loader class
LoaderConstructs 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.BaseViewMVCObject.
| Constructor |
BaseView()Parameters:
None
Constructs a new BaseView
|
| Properties | |
|
Type:
LatLngLiteralThe user defined location. This property is bindable. | |
|
Type:
google.maps.MarkerThis marker is positioned on the map when | |
|
Type:
BoundsPaddingControls the viewport padding used by fitBounds. | |
|
Type:
StoreThe 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 | |
fitBounds(bounds, padding?)Parameters:
Sets the viewport to contain the given bounds.
Takes in account the | |
enableZoom(activate)Parameters:
Enable or Disable zoom when select a store | |
enablePan(activate)Parameters:
Enable or Disable pan when select a store | |
enablePaddedStoreCenter(activate)Parameters:
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 | |
getDataBounds()Parameters:
None
Return Type:
google.maps.LatLngBoundsProcess each feature in the dataLayer to compute the bounds of the displayed data. | |
getMap()Parameters:
None
Return Type:
google.maps.MapReturns the google maps used by the BaseView. | |
removeAllStores()Parameters:
None
Removes all the stores from the map. | |
displayStore(store)Parameters:
Adds a single store to the map, zoom + pan on it | |
location_changed()Parameters:
None
This function is called when | |
addListener(eventName, callback)Parameters:
Return Type:
StoreEventListenerAdds a store event listener. | |
removeListener(storeEventListener)Parameters:
Removes a store event listener. | |
DataSearchSource class
woosmap.DataSearchSourcewoosmap.utils.MVCObject.
Constructs a new DataSearchSource
| Constructor |
DataSearchSource(dataSource, searchTextOptions, nearbyOptions, polylineFilter?)Parameters:
Constructs a new DataSearchSource |
| Properties | |
|
Type:
stringObserves his query to launch the search into store’s data. | |
|
Type:
LatLngLiteralObserves his location to narrow the search around a location. Needs to be completed with a maxStore and a maxDistanceFromUser in constructors option nearbyOptions | |
|
Type:
SearchParametersContains 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:
Updated the searchQuery value. | |
updateSearchQueryAndSearch(key, value)Parameters:
Updated the searchQuery value and launch a search with the new value. | |
addFieldToSearchTextOptions(fieldName, operator)Parameters:
Add a new field to searchTextOptions or update an existing field (new field will be used for store filtering). | |
removeFieldFromSearchTextOptions(fieldName)Parameters:
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:
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 | |
setMaxStores(maxStores)Parameters:
Update the maxStores value.To remove the search option set is value to | |
setMaxDistanceFromUser(maxDistanceFromUser)Parameters:
Update the maxDistanceFromUser value.To remove the search option set is value to | |
DataSource class
woosmap.DataSource| Constructor |
DataSource(api_url?, api_key?)Parameters:
The DataSource object is the bridge to the server API. |
| Methods | |
getFromApi(url, callback)Parameters:
Make an ajax call with the url and call the callback if success | |
getAllStores(callback)Parameters:
Return Type:
PromiseReturns all the stores. | |
getNearbyStores(lat, lng, callback, maxStores, maxDistanceFromUser)Parameters:
Return Type:
PromiseFetches stores that are near the (lng, lat) position and pass it to the callback.
if | |
getStoreById(store_id, callback)Parameters:
Return Type:
PromiseFetches a store by its store_id. | |
getStoresBySearchQuery(query, callback)Parameters:
Return Type:
PromiseFetches stores that name matches the search query and pass it to the callback. | |
searchStores(searchQuery, callback)Parameters:
Return Type:
PromiseFetches stores that matches the search query and pass it to the callback. | |
searchNearbyStores(searchQuery, lat, lng, callback, maxStores, maxDistanceFromUser)Parameters:
Return Type:
PromiseFetches nearby stores that matches the search query and pass it to the callback. | |
searchStoresByParameters(searchParameters, callback)Parameters:
Return Type:
PromiseSearch on store given a list of information | |
countStoresByParameters(searchParameters, callback)Parameters:
Return Type:
Promisereturn the number of stores matching parameters | |
storesBoundsByParameters(searchParameters, callback)Parameters:
Return Type:
Promisereturn the bounds for all stores matching parameters | |
getProjectConfig(callback)Parameters:
Return Type:
PromiseGet the config object for the Project. | |
LocatorWindow class
woosmap.LocatorWindowwoosmap.utils.MVCObject.
| Constructor |
LocatorWindow(map, renderer, infoBoxOptions?)Parameters:
Construct a LocatorWindow. |
| Properties | |
|
Type:
StoreThe currently | |
| 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:
Return Type:
google.maps.MVCObjectComputes the Window anchor for | |
getMarkerForCoordinates(coordinates)Parameters:
Return Type:
google.maps.MarkerReturn a marker for | |
openOn(store)Parameters:
Opens the info window on the | |
close()Parameters:
None
Closes the Locatorwindow | |
setOpeningCallback(openingCallback?)Parameters:
Adds a listener for | |
setInfoBoxOptions(options?)Parameters:
Method to set InfoboxOptions if it’s not a google InfoWindow | |
MapsLoader class
woosmap.MapsLoader| Constructor |
MapsLoader(clientIdOrOptions?, librariesToLoad?)Parameters:
Construct a MapsLoader instance |
| Methods | |
load(callback)Parameters:
Loads the google maps api and calls the callback when done. | |
TemplateRenderer class
woosmap.TemplateRendererConstructs a TemplateRendererInstance
| Constructor |
TemplateRenderer(template)Parameters:
Constructs a TemplateRendererInstance |
| Methods | |
render(properties?)Parameters:
Return Type:
anyRenders the compiled template with the context | |
registerLambda(name, lambda)Parameters:
Registers a template Lambda | |
TiledView class
woosmap.TiledViewBaseView.
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 | |
setSearchQuery(searchQuery)Parameters:
Sets the | |
setPolylineFilter(polylineFilter)Parameters:
Sets the | |
View class
woosmap.Viewwoosmap.BaseView.
Constructs a View
| Constructor |
View(map, markersOrOptions?, zoomLevel?)Parameters:
|
ZipCodeProvider class
woosmap.ZipCodeProviderwoosmap.utils.MVCObject.
Constructs a new ZipCodeProvider
| Constructor |
ZipCodeProvider()Parameters:
None
Constructs a new ZipCodeProvider |
| Properties | |
|
Type:
LatLngLiteralThe | |
|
Type:
stringStores the | |
| Methods | |
getZipCode()Parameters:
None
Return Type:
stringGet the currently saved zipcode | |
getZipCodeType()Parameters:
None
Return Type:
stringGet 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:
BaseLayer. |
| Methods | |
setHidden(isHidden)Parameters:
Set the visibility of the data | |
getHidden()Parameters:
None
Return Type:
BooleanGetter to access to the visibility state | |
selectStore(selectedStore)Parameters:
Set the map instance | |
DataLayer class
woosmap.layers.DataLayerwoosmap.layers.BaseLayer.
| Constructor |
| Methods | |
displayStores(stores)Parameters:
Displays on the map the stores passed as parameter. | |
displayNumberedStores(stores)Parameters:
Displays the stores with numbered icons. | |
TiledDataOverlay class
woosmap.layers.TiledDataOverlayBaseLayer.
TiledDataOverlay Uses marker vector tiles and displays it using a renderer.
| Constructor |
| Methods | |
clear()Parameters:
None
Clears the overlay data and cache. | |
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
| |
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:
Set an overlay to a map with the tiles generated by the tiler server | |
getMap()Parameters:
None
Return Type:
google.maps.MapReturns 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.BaseRendererBase renderer.
| Constructor |
BaseRenderer(options)Parameters:
|
| Methods | |
addEventListener(event, listener)Parameters:
Adds an eventListener triggered when the event is triggered on markers. | |
setClick(callback)Parameters:
Build the click listener with the callback argument | |
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:
Use the | |
clear()Parameters:
None
Removes all the data and style from the layer. | |
DefaultRenderer class
woosmap.layers.renderers.DefaultRendererwoosmap.layers.renderers.BaseRenderer.
Default renderer.
| Constructor |
DefaultRenderer(options)Parameters:
|
| Methods | |
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:
Use the | |
clear()Parameters:
None
Removes all the data and style from the layer. | |
MarkersRenderer class
woosmap.layers.renderers.MarkersRendererDefaultRenderer.
| Constructor |
| Methods | |
displayMarkers(features, markers?)Parameters:
Display the markers of each features | |
clear()Parameters:
None
Hide the markers and remove the idleListener | |
getDisplayingMarkers()Parameters:
None
Return Type:
google.maps.Marker[]Return the markers object for the current bounds | |
getDisplayingFeatures()Parameters:
None
Return Type:
ArrayReturn the features objects for the current bounds | |
tileDidLoad(geojson)Parameters:
| |
displayCurrentMarkers()Parameters:
None
Display the markers in the current bounds | |
displayNumberedStores(stores)Parameters:
Display the stores list with a numbered style | |
tilesDidLoad()Parameters:
None
| |
selectStore(data)Parameters:
| |
DirectionsProvider class
woosmap.location.DirectionsProviderMVCObject.
| Constructor |
DirectionsProvider(directionRendererOptions?, googleDirectionsRequestOptions?, directionsRequestErrorCallback?)Parameters:
Constructs a new DirectionsProvider |
| Properties | |
|
Type:
StringThis property is observable A link to open google map with the current itinerary | |
|
Type:
google.maps.DirectionsRenderer[]This property is observable An array containing renderer about each route | |
|
This property is observable An array containing information about each route | |
|
Type:
LatLngLiteralThis property is observable | |
|
Type:
StringThis 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:
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:
Return Type:
any | |
setDirectionsObjectsWithResponse(response)Parameters:
Set directionsRenderers and directionsSummary objects | |
getDirectionsLink(origin, destination, travelMode)Parameters:
Get the direct link to google or baidu directions from the user’s input | |
getAvailableTravelModes()Parameters:
None
Return Type:
anyGets available travel modes. | |
DistanceProvider class
woosmap.location.DistanceProviderMVCObject.
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 | |
|
Type:
LatLngLiteralThe location to compute a distance from. This property is bindable. | |
| Methods | |
updateStoresDistanceWithGoogle(stores, user_callback, orderby)Parameters:
This method updates or adds the following properties of each
| |
GeocoderSearchSource class
woosmap.location.GeocoderSearchSourceMVCObject.
GeocoderSearchSource
| Constructor |
GeocoderSearchSource(geocoderOptions?)Parameters:
Constructs a new GecoderSearchSource |
| Properties | |
|
Type:
LatLngLiteralWhen 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:
ArrayWhen google answer a geocoding requests with more than one result, it sets this property. This property is bindable | |
|
Type:
stringObserves his query to launch the geocoding. | |
| Methods | |
query_changed()Parameters:
None
Listens the changes of query. | |
search(query)Parameters:
Use the google maps geocoder to geocode the query. | |
LocationProvider class
woosmap.location.LocationProviderMVCObject.
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 | |
|
Type:
LatLngLiteralWhen the LocationProvider returns a result it sets this property. This property is bindable | |
| Methods | |
askForLocation(geoLocationProvider)Parameters:
Set user location given provider. | |
NearbyStoresSource class
woosmap.location.NearbyStoresSourceMVCObject.
| Constructor |
NearbyStoresSource(dataSource, maxStores, maxDistanceFromUser)Parameters:
Builds a NearbyStoresSource |
| Properties | |
|
Type:
LatLngLiteralThe location to search stores from. This property is bindable. | |
|
Type:
ArrayAn 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.PlacesSearchSourceMVCObject.
Constructs a new PlacesSearchSourceAutocompleteRequest can be biased using location, radius or bounds property through the options param
| Constructor |
PlacesSearchSource(options?, minQuerySize?, searchCallback?)Parameters:
Constructs a new PlacesSearchSourceAutocompleteRequest can be biased using location, radius or bounds property through the options param |
| Properties | |
|
Type:
StringObserves his autocomplete_query to launch the autocomplete. | |
|
Type:
NumberIf autocomplete query change but with a length smaller than minQuerySize then no request to google map is done. | |
|
Type:
ObjectObserves this property to launch configure autocomplete. should comply to google’s specifications See : AutocompletionRequest | |
|
Type:
ArrayWhen Places returns a prediction list it sets this property. This property is observable | |
|
Type:
nullCallback to execute after search if needed | |
| Methods | |
autocomplete_query_changed()Parameters:
None
Listens the changes of autocomplete_query. | |
Data class
woosmap.maps.data.DataA layer for displaying geospatial data. Points can be displayed.
| Constructor |
Data()Parameters:
None
Creates an empty collection. |
| Methods | |
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:
Exports the features in the collection to a GeoJSON object. | |
contains(feature)Parameters:
Return Type:
booleanChecks whether the given feature is in the collection. | |
forEach(callback)Parameters:
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:
Return Type:
FeatureReturns the feature matching the id. | |
getMap()Parameters:
None
Return Type:
google.maps.MapReturns 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 | |
getStyle()Parameters:
None
Return Type:
anyGets 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 | |
revertStyle(feature?)Parameters:
Removes the effect of previous | |
addListener(event, callback)Parameters:
Adds a listener for event | |
trigger(event, eventData)Parameters:
Trigger event listeners. | |
Feature class
woosmap.maps.data.Feature| Constructor |
Feature(featureData)Parameters:
|
| Methods | |
getGeometry()Parameters:
None
Return Type:
google.maps.LatLngReturns the feature geometry. | |
getId()Parameters:
None
Return Type:
StringReturns the feature id. | |
getProperty(name)Parameters:
Return Type:
anyReturns the feature property | |
removeProperty(name)Parameters:
Removes property | |
setProperty(name, newValue)Parameters:
| |
toGeoJson(callback)Parameters:
Exports the feature to a GeoJSON object. | |
LatLng class
woosmap.maps.geometry.LatLng| Constructor |
LatLng(lat, lng)Parameters:
|
| Properties | |
|
Type:
NumberThe latitude. | |
|
Type:
NumberThe latitude. | |
| Methods | |
LatLngBounds class
woosmap.maps.geometry.LatLngBounds| Constructor |
LatLngBounds(ne, sw)Parameters:
|
| Methods | |
isEmpty()Parameters:
None
Return Type:
BooleanChecks if the current bounds are empty. | |
intersects(other)Parameters:
Return Type:
BooleanChecks if bounds are intersecting with other. | |
union(other)Parameters:
| |
contains(latlng)Parameters:
Return Type:
BooleanChecks if current bounds contain latlng. | |
extend(point)Parameters:
Return Type:
LatLngBoundsExtends the current bounds with point. | |
Point class
woosmap.maps.geometry.Point| Constructor |
Point(x, y)Parameters:
|
| Properties | |
|
Type:
Numberx coordinate. | |
|
Type:
Numbery coordinate. | |
Size class
woosmap.maps.geometry.Size| Constructor |
Size(width, height)Parameters:
|
| Properties | |
|
Type:
Number | |
|
Type:
Number | |
F class
woosmap.query.FFunction helper to instantiate a Field, used to form queries.
| Constructor |
F(key, value, operator?)Parameters:
Function helper to instantiate a Field, used to form queries. |
Field class
woosmap.query.FieldRepresents a field filter
| Constructor |
Field(key, value, operator?)Parameters:
|
| Methods | |
toString()Parameters:
None
Return Type:
stringReturns the field clause in query format. | |
Query class
woosmap.query.QueryRepresents a Query
| Constructor |
Query(children, connector, negate)Parameters:
|
| Methods | |
toString()Parameters:
None
Return Type:
StringReturns 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:
StringAllowed values for the groupBy parameter. | |
|
Bounds in which the search will be performed | |
|
Type:
woosmap.search.SearchParameters.GroupByValuesCount the stores by group values | |
|
Type:
NumberLatitude of the position to search nearest stores | |
|
Type:
NumberLongitude of the position to search nearest stores. | |
|
Type:
NumberMaximum distance from user (in meter). | |
|
Type:
NumberMaximum number of stores to return. | |
|
Type:
NumberThe expected page | |
|
Type:
PolylineFilterPolylineFilter to filter on polyline path | |
|
Type:
SearchQueryQuery to filter on store’s properties (text, types and tags). | |
|
Type:
NumberNumber of store in one page (default: 100, max: 300) | |
|
Type:
BooleanWhether the search should perform an intersection between point and zones. | |
| Methods | |
buildUrl()Parameters:
None
Return Type:
StringBuild encoded parameters of an url to search stores (&max_number=3). | |
SearchQuery class
woosmap.search.SearchQueryMVCObject.
| Constructor |
SearchQuery(querySearchOptions)Parameters:
Constructs a new SearchQuery |
| Properties | |
|
Type:
stringAND query operator | |
|
Type:
stringOR query operator | |
|
Type:
TextSearchQueryProperty for text search | |
|
Type:
String[]Property for tag search | |
|
Type:
String[]Property for type search | |
| Methods | |
addTagFilter(tagName, operator)Parameters:
Adds a tag filter to the query. | |
addTypeFilter(typeName, operator)Parameters:
Adds a type filter to the query. | |
setQuery(queryText, options?)Parameters:
Sets the query text | |
addQueryOption(name, operator)Parameters:
Adds a query option | |
removeQueryOption(name)Parameters:
Removes a QueryOption by name. | |
Styler class
woosmap.style.StylerStyler duty is to style google maps Data Layer
| Constructor |
Styler(options)Parameters:
|
| Methods | |
getMarkerStyleForStore(store, options)Parameters:
Return Type:
google.maps.IconResolves style for the store feature using options. | |
DirectionsResultsDisplayer class
woosmap.ui.DirectionsResultsDisplayerMVCObject.
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:
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:
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:
Display a selected route polyline on map | |
setSelectedRenderer(rendererIndex)Parameters:
Set renderer options to | |
InfoBox class
woosmap.ui.InfoBoxCreates 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:
Sets the content of the InfoBox. The content can be plain text or an HTML DOM node. | |
setZIndex(index)Parameters:
Sets the zIndex style for the InfoBox. | |
setVisible(isVisible)Parameters:
Sets the visibility of the InfoBox. | |
getContent()Parameters:
None
Return Type:
stringReturns the content of the InfoBox. | |
getZIndex()Parameters:
None
Return Type:
numberReturns the zIndex for the InfoBox. | |
getVisible()Parameters:
None
Return Type:
booleanReturns 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:
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.MailViewwoosmap.utils.DelegateProtocol.
Constructs a new MailView, in order to ask our API endpoint to send a mail for directions
Template example
<div>
<input type="text" placeholder="email" class="woosmap-mail-input"/>
<button class="woosmap-send-button">Send mail</button>
</div>
Delegates
mailSendingcalled when mail is insendingstate.mailErrorcalled when mail is inerrorstate.mailSentcalled when mail is insentstate.
| Constructor |
MailView(template, custom_params)Parameters:
Constructs a new MailView, in order to ask our API endpoint to send a mail for directions |
| Properties | |
|
Type:
mailStatusWhen the MailView returns a result it sets this property. This property is bindable | |
|
Type:
StringWhen 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:
ObjectContains all the available status for the MailView.
Status states | |
| Methods | |
sendDirectionsMail(receiver_mail)Parameters:
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.OriginDestinationInputMVCObject.
Take the template for an Origin Destination Panel and link with an originDestination object
| Constructor |
OriginDestinationInput(originDestinationPanelTemplate, odInputOptions?)Parameters:
Take the template for an Origin Destination Panel and link with an originDestination object |
| Properties | |
|
Type:
LatLngLiteralThe location to use to compute the directions. | |
|
Type:
OriginDestination | |
|
Type:
StoreThe selected store. This property is bindable. | |
|
Type:
booleanFlag to decide where to put the store name. | |
| Methods | |
isSelectedStoreName(name)Parameters:
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:
Set the value of woosmap-origin input | |
setDestinationValue(newDestinationValue)Parameters:
Set the value of woosmap-destination input | |
getOriginValue(useLatLng?)Parameters:
Get the value of woosmap-origin input return selectedStore position is value is the same tha store name | |
getDestinationValue(useLatLng?)Parameters:
Get the value of woosmap-destination input return selectedStore position is value is the same tha store name | |
onKeyUp(event)Parameters:
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.SearchViewwoosmap.utils.DelegateProtocol.
Constructs a SearchView
didSearchClearis called when the search query is validated.
| Constructor |
SearchView(searchViewOptions?)Parameters:
Constructs a SearchView
|
| Methods | |
setupInteraction()Parameters:
None
Setups the interactions with the input, button, and clear button | |
setSearchQueryWithInputValue(property)Parameters:
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:
anyReturn resultsSelector container. | |
TableView class
woosmap.ui.TableViewMVCObject.
Constructs a new TableView
TableView container
<div class="woosmap-tableview-container"></div>
TableView Store Cell template example
<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
<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:
Constructs a new TableView |
| Properties | |
|
Type:
ObjectWhen user selects a places prediction it sets this property with places details This property is observable | |
|
Type:
ObjectWhen user click on a Places cell, it sets this property This property is observable | |
|
Type:
ArrayAn array of Places predictions. This property is bindable. | |
|
Type:
ObjectWhen user click on a Store cell, it sets this property This property is observable | |
|
Type:
ArrayAn 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:
Scrolls the table view to show the | |
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:
anyReturns the container of the TableView. | |
update()Parameters:
None
Displays the | |
setStoresTemplate(storesTemplate)Parameters:
Set new template for stores cells. | |
setPlacesTemplate(placesTemplate)Parameters:
Set new template for places cells. | |
setOnCellCreatedCallback(callback)Parameters:
Set a function to be called by the tableView after the rendering of the cells. | |
TravelModeSelector class
woosmap.ui.TravelModeSelectorMVCObject.
Take the template of travelModePanel to generate an object
| Constructor |
TravelModeSelector(travelModeSelectionPanelTemplate)Parameters:
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.DelegateProtocolMVCObject.
| Constructor |
DelegateProtocol()Parameters:
None
Constructs a new DelegateProtocol |
| Properties | |
|
Type:
ObjectThe delegate object. | |
| Methods | |
callDelegateMethod(methodName)Parameters:
Return Type:
DelegateReturnCalls the method | |
DelegateReturn class
woosmap.utils.DelegateReturnMVCObject.
| Constructor |
DelegateReturn()Parameters:
None
Builds a delegate return value. |
| Methods | |
or(defaultValue)Parameters:
Return Type:
anyReturns | |
MVCObject class
woosmap.utils.MVCObjectConstructor for MVCObject.
| Constructor |
MVCObject()Parameters:
None
Constructor for MVCObject. |
| Methods | |
bindTo(key, target, target_key?, notify?)Parameters:
Return Type:
voidBinds the property identified by ‘key’ to the specified target. | |
isPropertyBound(key)Parameters:
Return Type:
booleanIs this property a complex object - is it bound as either observer or target | |
get(key)Parameters:
Return Type:
mixedReturns the value of the property specified by ‘key’ | |
set(key, value, force_callback?)Parameters:
Return Type:
voidSets ‘value’ to ‘key’ on ‘this’. | |
setValues(key_value_pairs)Parameters:
Return Type:
voidSet all the values of the properties contained in ‘key_value_pairs’ | |
unbind(key)Parameters:
Return Type:
voidUn-bind the property identified by ‘key’ from its current target | |
unbindAll()Parameters:
None
Return Type:
voidUnbind 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:
stringA string representation of the distance value. | |
|
Type:
numberThe distance in meters. | |
BaiduDuration Interface
| Properties | |
|
Type:
stringA string representation of the duration value. | |
|
Type:
numberThe duration in seconds. | |
BaiduMapsOptions Interface
object| Properties | |
|
Type:
BMap.MapStyleBaidu Map Style | |
BaiduPolylineOptions Interface
BaiduPolylineOptions
| Properties | |
|
Type:
BMap.MapMap on which to display Polyline. | |
|
Type:
BMap.Point[]The ordered sequence of coordinates of the Polyline | |
|
Type:
string | |
|
Type:
number | |
|
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:
Stringthe location email contact. | |
|
Type:
Stringthe location phone. | |
|
Type:
Stringthe location website. | |
DataLayerOptions Interface
| Properties | |
|
Type:
StoreEventCallback | |
|
Type:
Styler | |
DataStyle Interface
| Properties | |
|
Type:
DeprecatedStyleRule[]deprecated marker style format used in BaseView. | |
|
Type:
Style | |
DeprecatedStyleRule Interface
| Properties | |
|
Type:
Stringbase url for the marker icon. | |
|
Type:
Stringbase url for the marker icon in its selected state. | |
|
Type:
Stringthe type for which the rules applies. Use | |
DirectionsRouteInformationsParams Interface
| Properties | |
|
Type:
numberdistance | |
|
Type:
StringdurationInTrafficLong | |
|
Type:
numberdurationInTrafficShort | |
|
Type:
StringdurationLong | |
|
Type:
numberdurationShort | |
|
Type:
numberrendererIndex | |
|
Type:
Stringsummary | |
|
Type:
StringtravelMode | |
EventListeners Interface
| Properties | |
|
Type:
StoreEventCallbackevent handler function for | |
|
Type:
StoreEventCallbackevent handler function for | |
|
Type:
StoreEventCallbackevent handler function for | |
|
Type:
StoreEventCallbackevent handler function for | |
|
Type:
StoreEventCallbackevent handler function for | |
EventName Interface
StringEventName
EventName should be one of the following: click, mousedown, mouseout, mouseover, mouseup.
FeatureData Interface
FeatureData
| Properties | |
|
Type:
LatLngLiteral | |
|
Type:
String | |
|
Type:
Object | |
GeoJSON Interface
GeoJSON
| Properties | |
|
Type:
Store[] | |
GeocoderOptions Interface
| Properties | |
|
The function to call when a geocoder error occurs. Google Maps only | |
|
Type:
NumberMaximum 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
FunctionThe 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:
Stringcallback prefix (defaults to | |
|
Type:
Stringparameter (defaults to | |
|
Type:
Numberhow long after the request until a timeout error
is emitted (defaults to | |
LatLngLiteral Interface
Location
| Properties | |
|
Type:
Numberthe latitude. | |
|
Type:
Numberthe longitude. | |
LoadOptions Interface
| Properties | |
|
Type:
Function | |
|
Type:
Boolean | |
|
Type:
String | |
|
Type:
Object | |
|
Type:
String | |
MapsLoaderOptions Interface
MapsLoaderOptions example
var mapsOptions = {
clientId: "a_client_id",
librariesToLoad: ["places"],
channelId: "a_channel_id",
language: "fr",
region: "FR"
version: "3.26"
}
| Properties | |
|
Type:
Stringis a string to track usage across different applications using the same client ID | |
|
Type:
stringthe google client id. | |
|
Type:
Stringa google maps api key. | |
|
Type:
Stringdesired for google maps api | |
|
Type:
Arraya list of String containing additional google libraries to load. | |
|
Type:
Stringdesired for google maps api | |
|
Type:
Stringdesired for google maps api | |
MarkerStyleOptions Interface
NearbyOptions Interface
| Properties | |
|
Type:
Numberthe maximum distance allowed between the user and a store. | |
|
Type:
Numberthe maximum number of stores to return | |
OdInputOptions Interface
| Properties | |
|
Type:
StringText to display in input field after geolocation | |
OriginDestination Interface
| Properties | |
|
Type:
String | |
|
Type:
String | |
PolylineFilter Interface
| Properties | |
|
Type:
Stringa polyline encoded to the google format | |
|
Type:
Numbermax distance to retrieve store from the polyline (in meter). Default value is 10000 | |
RendererOptions Interface
| Properties | |
|
Type:
StoreEventListenerThe click callback. | |
|
Type:
EventListeners | |
|
Type:
Styler | |
SearchParametersOptions Interface
| Properties | |
|
Bounds in which the search will be performed | |
|
Type:
woosmap.search.SearchParameters.GroupByValuesAggregate stores by type or tag. Only available when using DataSource.countStoresByParameters method | |
|
Type:
Numberlatitude of the position to search nearest stores. | |
|
Type:
Numberlongitude of the position to search nearest stores. | |
|
Type:
Numbermaximum distance from user (in meter). | |
|
Type:
Numbermaximum number of stores to return (deprecated use pagination instead). | |
|
Type:
Numberthe request page | |
|
Type:
PolylineFilterto filter on polyline path. | |
|
search query that replaces the searchTextOptions. | |
|
Type:
QuerySearchOptionsoptions to filter on store’s text properties. | |
|
Type:
Numberthe number of store by page (default:100, max:300) | |
|
Type:
Booleanwhether 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:
Addressthe Store address | |
|
Type:
Contactthe contact information. | |
|
Type:
GeometryThe geometry associated to this store | |
|
Type:
Stringthe store name. | |
|
Type:
Stringthe unique Id for this store. | |
|
Type:
String[]the store tags. | |
|
Type:
String[]the store types. | |
|
Type:
Objectuser definied properties | |
StoreEventCallback Interface
FunctionThe marker parameter is only valued when the event is generated from a MarkersRenderer.
| Function |
StoreEventCallback(store, marker?)Parameters:
The marker parameter is only valued when the event is generated from a MarkersRenderer. |
Style Interface
Style Example
{
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:
StyleRulethe default styling rules, applies when no typed rule matched. | |
|
Type:
StyleRule[]the typed rules, each rule bears a | |
StyleRule Interface
| Properties | |
|
Type:
google.maps.Icon | |
|
Type:
google.maps.Icon | |
|
Type:
google.maps.Icon | |
|
Type:
Stringa | |
TileStyle Interface
TileStyle Object specifications.
| Properties | |
|
Type:
Stringa color rgba formatted | |
|
Type:
Numberthe minimum size acceptable for the marker. | |
|
Type:
Numberthe 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:
Numberthe timestamp at which the data was updated. | |
TiledImageLayerOptions Interface
TiledImageLayerOptions
| Properties | |
|
Type:
google.maps.Mapthe map where the layer will be displayed. | |
|
Type:
Numberthe layer will be visible between 0 and | |
|
Type:
SearchParameters | |
|
Type:
TileStyleobject that contains style parameters for the current layer. | |
TiledOverlayOptions Interface
| Properties | |
|
Type:
Number | |
|
Type:
PolylineFilterDeprecated - use | |
|
Type:
SearchParameters | |
|
Type:
SearchQueryDeprecated - use | |
TiledViewOptions Interface
TiledViewOptions
| Properties | |
|
Type:
Numberthe zoom level to change the representation. | |
|
Type:
Booleanwhen gentleCenter is true the view will center on the selectedStore only if it’s not already in the padded zone. | |
|
Type:
DefaultRendererthe renderer used to display search results. | |
|
Type:
Booleansets the paddedStoreCenter | |
|
Type:
PolylineFiltera polylineFilter to filter stores. | |
|
Type:
SearchParameters | |
|
Type:
SearchQueryDeprecated - use | |
|
Type:
Stylethe style for the tiled vector layer. | |
|
Type:
TileStylethe style for the tiled image layer. | |
|
Type:
DefaultRendererthe renderer used to display vector tiles. | |
TrafficLayerOptions Interface
| Properties | |
|
Type:
booleanWhether the traffic layer refreshes with updated information automatically. This is true by default. | |
|
Type:
BMap.MapMap on chich to display the traffic layer. | |
TypesRules Interface
TypesRules Object specifications.
| Properties | |
|
Type:
Stringa color rgba formatted | |
|
Type:
Stringof a store | |
|
Type:
Numberthe zIndex priority of the points | |
createMapOptions Interface
| Properties | |
|
Type:
LatLngZoom center. | |
|
Type:
booleanEnable scroll wheel zoom with Baidu. | |
|
Type:
NumberIf set and positive, set zoom level. | |
QuerySearchOptions Interface
Example value
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 | |
|
Type:
TextSearchQuerysearch string and its options. | |
|
Type:
String[]a list of tags object | |
|
Type:
String[]a list of types object | |
TextSearchQuery Interface
Example value
var textSearchQuery = {
'value': 'string to search',
'options': {
'name': SearchQuery.OR,
'city': SearchQuery.AND
}
}
| Properties | |
|
Type:
Objectkeys are the attributes of the store where the search will be performed,
attached value are operator that will be used. Attributes can be | |
|
Type:
Stringthe text to be searched. | |
InfoBoxOptions Interface
This object represents the optional parameter passed to the InfoBox constructor.
| Properties | |
|
Type:
booleanAlign 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:
stringThe name of the CSS class defining the styles for the InfoBox container. | |
|
Type:
ObjectAn 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:
stringThe CSS margin style value for the close box. The default is “2px” (a 2-pixel margin on all sides). | |
|
Type:
stringThe 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:
stringThe content of the InfoBox (plain text or an HTML DOM node). | |
|
Type:
booleanDisable auto-pan on open. | |
|
Type:
booleanPropagate 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:
SizeMinimum offset (in pixels) from the InfoBox to the map edge after an auto-pan. | |
|
Type:
booleanHide the InfoBox on open. [Deprecated in favor of the visible property.] | |
|
Type:
numberThe maximum width (in pixels) of the InfoBox. Set to 0 if no maximum. | |
|
Type:
stringThe 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:
SizeThe 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:
LatLngThe geographic location at which to display the InfoBox. | |
|
Type:
booleanShow the InfoBox on open. | |
|
Type:
numberThe CSS z-index style value for the InfoBox. Note: This value overrides a zIndex setting specified in the boxStyle property. | |
SearchViewOptions Interface
Template sample
<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-inputThe input used to fill the search querywoosmap-search-clearThe element used to clear the search inputwoosmap-search-buttonThe element used to trigger the search on click.woosmap-my-location-buttonThe 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
<div>
{{formattedAddress}}
</div>
| Properties | |
|
Type:
stringtext to display on input field after a geolocation | |
|
Type:
stringlocation results template. | |
|
Type:
stringSearch 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 | |