Javascript API

1.4

Javascript reference

DelegateProtocol class 🔗


DelegateProtocol

Constructor
DelegateProtocol()

Constructs a new DelegateProtocol


Methods
callDelegateMethod(methodName:String)

Return Value: DelegateReturn

Calls the method methodName on the delegate.


Properties
delegate Type: Object

The delegate object.


Loader class 🔗


Loader

Constructor
Loader()

Constructs a new WoosmapLoader instance.


Methods
load(loadOptions:LoadOptions)

Load method with one parameter and no version aliases.


BaseView class 🔗


woosmap.BaseView
This class extends MVCObject.

Constructor
BaseView()

Constructs a new BaseView


Methods
init(map:google.maps.Map, options:BaseViewOptions)

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

panTo(center:google.maps.LatLng, padding?:BoundsPadding)

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

fitBounds(bounds:google.maps.LatLngBounds, padding?:BoundsPadding)

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

enableZoom(activate:Boolean)

Enable or Disable zoom when select a store

enablePan(activate:Boolean)

Enable or Disable pan when select a store

enablePaddedStoreCenter(activate)

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()

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

selectedStore_changed()

This function is called when selectedStore property is changed

getDataBounds()

Return Value: google.maps.LatLngBounds|Null

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

getMap()

Return Value: google.maps.Map

Returns the google maps used by the BaseView.

removeAllStores()

Removes all the stores from the map.

displayStore(store:Store)

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

location_changed()

This function is called when location property is changed

addListener(eventName:EventName, callback:StoreEventCallback)

Return Value: Storeeventlistener

Adds a store event listener.

removeListener(storeEventListener:Storeeventlistener)

Removes a store event listener.


Properties
stores Type: Array.<Store>

List of stores displayed. This property is bindable.

selectedStore Type: Store

The currently selected store. This property is bindable.

location Type: Location

The user defined location. This property is bindable.

padding Type: BoundsPadding

Controls the viewport padding used by fitBounds.

marker Type: google.maps.Marker

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).


DataSearchSource class 🔗


woosmap.DataSearchSource
This class extends MVCObject.

Constructor
DataSearchSource(dataSource:DataSource, searchTextOptions:TextSearchQuery, nearbyOptions:NearbyOptions, polylineFilter?:PolylineFilter)

Constructs a new DataSearchSource


Methods
autocomplete_query_changed()

Listens the changes of query.

location_changed()

Listens the changes of location.

updateSearchQuery(key:String, value:SearchQuery)

Updated the searchQuery value.

updateSearchQueryAndSearch(key:String, value:SearchQuery)

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

addFieldToSearchTextOptions(fieldName:String, operator:String)

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

removeFieldFromSearchTextOptions(fieldName:String)

Remove a field from searchTextOptions (so field will not be use anymore for filtering).

Update stores list after removal.

updateTextSearchQuery()

Deprecated

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

updateTextSearchQueryAndSearch()

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

search(querySearchParameters?:SearchQuery)

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

setPolylineFilter(polylineFilter:PolylineFilter)

Add or update the polylineFilter for the searchSource.

To remove the filter set is value to null.

setMaxStores(maxStores:Number)

Update the maxStores value.

To remove the search option set is value to null.

setMaxDistanceFromUser(maxDistanceFromUser:Number)

Update the maxDistanceFromUser value.

To remove the search option set is value to null.


Properties
searchParameters Type: SearchParameters

Contains options to searchStores

autocomplete_query Type: String

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

location Type: Location

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


DataSource class 🔗


woosmap.DataSource

Constructor
DataSource(api_url?:String, api_key?:String)

The DataSource object is the bridge to the server API.


Methods
getFromApi(url:String, callback:Function)

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

getAllStores(callback:Function)

Return Value: Promise

Returns all the stores.

getNearbyStores(lat:Number, lng:Number, callback:Function, maxStores:Number, maxDistanceFromUser:Number)

Return Value: 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:String, callback:Function)

Return Value: Promise

Fetches a store by it’s store_id.

getStoresBySearchQuery(query:String, callback:Function)

Return Value: Promise

Deprecated

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

searchStores(searchQuery:SearchQuery, callback:Function)

Return Value: Promise

Deprecated

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

searchNearbyStores(searchQuery:SearchQuery, lat:Number, lng:Number, callback:Function, maxStores:Number, maxDistanceFromUser:Number)

Return Value: Promise

Deprecated

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

searchStoresByParameters(searchParameters:SearchParameters, callback:Function)

Return Value: Promise

Search on store given a list of information

countStoresByParameters(searchParameters:SearchParameters, callback:Function)

Return Value: Promise

return the number of stores matching parameters

storesBoundsByParameters(searchParameters:SearchParameters, callback:Function)

Return Value: Promise

return the bounds for all stores matching parameters

getProjectConfig(callback:Function)

Return Value: Promise

Get the config object for the Project.


LocatorWindow class 🔗


woosmap.LocatorWindow
This class extends MVCObject.

Constructor
LocatorWindow(map:google.maps.Map, renderer:TemplateRenderer, infoBoxOptions?:InfoBoxOptions)

Construct a LocatorWindow.


Methods
selectedStore_changed()

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

getAnchorForCoordinates(coordinates)

Return Value: google.maps.MVCObject

Computes the Window anchor for coordinates

getMarkerForCoordinates(coordinates)

Return Value: google.maps.Marker

Return a marker for coordinates

openOn(store)

Opens the info window on the store.

close()

Closes the Locatorwindow

setOpeningCallback(openingCallback?:Function)

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

setInfoBoxOptions(options?:InfoBoxOptions)

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


Properties
selectedStore Type: Store

The currently selectedStore. This property is bindable


MapsLoader class 🔗


woosmap.MapsLoader

Constructor
MapsLoader(clientIdOrOptions?:String|MapsLoaderOptions, librariesToLoad?:Array.<String>)

Construct a MapsLoader instance with the googleloader


Methods
load(callback:Function)

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


TemplateRenderer class 🔗


woosmap.TemplateRenderer

Constructor
TemplateRenderer(template:String)

Constructs a TemplateRendererInstance


Methods
render(properties?:Object)

Return Value: *

Renders the compiled template with the context

registerLambda(name, lambda)

Registers a template Lambda


TiledView class 🔗


woosmap.TiledView
This class extends BaseView, MVCObject.

Constructor
TiledView(map:google.maps.Map, options?:TiledViewOptions)

Methods
setSearchParameters(searchParameters)

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

setSearchQuery(searchQuery:SearchQuery)

Deprecated

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

setPolylineFilter(polylineFilter:PolylineFilter)

Deprecated

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


Properties
marker Type: google.maps.Marker

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).


View class 🔗


woosmap.View
This class extends BaseView, MVCObject.

Constructor
View(map:google.maps.Map, markersOrOptions?:String|Array.<DeprecatedStyleRule>|BaseViewOptions, zoomLevel?:Number)

Constructs a View


Methods

Properties
marker Type: google.maps.Marker

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).


ZipCodeProvider class 🔗


woosmap.ZipCodeProvider
This class extends MVCObject.

Constructor
ZipCodeProvider()

Constructs a new ZipCodeProvider


Methods
getZipCode()

Return Value: String

Get the currently saved zipcode

getZipCodeType()

Return Value: String

Get the zipcode type

location_changed()

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


Properties
zipcode Type: String

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

location Type: Location

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


BaseLayer class 🔗


Abstract woosmap.layers.BaseLayer

Constructor
BaseLayer()

BaseLayer.


Methods
setMap(map:google.maps.Map)

Set the map instance

getMap()

Return Value: google.maps.Map

Getter to access to the map instance

setHidden(isHidden:Boolean)

Set the visibility of the data

getHidden()

Return Value: Boolean

Getter to access to the visibility state


DataLayer class 🔗


woosmap.layers.DataLayer
This class extends BaseLayer.

Constructor
DataLayer(options?:DataLayerOptions)

DataLayer


Methods
displayStores(stores:Array.<Store>)

Displays on the map the stores passed as parameter.

displayNumberedStores(stores:Array.<Store>)

Displays the stores with numbered icons.


TiledDataOverlay class 🔗


woosmap.layers.TiledDataOverlay
This class extends BaseLayer.

Constructor
TiledDataOverlay(options?:TiledOverlayOptions)

TiledDataOverlay.


Methods
clear()

Clears the overlay data and cache.

setMap(map:google.maps.Map)

Set the map instance

setSearchParameters(searchParameters:SearchParameters)

Sets the search parameters used to filter the displayed data.

setSearchQuery(searchQuery:SearchQuery)

Deprecated

Sets the searchQuery used to filter the displayed data.

setPolylineFilter(polylineFilter:PolylineFilter)

Deprecated

Sets the polylineFilter used to filter the displayed data.

onAdd()
onRemove()
tileDidLoad(data)

Abstract

Called when a tile has finished loading

tilesDidLoad()

Abstract

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


TiledImageLayer class 🔗


woosmap.layers.TiledImageLayer

Constructor
TiledImageLayer(options?:TiledImageLayerOptions)

Constructs a new TiledImageLayer


Methods
setMap(map:google.maps.Map)

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

getMap()

Return Value: google.maps.Map|Null

Returns the google map bound to the image layer.

setSearchParameters(searchParameters:SearchParameters)

Sets the search parameters used to filter the displayed data.

setSearchQuery(searchQuery:SearchQuery)

Deprecated

Sets the searchQuery used to filter the displayed data.

setPolylineFilter(polylineFilter:PolylineFilter)

Deprecated

Sets the polylineFilter used to filter the displayed data.


BaseRenderer class 🔗


woosmap.layers.renderers.BaseRenderer

Constructor
BaseRenderer(options:RendererOptions, options)

Methods
addEventListener(event:EventName, listener:Storeeventlistener)

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

setClick(callback:Storeeventlistener)

Deprecated

Build the click listener with the callback argument

getMap()

Return Value: google.maps.Map

Getter to access to the map instance

setMap(map:google.maps.Map)

Set the map instance

displayStores(stores:GeoJSON)

Call to display the stores with the basic style

displayNumberedStores(stores:GeoJSON)

Call to display the stores with the numbered style

tileDidLoad(data:GeoJSON)

Call on each tiles request.

tilesDidLoad()

Called once all tiles request are finished.

selectStore(selectedStore:Store)

Use the selected style for the selectedStore

clear()

Removes all the data and style from the layer.


DefaultRenderer class 🔗


woosmap.layers.renderers.DefaultRenderer
This class extends BaseRenderer.

Constructor
DefaultRenderer(options:RendererOptions, options)

Methods
getMap()

Return Value: google.maps.Map

Getter to access to the map instance

setMap(map:google.maps.Map)

Set the map instance

displayStores(stores:GeoJSON)

Call to display the stores with the basic style

displayNumberedStores(stores:GeoJSON)

Call to display the stores with the numbered style

tilesDidLoad()

Called once all tiles request are finished.

selectStore(selectedStore:Store)

Use the selected style for the selectedStore

clear()

Removes all the data and style from the layer.


MarkersRenderer class 🔗


woosmap.layers.renderers.MarkersRenderer
This class extends DefaultRenderer, BaseRenderer.

Constructor
MarkersRenderer(options:RendererOptions)

Markers renderer.


Methods
displayMarkers(features, markers?:google.maps.Marker)

Display the markers of each features

getMap()

Return Value: Undefined|google.maps.Map

Return the map instance

getDisplayingMarkers()

Return Value: Array.<google.maps.Marker>

Return the markers object for the current bounds

getDisplayingFeatures()

Return Value: Array

Return the features objects for the current bounds

displayCurrentMarkers()

Display the markers in the current bounds

displayMarkersForStores(stores:GeoJSON)

Display the marker for a stores list

displayStores(stores)

Display the stores list

displayNumberedStores(stores)

Display the stores list with a numbered style


DirectionsProvider class 🔗


woosmap.location.DirectionsProvider
This class extends MVCObject.

Constructor
DirectionsProvider(directionRendererOptions?:google.maps.DirectionsRendererOptions, googleDirectionsRequestOptions?:google.maps.DirectionsRequests, directionsRequestErrorCallback?:Function)

Constructs a new DirectionsProvider


Methods
getDirectionsFromOrToStore()

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

setDirectionsObjectsWithResponse()

Set directionsRenderers and directionsSummary objects

getDirectionsLink()

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

getRouteEncodedPolyline(rendererIndex)

Return Value: String

Return an encodedPolyline of a simplify version of a route


Properties
directionsSummaries Type: Array.<RouteInformation>

This property is observable An array containing information about each route

directionsRenderers Type: Array.<google.maps.DirectionsRenderers>

This property is observable An array containing renderer about each route

directionsLink Type: String

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

selectedTravelMode Type: String

This property is observable

originDestination Type: Location

This property is observable


DistanceProvider class 🔗


woosmap.location.DistanceProvider
This class extends MVCObject.

Constructor
DistanceProvider(options?:Object)

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


Methods
updateStoresDistanceWithGoogle(stores:Array.<Store>, user_callback:Function, orderby:String)

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.

Properties
location Type: Location

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


GeocoderSearchSource class 🔗


woosmap.location.GeocoderSearchSource
This class extends MVCObject.

Constructor
GeocoderSearchSource(geocoderOptions?:GeocoderOptions)

Constructs a new GecoderSearchSource


Methods
query_changed()

Listens the changes of query.

search(query)

Use the google maps geocoder to geocode the query.


Properties
location Type: Location

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

locationResults Type: Array

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

query Type: String

Observes his query to launch the geocoding.


LocationProvider class 🔗


woosmap.location.LocationProvider
This class extends MVCObject.

Constructor
LocationProvider()

Constructs a new LocationProvider, in order to track browser location


Methods
askForLocation(geoLocationProvider)

Set user location given provider.


Properties
location Type: Location

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


NearbyStoresSource class 🔗


woosmap.location.NearbyStoresSource

Constructor
NearbyStoresSource(dataSource:DataSource, maxStores:Number, maxDistanceFromUser:Number)

Builds a NearbyStoresSource


Properties
stores Type: Array

An array of stores. This property is bindable.

location Type: Location

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


PlacesSearchSource class 🔗


woosmap.location.PlacesSearchSource
This class extends MVCObject.

Constructor
PlacesSearchSource(options?:google.maps.places.AutocompletionRequest, minQuerySize?:Number)

Constructs a new PlacesSearchSource


Methods

Properties
autocomplete_query Type: String

Observes his autocomplete_query to launch the autocomplete.

predictions Type: Array

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

options Type: Object

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

minQuerySize Type: Number

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


Data class 🔗


woosmap.maps.data.Data

Constructor
Data()

Creates an empty collection.


Methods
add(feature:Feature)

Adds the feature passed as parameter.

remove(feature:Feature)

Remove the feature passed as parameter.

addGeoJson(geojson, options?)

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:Function)

Exports the features in the collection to a GeoJSON object.

contains(feature:Feature)

Return Value: Boolean

Checks whether the given feature is in the collection.

forEach(callback)

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)

Return Value: Feature|Null

Returns the feature matching the id.

getMap()

Return Value: google.maps.Map|BMap.Map

Returns the map on which the features are displayed.

setMap(map)

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

setStyle(style:Function|google.maps.Icon)

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()

Return Value: *

Gets the style for all features in the collection.

overrideStyle(feature:Feature, style:google.maps.Icon)

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?:Feature)

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:Function)

Adds a listener for event

trigger(event:String, eventData:*)

Trigger event listeners.


Feature class 🔗


woosmap.maps.data.Feature

Methods
getGeometry()

Return Value: google.maps.LatLng|BMap.Point

Returns the feature geometry.

getId()

Return Value: *

Returns the feature id.

getProperty(name:String)

Return Value: *

Returns the feature property

removeProperty(name:String)

Removes property

setProperty(name:String, newValue:*)
toGeoJson(callback:Function)

Exports the feature to a GeoJSON object.


getData function  🔗

woosmap.maps.data.getData

Function
getData()

Returns a new data instance.

addListener function  🔗

woosmap.maps.events.addListener

Function
addListener(target, eventName, callback)

removeListener function  🔗

woosmap.maps.events.removeListener

Function
removeListener(target, listener)

trigger function  🔗

woosmap.maps.events.trigger

Function
trigger(target, eventName, data)

LatLng class 🔗


woosmap.maps.geometry.LatLng

Constructor
LatLng(lat:Number, lng:Number)

Methods
toJSON()

Return Value: google.maps.LatLngLiteral


Properties
lat Type: Number

The latitude.

lng Type: Number

The latitude.


LatLngBounds class 🔗


woosmap.maps.geometry.LatLngBounds

Constructor
LatLngBounds(ne:LatLng, sw:LatLng)

Methods
getNorthEast()

Return Value: LatLng

getSouthWest()

Return Value: LatLng

getCenter()

Return Value: LatLng|Null

Computes the center of the latlng bounds.

isEmpty()

Return Value: Boolean

Checks if the current bounds are empty.

intersects(other:Latlngbounds)

Return Value: Boolean

Checks if bounds are intersecting with other.

union(other:Latlngbounds)
contains(latlng:Latlng|Latlngliteral)

Return Value: Boolean

Checks if current bounds contain latlng.

extend(point:Latlng|Latlngliteral)

Return Value: LatLngBounds

Extends the current bounds with point.

toJSON()

Return Value: google.maps.LatLngBoundsLiteral

Returns the bounds as JSON.


Point class 🔗


woosmap.maps.geometry.Point

Constructor
Point(x:Number, y:Number)

Properties
x Type: Number

x coordinate.

y Type: Number

y coordinate.


Size class 🔗


woosmap.maps.geometry.Size

Constructor
Size(width:Number, height:Number)

Properties
width Type: Number
height Type: Number

addControl function  🔗

woosmap.maps.utils.addControl

Function
addControl(map:google.maps.Map|BMap.Map, element, anchor:ControlPosition)

Adds control to the map.

addImageOverlay function  🔗

woosmap.maps.utils.addImageOverlay

Function
addImageOverlay(map:google.maps.Map|BMap.Map, overlay:google.maps.ImageMapType|BMap.TileLayer, at:Number)

getJsonTilesUrlTemplate function  🔗

woosmap.maps.utils.getJsonTilesUrlTemplate

Function
getJsonTilesUrlTemplate(updatedAt)

getLatLng function  🔗

woosmap.maps.utils.getLatLng

Function
getLatLng(lat, lng)

getMapDiv function  🔗

woosmap.maps.utils.getMapDiv

Function
getMapDiv(map:google.maps.Map|BMap.Map)

Returns the map container

getMarker function  🔗

woosmap.maps.utils.getMarker

Function
getMarker(options)

isBaidu function  🔗

woosmap.maps.utils.isBaidu

Function
isBaidu()

isGoogle function  🔗

woosmap.maps.utils.isGoogle

Function
isGoogle()

removeOverlayAt function  🔗

woosmap.maps.utils.removeOverlayAt

Function
removeOverlayAt(map:google.maps.Map|BMap.Map, overlay:google.maps.ImageMapType|BMap.TileLayer, at:Number)

setIcon function  🔗

woosmap.maps.utils.setIcon

Function
setIcon(marker, iconData:google.maps.Icon)

Sets marker icon

setMap function  🔗

woosmap.maps.utils.setMap

Function
setMap(marker:google.maps.Marker|BMap.Marker, map:google.maps.Map|BMap.Map)

Sets the markers map.

setMarkerOptions function  🔗

woosmap.maps.utils.setMarkerOptions

Function
setMarkerOptions(marker:google.maps.Marker|BMap.Marker, options:google.maps.MarkerOptions)

setPosition function  🔗

woosmap.maps.utils.setPosition

Function
setPosition(marker, position)

sets the marker position

buildQueryString function  🔗

woosmap.network.buildQueryString

Function
buildQueryString(params)

Builds a query string from dictionary.

fetch function  🔗

woosmap.network.fetch

Function
fetch(url)

Fetches the url content.

jsonp function  🔗

woosmap.network.jsonp

Function
jsonp(url:String, options:JSONPOptions)

Makes a JSONP request

post function  🔗

woosmap.network.post

Function
post(url, data)

Posts JSON data to url

F function  🔗

woosmap.query.F

Function
F(key:String, value:String|Number, operator?:Operators)

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

Field class 🔗


woosmap.query.Field

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

Represents a field filter


Query class 🔗


woosmap.query.Query

Constructor
Query(children:Array.<Query|Field|String>, connector:BoolOperators, negate:Boolean)

Represents a Query


and function  🔗

woosmap.query.and

Example

var q = woosmap.query;
var query = q.and([q.F('type', 'myType'), q.F('type', 'myOtherType')])

query.toString() should return '(type:"myType" AND type:"myOtherType")'

Example using arguments

let query = q.and(q.F('type', 'myType'), q.F('type', 'myOtherType'))
Function
and(children:Array.<Query|Field|String>)

Helper function to instantiate a Query with AND connector

not function  🔗

woosmap.query.not

Example

var q = woosmap.query;
var query = q.not(q.F('type', 'myType')])

query.toString() should return 'NOT type:"myType"'

Function
not(child:Query|Field|String)

Helper function to instantiate a negated Query

or function  🔗

woosmap.query.or

Example

let q = woosmap.query;
let query = q.or([q.F('type', 'myType'), q.F('type', 'myOtherType')])

query.toString() should return '(type:"myType" OR type:"myOtherType")'

Example using arguments

let query = q.or(q.F('type', 'myType'), q.F('type', 'myOtherType'))

Should return the same as previous example.

Function
or(children:Array.<Query|Field|String>)

Helper function to instantiate a Query with OR connector

SearchParameters class 🔗


woosmap.search.SearchParameters

Constructor
SearchParameters(searchParametersOptions?:SearchParametersOptions)

Constructs a new SearchParameters


Methods
buildUrl()

Return Value: String

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


Properties
lat Type: Number

Latitude of the position to search nearest stores

lng Type: Number

Longitude of the position to search nearest stores.

maxStores Type: Number

Maximum number of stores to return.

maxDistanceFromUser Type: Number

Maximum distance from user (in meter).

searchQuery Type: SearchQuery

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

query Type: Query|Field|String
polylineFilter Type: PolylineFilter

PolylineFilter to filter on polyline path

page Type: Number

The expected page

storesByPage Type: Number

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

groupBy Type: GroupByValues

Count the stores by group values

bounds Type: google.maps.LatLngBoundsLiteral

Bounds in which the search will be performed


SearchQuery class 🔗


Deprecated woosmap.search.SearchQuery
This class extends MVCObject.

Constructor
SearchQuery(querySearchOptions:QuerySearchOptions)

Constructs a new SearchQuery


Methods
addTagFilter(tagName, operator)

Adds a tag filter to the query.

addTypeFilter(typeName, operator)

Adds a type filter to the query.

setQuery(queryText, options?)

Sets the query text

addQueryOption(name, operator)

Adds a query option

removeQueryOption(name)

Removes a QueryOption by name.


Properties
query Type: TextSearchQuery

Property for text search

tags Type: Array.<String>

Property for tag search

types Type: Array.<String>

Property for type search

AND Type: String

AND query operator

OR Type: String

OR query operator


Styler class 🔗


woosmap.style.Styler

Constructor
Styler(options:DataStyle)

Methods
getStyle()

Return Value: Style

Returns the the current style.

getDefaultStyle()

Return Value: StyleRule

Returns the default style.

getMarkerStyleForStore(store:google.maps.Data.Feature|Store, options:MarkerStyleOptions)

Return Value: google.maps.Icon

Resolves style for the store feature using options.


DirectionsResultsDisplayer class 🔗


woosmap.ui.DirectionsResultsDisplayer
This class extends MVCObject.

Constructor
DirectionsResultsDisplayer(map:google.maps.Map, summaryTemplate:String, displayNewRenderersCallback:Function, selectedAndUnselectedRendererOptions:SelectedAndUnselectedRendererOptions)

You must bind directionsLink property to directionsProvider


Methods
displayRouteSteps(rendererIndex:Number)

Display route’s steps on panel

cleanRoutes()

Clean all routes on panel

cleanRouteSteps()

Clean all route’s step on panel

cleanMapFromRoutes()

Hide all route’s Polyline on map

displayAllRoutes()

Display all the route on the map

displayRouteOnMap(rendererIndex:Number)

Display a selected route polyline on map

setSelectedRenderer(rendererIndex:Number)

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


InfoBox class 🔗


woosmap.ui.InfoBox

Constructor
InfoBox(opt_opts?:InfoBoxOptions)

Creates an InfoBox with the options specified in {@link InfoBoxOptions}.


Methods
onRemove()

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

draw()

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

setInfoBoxOptions(opt_opts:Infoboxoptions)

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:String|Node)

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

setPosition(latlng:Latlng)

Sets the geographic location of the InfoBox.

setZIndex(index:Number)

Sets the zIndex style for the InfoBox.

setVisible(isVisible:Boolean)

Sets the visibility of the InfoBox.

getContent()

Return Value: String

Returns the content of the InfoBox.

getPosition()

Return Value: Latlng

Returns the geographic location of the InfoBox.

getZIndex()

Return Value: Number

Returns the zIndex for the InfoBox.

getVisible()

Return Value: Boolean

Returns a flag indicating whether the InfoBox is visible.

show()

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

hide()

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

open(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()

Removes the InfoBox from the map.


InfoBoxOptions class 🔗


woosmap.ui.InfoBoxOptions

Properties
content Type: String|Node

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

disableAutoPan? Type: Boolean

Disable auto-pan on open.

maxWidth Type: Number

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

pixelOffset 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.

position Type: Latlng

The geographic location at which to display the InfoBox.

zIndex Type: Number

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

boxClass? Type: String

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

boxStyle? 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.

closeBoxMargin Type: String

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

closeBoxURL 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.

infoBoxClearance Type: Size

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

isHidden? Type: Boolean

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

visible? Type: Boolean

Show the InfoBox on open.

alignBottom 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).

pane 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.

enableEventPropagation 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.


MailView class 🔗


woosmap.ui.MailView
This class extends MVCObject.

Constructor
MailView(template:String, custom_params:Object)

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


Methods
sendDirectionsMail(receiver_mail:String)

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

getContainer()

Return Value: *


Properties
mailStatus Type: Mailstatus

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

selectedStore 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

status Type: Object

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


OriginDestinationInput class 🔗


woosmap.ui.OriginDestinationInput
This class extends MVCObject.

Constructor
OriginDestinationInput(originDestinationPanelTemplate:String, odInputOptions?:OdInputOptions)

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


Methods
isSelectedStoreName(name:String)

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

updateOriginDestination()

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:String)

Set the value of woosmap-origin input

setDestinationValue(newDestinationValue:String)

Set the value of woosmap-destination input

getOriginValue(useLatLng?:Boolean)

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

getDestinationValue(useLatLng?:Boolean)

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

onKeyUp()

Method called when keyUp on origin or destination input

selectedStore_changed()

Method called when selectedStore changed

location_changed()

Method called when location changed

getODContainer()

Return the container instantiated with origin-destination panel


Properties
originDestination Type: OriginDestination
storeIsDestination Type: Boolean

Flag to decide where to put the store name.

selectedStore Type: Store

The selected store. This property is bindable.

location Type: Location

The location to use to compute the directions.


SearchView class 🔗


woosmap.ui.SearchView
This class extends MVCObject.

Constructor
SearchView(searchViewOptions?:Searchviewoptions)

Constructs a SearchView


Methods
setupInteraction()

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

setSearchQueryWithInputValue()

Sets the query property with the value of the input.

clearResults()

Method called when searchView need to clear it’s results.

clearInput()

Method called when searchView need to clear it’s input.

getContainer()

Return Value: *

locationResults_changed()

Method called when locationResults changed.

When changed is trigger searchView will display location results into resultSelector container.

getResultsSelector()

Return Value: *

Return resultsSelector container.


TableView class 🔗


woosmap.ui.TableView
This class extends MVCObject.

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 it’s container will bear woosmap-tableview-selected-cell class. If a card is highlighted using arrow keys, it’s container will bear woosmap-tableview-highlighted-cell class.

Deprecated CSS classes

The class card_container is deprecated in favor of woosmap-tableview-container. The class selected-card is deprecated in favor of woosmap-tableview-selected-cell.

deprecated name new name
selected-card woosmap-tableview-selected-cell
card_container woosmap-tableview-container

Constructor
TableView(templates:Object)

Constructs a new TableView


Methods
setupInteraction()

Setups the interactions with the keyboard

selectedStore_changed()

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:Jquery)

Scrolls the table view to show the $cell

stores_changed()

When the stores list changes update the table view accordingly.

predictions_changed()

When the predictions list changes update the table view accordingly.

getContainer()

Return Value: *

Returns the container of the TableView.

update()

Displays the stores by rendering a cell for each store.

setStoresTemplate(storesTemplate:String)

Set new template for stores cells.

setPlacesTemplate(placesTemplate:String)

Set new template for places cells.

setOnCellCreatedCallback(callback:Function)

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


Properties
stores Type: Array

An array of stores. This property is bindable.

predictions Type: Array

An array of Places predictions. This property is bindable.

selectedStore Type: Object

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

location Type: Object

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

details Type: Object

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


TravelModeSelector class 🔗


woosmap.ui.TravelModeSelector
This class extends MVCObject.

Constructor
TravelModeSelector(travelModeSelectionPanelTemplate:String)

Take the template of travelModePanel to generate an object


Methods
initializedTravelModeChoice()

Initialized comportement of travel mode panel’s objects

getSelectorContainer()

Return the container instantiated with travel mode panel


DelegateProtocol class 🔗


Abstract woosmap.utils.DelegateProtocol
This class extends MVCObject.

Methods

DelegateReturn class 🔗


woosmap.utils.DelegateReturn
This class extends MVCObject.

Constructor
DelegateReturn()

Builds a delegate return value.


Methods
or(defaultValue)

Return Value: *

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


MVCObject class 🔗


woosmap.utils.MVCObject

Constructor
MVCObject()

Constructor for MVCObject.


Methods
bindTo(key:String, target:Object, target_key?:String, notify?:Boolean)

Return Value: Void

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

isPropertyBound(key:String)

Return Value: Boolean

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

get(key:String)

Return Value: Mixed

Returns the value of the property specified by ‘key’

set(key:String, value:Mixed, force_callback?:Boolean)

Return Value: Void

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

setValues(key_value_pairs:Object)

Return Value: Void

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

unbind(key:String)

Return Value: Void

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

unbindAll()

Return Value: Void

Unbind all bound properties on this object


Address object Specification  🔗


Properties
lines Type: Array.<String>

the address lines.

city Type: String
zipCode Type: String

BaseViewOptions object Specification  🔗


Properties
style? Type: Style
zoomLevel? Type: Number

BoundsPadding object Specification  🔗


All properties values are expected to be in pixels.

Properties
top? Type: Number
bottom? Type: Number
right? Type: Number
left? Type: Number

Contact object Specification  🔗


Properties
website Type: String

the location website.

phone Type: String

the location phone.

email Type: String

the location email contact.


DataLayerOptions object Specification  🔗


Properties
styler Type: Styler
click Type: StoreEventCallback

DataStyle object Specification  🔗


Properties
markers? Type: Array.<DeprecatedStyleRule>

deprecated marker style format used in BaseView.

style? Type: Style

DeprecatedStyleRule object Specification  🔗


Properties
type Type: String

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

default Type: String

base url for the marker icon.

selected Type: String

base url for the marker icon in it’s selected state.


EventListeners object Specification  🔗


Properties
click? Type: StoreEventCallback

event handler function for click google maps event.

mousedown? Type: StoreEventCallback

event handler function for mousedown google maps event.

mouseout? Type: StoreEventCallback

event handler function for mouseout google maps event.

mouseover? Type: StoreEventCallback

event handler function for mouseover google maps event.

mouseup? Type: StoreEventCallback

event handler function for mouseup google maps event.


EventName object Specification  🔗


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

GeoJSON object Specification  🔗


Properties
features Type: Array.<Store>

GeocoderOptions object Specification  🔗


Properties
maxResultsReturn? 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.

bounds?

The bounding box of the viewport GeocodingRequest parameters.

key?

Your application’s API key GeocodingRequest parameters.

language?

The language in which to return results GeocodingRequest parameters.

region?

The region code, specified as a ccTLD (“top-level domain”) two-character value GeocodingRequest parameters.

errorCallback? Type: GoogleGeocoderErrorCallback

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


Geometry object Specification  🔗


Properties
coordinates Type: Array.<Number>

WGS84 longitude, latitude.


GoogleGeocoderErrorCallback function definition  🔗

GoogleGeocoderErrorCallback

Function
function(status:google.maps.GeocoderStatus)

The function to call when a google geocoder error occurs.

JSONPOptions object Specification  🔗


Properties
prefix Type: String

callback prefix (defaults to __jp)

qs Type: String

parameter (defaults to callback)

timeout Type: Number

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


LoadOptions object Specification  🔗


Properties
loadJQuery Type: Boolean
version Type: String
publicKey Type: String
callback Type: Function
scope Type: Object

Location object Specification  🔗


Properties
lat Type: Number

the latitude.

lng Type: Number

the longitude.


MapsLoaderOptions object Specification  🔗


MapsLoaderOptions example

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

the google client id.

librariesToLoad? Type: Array

a list of String containing additional google libraries to load.

channelId? Type: String

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

key? Type: String

a google maps api key.

language? Type: String

desired for google maps api

region? Type: String

desired for google maps api

version? Type: String

desired for google maps api


MarkerStyleOptions object Specification  🔗


Properties
selected?
number?

NearbyOptions object Specification  🔗


Properties
maxStores Type: Number

the maximum number of stores to return

maxDistanceFromUser Type: Number

the maximum distance allowed between the user and a store.


OdInputOptions object Specification  🔗


Properties
geolocText? Type: String

Text to display in input field after geolocation


OriginDestination object Specification  🔗


Properties
origin Type: String
destination Type: String

PolylineFilter object Specification  🔗


Properties
encodedPolyline Type: String

a polyline encoded to the google format See : polylineutility

radius? Type: Integer

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


RendererOptions object Specification  🔗


Properties
click? Type: Storeeventlistener

The click callback.

eventListeners Type: EventListeners
styler Type: Styler

RouteInformation object Specification  🔗


Properties
rendererIndex Type: Number

integer corresponding to the route index on the directionsRenderers property.

travelMode Type: String

the travelMode for the route.

summary Type: String

the travelMode for the route.

distance Type: String

distance of the route.

durationLong Type: String

duration of the route.

durationShort Type: String

duration of the route (abbreviation).

durationInTrafficLong? Type: String

duration of the route with traffic.

durationInTrafficShort? Type: String

duration of the route with traffic (abbreviation).


SearchParametersOptions object Specification  🔗


Properties
lat? Type: Number

latitude of the position to search nearest stores.

lng? Type: Number

longitude of the position to search nearest stores.

maxDistanceFromUser? Type: Number

maximum distance from user (in meter).

maxStores? Type: Number

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

searchTextOptions? Type: QuerySearchOptions

options to filter on store’s text properties.

query? Type: Query|Field|String

search query that replaces the searchTextOptions.

polylineFilter? Type: PolylineFilter

to filter on polyline path.

page? Type: Number

the request page

storesByPage? Type: Number

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

bounds? Type: google.maps.LatLngBounds|google.maps.LatLngBoundsLiteral

Bounds in which the search will be performed

groupBy? Type: GroupByValues

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


SelectedAndUnselectedRendererOptions object Specification  🔗


Properties
unselectedRenderersOptions Type: google.maps.DirectionsRendererOptions

options for unselected renderers.

selectedRendererOptions Type: google.maps.DirectionsRendererOptions

options for selected renderer.


Store object Specification  🔗


Properties
storeId Type: String

the unique Id for this store.

name Type: String

the store name.

geometry Type: Geometry

The geometry associated to this store

types? Type: Array.<String>

the store types.

tags? Type: Array.<String>

the store tags.

user_properties? Type: Object

user definied properties

address? Type: Address

the Store address

contact? Type: Contact

the contact information.


StoreEventCallback function definition  🔗

StoreEventCallback

Function
function(store:Store,marker?:google.maps.Marker)

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

Style object Specification  🔗


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
default Type: StyleRule

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

rules Type: Array.<StyleRule>

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


StyleRule object Specification  🔗


{@link https://developers.google.com/maps/documentation/javascript/3.exp/reference#Icon}

Properties
icon Type: google.maps.Icon
selectedIcon Type: google.maps.Icon
numberedIcon Type: google.maps.Icon
type? Type: String

a store type that controls the rule application.


TileStyle object Specification  🔗


Properties
color? Type: String

a color rgba formatted

size? Type: Number

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

minSize? Type: Number

the minimum size acceptable for the marker.

updatedAt Type: Number

the timestamp at which the data was updated.

typeRules? Type: Array.<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.


TiledImageLayerOptions object Specification  🔗


Properties
map? Type: google.maps.Map

the map where the layer will be displayed.

style? Type: TileStyle

object that contains style parameters for the current layer.

maxZoom? Type: Number

the layer will be visible between 0 and maxZoom.

searchParameters Type: SearchParameters

TiledOverlayOptions object Specification  🔗


Properties
searchParameters? Type: SearchParameters
searchQuery? Type: SearchQuery

Deprecated use searchParameters

polylineFilter? Type: PolylineFilter

Deprecated use searchParameters

minZoom? Type: Number

TiledViewOptions object Specification  🔗


This object specification extends BaseViewOptions.
Properties
paddedStoreCenter? Type: Boolean

sets the paddedStoreCenter

style? Type: Style

the style for the tiled vector layer.

breakPoint? Type: Number

the zoom level to change the representation.

tileStyle? Type: TileStyle

the style for the tiled image layer.

searchQuery? Type: SearchQuery

Deprecated use searchParameters. a searchQuery to filter stores.

searchParameters? Type: SearchParameters
polylineFilter? Type: PolylineFilter

a polylineFilter to filter stores.

interactionRenderer? Type: DefaultRenderer

the renderer used to display search results.

tiledDataRenderer? Type: DefaultRenderer

the renderer used to display vector tiles.

gentleCenter? Type: Boolean

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


TypesRules object Specification  🔗


Properties
type Type: String

of a store

color Type: String

a color rgba formatted

zIndex? Type: Number

the zIndex priority of the points


QuerySearchOptions object Specification  🔗


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
query? Type: TextSearchQuery

search string and its options.

tags? Type: Array.<String>

a list of tags object

types? Type: Array.<String>

a list of types object


TextSearchQuery object Specification  🔗


Example value

var textSearchQuery = {
  'value': 'string to search',
  'options': {
    'name': SearchQuery.OR,
    'city': SearchQuery.AND
  }
}
Properties
value? Type: String

the text to be searched.

options? 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


SearchViewOptions object Specification  🔗


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-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

<div>
     {{formattedAddress}}
</div>
Properties
template? Type: String

Search input template.

resultsTemplate? Type: String

location results template.

geolocText? Type: String

text to display on input field after a geolocation


ControlPosition constants  🔗


Allowed values for control position.

Constants
TOP_LEFT

Position control to the top left of the map.

TOP_RIGHT

Position control to the top right of the map.

BOTTOM_LEFT

Position control to the bottom left of the map.

BOTTOM_RIGHT

Position control to the bottom right of the map.


BoolOperators constants  🔗


Represents Query Boolean operators.

Constants
AND

And boolean operator

OR

Or boolean operator

NOT

Not boolean operator


Operators constants  🔗


Represents Query operators.

Constants
gt

Greater-than operator

lt

Less-than-or-equal-to operator

lte

Less-than-or-equal-to operator

gte

Greater-than or equal-to operator


SearchParameters.GroupByValues constants  🔗


Allowed values for the groupBy parameter.

Constants
TYPE

Group By Type

TAG

Group By Tags