Map JS API v1.4

Map JS API Reference v1.4
  1. BaseGeometry class
  2. BasePolygon class
  3. Circle class
  4. Data class
  5. GeometryCollection class
  6. LineString class
  7. LinearRing class
  8. MultiLineString class
  9. MultiPoint class
  10. MultiPolygon class
  11. Point class
  12. Polygon class
  13. DirectionsRenderer class
  14. DirectionsService class
  15. DistanceService class
  16. Drawing class
  17. InfoWindow class
  18. LatLng class
  19. LatLngBounds class
  20. LocalitiesService class
  21. MVCArray class
  22. MVCObject class
  23. Map class
  24. Marker class
  25. OverlayView class
  26. Point class
  27. Polygon class
  28. Polyline class
  29. Rectangle class
  30. Size class
  31. StoresOverlay class
  32. StoresService class
  33. Feature class
  34. APIError class
  35. BadRequestError class
  36. ForbiddenError class
  37. InternalServerError class
  38. NotFoundError class
  39. TooManyRequestsError class
  40. UnauthorizedError class
  41. AutocompleteMatchedSubstring Interface
  42. CircleOptions Interface
  43. ControlPositionType Interface
  44. Coordinates Interface
  45. Geometry Interface
  46. DirectionLeg Interface
  47. DirectionRequest Interface
  48. DirectionResult Interface
  49. DirectionRoute Interface
  50. DirectionStep Interface
  51. DirectionStepInstructions Interface
  52. DirectionsBounds Interface
  53. DirectionsOverviewPolyline Interface
  54. DirectionsRendererOptions Interface
  55. DirectionsWayPoint Interface
  56. Distance Interface
  57. Duration Interface
  58. FeatureData Interface
  59. FlyToOptions Interface
  60. GeoJSONFeature Interface
  61. GeoJSONFeatureCollection Interface
  62. GeoJSONGeometry Interface
  63. GeoJSONGeometryCollection Interface
  64. GeoJSONLineString Interface
  65. GeoJSONMultiLineString Interface
  66. GeoJSONMultiPoint Interface
  67. GeoJSONMultiPolygon Interface
  68. GeoJSONPoint Interface
  69. GeoJSONPolygon Interface
  70. GeoJSONPosition Interface
  71. GeoJSONRawGeometry Interface
  72. GeometryArray Interface
  73. GeometryClasses Interface
  74. GeometryCollectionElement Interface
  75. GeometryData Interface
  76. GeometryOptions Interface
  77. GeometryType Interface
  78. GestureHandlingMode Interface
  79. Icon Interface
  80. IconSequence Interface
  81. InfoWindowOptions Interface
  82. LatLngBoundsLiteral Interface
  83. LatLngLiteral Interface
  84. MapEventListener Interface
  85. MapOptions Interface
  86. MapPanes Interface
  87. MapStyleSpec Interface
  88. MapStyler Interface
  89. MarkerAnimateOptions Interface
  90. MarkerLabel Interface
  91. MarkerLabelOptions Interface
  92. MarkerOptions Interface
  93. MatchedSubstring Interface
  94. Padding Interface
  95. Pagination Interface
  96. PointLiteral Interface
  97. PolygonFillOptions Interface
  98. PolygonOptions Interface
  99. PolylineOptions Interface
  100. RectangleOptions Interface
  101. SizeLiteral Interface
  102. Style Interface
  103. StyleFunction Interface
  104. StyleOptions Interface
  105. StyleRule Interface
  106. SymbolIcon Interface
  107. TypedStyleRule Interface
  108. DistanceIsochroneRequest Interface
  109. DistanceIsochroneResponse Interface
  110. DistanceIsoline Interface
  111. DistanceMatrixElement Interface
  112. DistanceMatrixRequest Interface
  113. DistanceMatrixResponse Interface
  114. DistanceMatrixResponseRow Interface
  115. AddressComponents Interface
  116. LocalitiesAutocompleteRequest Interface
  117. LocalitiesAutocompleteResponse Interface
  118. LocalitiesComponentRestrictions Interface
  119. LocalitiesDetailsAccuracy Interface
  120. LocalitiesDetailsGeometry Interface
  121. LocalitiesDetailsRequest Interface
  122. LocalitiesDetailsResponse Interface
  123. LocalitiesDetailsResult Interface
  124. LocalitiesDetailsSummary Interface
  125. LocalitiesGeocodeGeometry Interface
  126. LocalitiesGeocodeLocationType Interface
  127. LocalitiesGeocodeRequest Interface
  128. LocalitiesGeocodeResponse Interface
  129. LocalitiesGeocodeResult Interface
  130. LocalitiesGeocodeTypes Interface
  131. LocalitiesPredictions Interface
  132. LocalitiesRequestData Interface
  133. LocalitiesTypes Interface
  134. Store Interface
  135. StoreAddress Interface
  136. StoreContact Interface
  137. StoreOpen Interface
  138. StoreOpenNextOpening Interface
  139. StoreOpeningHours Interface
  140. StoreOpeningHoursPeriod Interface
  141. StoreOpeningHoursUsual Interface
  142. StorePrediction Interface
  143. StoreResponse Interface
  144. StoreWeeklyOpening Interface
  145. StoreWeeklyOpeningHoursPeriod Interface
  146. StoresAutocompleteRequest Interface
  147. StoresAutocompleteResponse Interface
  148. StoresBoundsRequest Interface
  149. StoresBoundsResponse Interface
  150. StoresSearchRequest Interface
  151. StoresSearchResponse Interface
  152. DirectionStatus Enum
  153. TravelMode Enum
  154. UnitSystem Enum
  155. DistanceServiceStatus Enum
  156. woosmap.map.event Namespace
  157. woosmap.map.geometry Namespace

BaseGeometry class

woosmap.map.BaseGeometry
This class extends woosmap.map.MVCObject.
Constructor
BaseGeometry(options)
Parameters:

Methods
getDraggable()
Parameters: None
Return Type: boolean

Returns whether the geometry is draggable or not.

getEditable()
Parameters: None
Return Type: boolean

Returns whether the geometry is editable or not.

getMap()
Parameters: None
Return Type: (Map | null)

Returns the current parent Map.

getVisible()
Parameters: None
Return Type: boolean

Returns whether the geometry is visible or not.

setDraggable(draggable)
Parameters:
  • draggable: boolean
Return Type: void

Sets the geometry draggable.

setEditable(editable)
Parameters:
  • editable: boolean
Return Type: void

Sets the geometry editable.

setMap(map)
Parameters:
  • map: Map | null
Return Type: void

Sets the map object to display on. if map is null, the geometry will be removed from the current map.

setVisible(visible)
Parameters:
  • visible: boolean
Return Type: void

Sets the visibility of the geometry.


BasePolygon class

woosmap.map.BasePolygon
This class extends BaseGeometry.
Constructor
BasePolygon(options)
Parameters:

Circle class

woosmap.map.Circle
This class extends BasePolygon.
Constructor
Circle(options)
Parameters:

Constructs a Circle.


Methods
getBounds()
Parameters: None
Return Type: LatLngBounds

Returns the bounds for the circle geometry.

getCenter()
Parameters: None
Return Type: LatLng

Returns the center for the circle geometry.

getRadius()
Parameters: None
Return Type: number

Returns the radius for the circle geometry.

setCenter(center)
Parameters:
Return Type: void

Sets the center for the circle.

setRadius(radius)
Parameters:
  • radius: number
Return Type: void

Sets the radius for the circle.

setOptions(options)
Parameters:
Return Type: void

Sets the options for the circle.


Data class

woosmap.map.Data
This class extends woosmap.map.MVCObject.

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

Constructor
Data()
Parameters: None

Creates an empty collection.


Methods
add(feature)
Parameters:
Return Type: void

Adds the feature passed as parameter.

remove(feature)
Parameters:
Return Type: void

Remove the feature passed as parameter.

addGeoJson(geojson, options?)
Parameters:
Return Type: void

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:
Return Type: void

Exports the features in the collection to a GeoJSON object.

contains(feature)
Parameters:
Return Type: boolean

Checks whether the given feature is in the collection.

forEach(callback)
Parameters:
  • callback: (feature: Feature) => void
Return Type: void

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

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

Returns the feature matching the id.

getMap()
Parameters: None
Return Type: (Map | null)

Returns the map on which the features are displayed.

setMap(map)
Parameters:
  • map: Map | null
Return Type: void

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

setStyle(style)
Parameters:
Return Type: void

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

getStyle()
Parameters: None

Gets the style for all features in the collection.

overrideStyle(feature, style)
Parameters:
Return Type: void

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

revertStyle(feature?)
Parameters:
Return Type: void

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.

loadGeoJson(url, options?, callback?)
Parameters:
  • url: string
  • options: {idPropertyName: string}
  • callback: (data: Feature[]) => void
Return Type: void

Loads GeoJSON features to the collection from an url. If a callback is provided it will be called with the imported features.


Events

This event is triggered when a feature was removed.

This event is triggered when a feature was added.

This event is triggered when a feature is clicked.

This event is triggered when a feature is right-clicked.

This event is triggered when a feature is double clicked.

This event is triggered when the mouse moves out of a feature.

This event is triggered when a feature was hovered

This event is triggered when a feature is hovered.


GeometryCollection class

woosmap.map.Data.GeometryCollection
Constructor
GeometryCollection(elements)
Parameters:

Constructs a geometry collection from an array of geometries.


Methods
getAt(n)
Parameters:
  • n: number

Returns the n-th Geometry of the GeometryCollection.

getArray()
Parameters: None
Return Type: GeometryArray
getLength()
Parameters: None
Return Type: number
forEachLatLng(callback)
Parameters:
  • callback: (point: LatLng) => void
Return Type: void
getType()
Parameters: None
Return Type: "GeometryCollection"

Returns "GeometryCollection".


LineString class

woosmap.map.Data.LineString
Constructor
LineString(points)
Parameters:

Methods
getAt(n)
Parameters:
  • n: number
Return Type: LatLng

Returns the n-th Point (as LatLng) of the LineString.

getArray()
Parameters: None
Return Type: LatLng[]

Returns the points of the linestring as an array of LatLng.

getLength()
Parameters: None
Return Type: number

Returns the count of points in the linestring.

forEachLatLng(callback)
Parameters:
  • callback: (point: LatLng) => void
Return Type: void
getType()
Parameters: None
Return Type: "LineString"

LinearRing class

woosmap.map.Data.LinearRing
This class extends LineString.
Constructor
LinearRing(points)
Parameters:

Constructs a linear ring.


MultiLineString class

woosmap.map.Data.MultiLineString
Constructor
MultiLineString(linestrings)
Parameters:

Constructs a MultiLineString. A MultiLineString is a collection of LineString.


Methods
getAt(n)
Parameters:
  • n: number
Return Type: LineString

Returns the n-th LineString of the MultiLineString.

getArray()
Parameters: None
Return Type: LineString[]
forEachLatLng(callback)
Parameters:
  • callback: (point: LatLng) => void
Return Type: void
getType()
Parameters: None
Return Type: "MultiLineString"

Returns "MultiLineString".


MultiPoint class

woosmap.map.Data.MultiPoint
Constructor
MultiPoint(points)
Parameters:

Constructs a Multipoint geometry.


Methods
getAt(n)
Parameters:
  • n: number
Return Type: LatLng

Returns n-th Point of the MultiPoint.

getArray()
Parameters: None
Return Type: LatLng[]

Return the array of points

getLength()
Parameters: None
Return Type: number

Returns the length of the multipoint.

forEachLatLng(callback)
Parameters:
  • callback: (point: LatLng) => void
Return Type: void

For each point calls the callback.

getType()
Parameters: None
Return Type: "MultiPoint"

Returns "MultiPoint".


MultiPolygon class

woosmap.map.Data.MultiPolygon
Constructor
MultiPolygon(elements)
Parameters:

Constructs a MultiPolygon geometry. A MultiPolygon is a set of Polygons.


Methods
getAt(n)
Parameters:
  • n: number
Return Type: Polygon

Returns the n-th polygon of the MultiPolygon.

getArray()
Parameters: None
Return Type: Polygon[]

Returns the array of Polygons that makes the MultiPolygon.

getLength()
Parameters: None
Return Type: number

Return the count of Polygon in the MultiPolygon.

forEachLatLng(callback)
Parameters:
  • callback: (point: LatLng) => void
Return Type: void
getType()
Parameters: None
Return Type: string

Returns "MultiPolygon".


Point class

woosmap.map.Data.Point
Constructor
Point(point)
Parameters:

Constructs a Point geometry


Methods
get()
Parameters: None
Return Type: LatLng

Returns the point geometry

forEachLatLng(callback)
Parameters:
  • callback: (point: LatLng) => void
Return Type: void
getType()
Parameters: None
Return Type: "Point"

Returns "Point".


Polygon class

woosmap.map.Data.Polygon
Constructor
Polygon(elements)
Parameters:

Constructs a Polygon, using a set of linear ring.


Methods
getAt(n)
Parameters:
  • n: number
Return Type: LinearRing

Returns the n-th LinearRing of the Polygon.

getArray()
Parameters: None
Return Type: LinearRing[]

Returns the array of LinearRing that composes the Polygon.

getLength()
Parameters: None
Return Type: number

Returns the count of LinearRings that composes the Polygon.

forEachLatLng(callback)
Parameters:
  • callback: (point: LatLng) => void
Return Type: void

For each LinearRing call callback.

getType()
Parameters: None
Return Type: "Polygon"

Returns "Polygon".


DirectionsRenderer class

woosmap.map.DirectionsRenderer
This class extends MVCObject.
Constructor
DirectionsRenderer(options)
Parameters:

Methods
setMap(map)
Parameters:
  • map: Map | null
Return Type: void

Sets the map where to render the directions.

setDirections(directions)
Parameters:
Return Type: void

Sets the directions result to render.

setRouteIndex(routeIndex)
Parameters:
  • routeIndex: number
Return Type: void

Sets the route index in the DirectionResult object to render. By default the first route (0) will be rendered.


Events

This event is triggered when the routeIndex changes.


DirectionsService class

woosmap.map.DirectionsService
Constructor
DirectionsService()
Parameters: None

Methods
route(request, callback)
Parameters:
Return Type: void

Issue a directions search request.


DistanceService class

woosmap.map.DistanceService

A service for computing distances and durations between multiple origins and destinations and retrieving isochrone destinations.

Constructor
DistanceService()
Parameters: None

A service for computing distances and durations between multiple origins and destinations and retrieving isochrone destinations.


Methods
getDistanceMatrix(request)
Parameters:
Return Type: Promise<DistanceMatrixResponse>

Retrieves distances and durations for the supplied matrix request.

getDistanceIsochrone(request)
Parameters:
Return Type: Promise<DistanceIsochroneResponse>

Find all destinations that can be reached in a specific amount of time or a maximum travel distance based on the supplied isochrone request.


Drawing class

woosmap.map.Drawing
This class extends MapboxDraw.

Add drawing capabilities to Woosmap Map. You can call methods of a Drawing instance and add custom modes as you would with a MapboxDraw instance. This Drawing library is not loaded by default when you load the Map JS API but must be explicitly specified through use of a libraries parameter in SDK URL.

Add the Drawing Lib

HTML
        <script async
    src="https://sdk.woosmap.com/map/map.js?key=YOUR_API_KEY&libraries=drawing&callback=initMap">
</script>

    

Create a Draw control and add it to the map

JavaScript
        var draw = new woosmap.map.Drawing(drawOptions);
draw.addControl(map);

    
Constructor
Drawing(options?)
Parameters:

Methods
addControl(map, position?)
Parameters:
  • map: Map The map object to add control to.
  • position: ControlPositionType Position on the map to which the control will be added. Defaults to ‘top-right’.
Return Type: void

Adds Drawing Control to a Map.

removeControl()
Parameters: None
Return Type: void

Removes Drawing Control to its attached Map.

addListener(event, handler)
Parameters:
Return Type: void

Register Drawing Events


InfoWindow class

woosmap.map.InfoWindow
This class extends woosmap.map.MVCObject.
Constructor
InfoWindow(options)
Parameters:

Methods
open(map, anchor)
Parameters:
Return Type: void

Opens the info window.

close()
Parameters: None
Return Type: void

Closes this InfoWindow by removing it from the DOM structure.

setContent(content)
Parameters:
  • content: string
Return Type: void

Sets the info window content

setPosition(positionOrMarker)
Parameters:
Return Type: void

Sets the anchor

setOffset(offset)
Parameters:
Return Type: void

Sets the offset

setMarker(marker?)
Parameters:
Return Type: void

Sets the marker

setMap(map)
Parameters:
  • map: Map | null
Return Type: void

Sets the info window map.

getMap()
Parameters: None
Return Type: (Map | null)

Gets the current map bound to the


LatLng class

woosmap.map.LatLng
Constructor
LatLng(lat, lng?)
Parameters:

Creates a LatLng object representing a geographic point. Latitude is specified in degrees within the range [-90, 90]. Longitude is specified in degrees within the range [-180, 180]. Set noWrap to true to enable values outside of this range. Note the ordering of latitude and longitude.


Properties
Type: () => number

Returns the latitude in degrees.

Type: () => number

Returns the longitude in degrees.


Methods
equals(other)
Parameters:
Return Type: boolean

Comparison function.

toJSON()
Parameters: None
Return Type: LatLngLiteral

Converts to JSON representation. This function is intended to be used via JSON.stringify.

toString()
Parameters: None
Return Type: string

LatLngBounds class

woosmap.map.LatLngBounds
Constructor
LatLngBounds(northEast?, southWest?)
Parameters:

Creates a LatLngBounds object


Methods
extend(latlng)
Parameters:
Return Type: void

Extends the current bounds with point.

contains(latlng)
Parameters:
Return Type: boolean

Checks if current bounds contain latlng.

intersects(other)
Parameters:
Return Type: boolean

Checks if bounds are intersecting with other.

union(other)
Parameters:
Return Type: void

Computes the union of this bounds and other.

getNorthEast()
Parameters: None
Return Type: LatLng

Returns the north-east corner of this bounds.

getSouthWest()
Parameters: None
Return Type: LatLng

Returns the south-west corner of this bounds.

getCenter()
Parameters: None
Return Type: LatLng

Computes the center of the latlng bounds.

isEmpty()
Parameters: None
Return Type: boolean

Checks if the current bounds are empty.


LocalitiesService class

woosmap.map.LocalitiesService

Contains methods related to retrieving autocomplete predictions, geocoding for localities and retrieving details

Constructor
LocalitiesService()
Parameters: None

Contains methods related to retrieving autocomplete predictions, geocoding for localities and retrieving details


Methods
autocomplete(request)
Parameters:
Return Type: Promise<LocalitiesAutocompleteResponse>

Retrieves localities autocomplete predictions based on the supplied autocomplete request.

geocode(request)
Parameters:
Return Type: Promise<LocalitiesGeocodeResponse>

Retrieves localities results based on the supplied geocode request.

getDetails(request)
Parameters:
Return Type: Promise<LocalitiesDetailsResponse>

Retrieves details about the locality identified by the given public_id


MVCArray class

woosmap.map.MVCArray
This class extends woosmap.map.MVCObject.
Constructor
MVCArray(array?)
Parameters:
  • array: T[]

Methods
clear()
Parameters: None
Return Type: void

Removes all elements from the array.

forEach(callback)
Parameters:
  • callback: (element: T, index: number) => void
Return Type: void

Iterate over each element, calling the provided callback. The callback is called for each element like: callback(element, index).

getArray()
Parameters: None
Return Type: T[]
getAt(i)
Parameters:
  • i: number index
Return Type: T

Get the element at the specified index.

getLength()
Parameters: None
Return Type: number

Get the number of elements in this array.

insertAt(i, elem)
Parameters:
  • i: number
  • elem: T
Return Type: void

Inserts an element at the specified index.

pop()
Parameters: None
Return Type: T

Removes the last element of the array and returns that element.

push(elem)
Parameters:
  • elem: T
Return Type: number

Adds one element to the end of the array and returns the new length of the array.

removeAt(i)
Parameters:
  • i: number
Return Type: T

Removes an element from the specified index.

setAt(i, elem)
Parameters:
  • i: number
  • elem: T
Return Type: void

Sets an element at the specified index.

indexOf(elem)
Parameters:
  • elem: T
Return Type: number

Returns the index of a given element.


MVCObject class

woosmap.map.MVCObject

Constructor for MVCObject.

Constructor
MVCObject()
Parameters: None

Constructor for MVCObject.


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

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

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

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

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

Returns the value of the property specified by key

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

Sets value to key on this.

setOptions(keyValuePairs)
Parameters:
  • keyValuePairs: object an object containing key => value of properties to change
Return Type: void

Set all the values of the properties contained in keyValuePairs

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

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

unbindAll()
Parameters: None
Return Type: void

Unbind all bound properties on this object

addListener(eventName, handler)
Parameters:
  • eventName: String
  • handler: Function
Return Type: MapEventListener

Adds a listener for eventName.


Map class

woosmap.map.Map
This class extends woosmap.map.MVCObject.
Constructor
Map(mapDiv, options?)
Parameters:
  • mapDiv: HTMLElement | string HTMLElement | string
  • options: MapOptions MapOptions

Creates a new map inside the given HTML container, which is typically a DIV element.


Properties
Type: Data

An instance of Data, bound to the map. Add features to this Data object to conveniently display them on this map.


Methods
fitBounds(bounds, padding?, animate?)
Parameters:
Return Type: void

Sets the viewport to contain the given bounds.

getBounds(padding?)
Parameters:
Return Type: LatLngBounds

Returns the lat/lng bounds of the current viewport. Optionally takes a padding parameter.

getCenter()
Parameters: None
Return Type: LatLng

Returns the position displayed at the center of the map.

getDiv()
Parameters: None
Return Type: HTMLElement
getHeading()
Parameters: None
Return Type: number

Returns the compass heading. The heading value is measured in degrees (clockwise) from cardinal direction North.

getTilt()
Parameters: None
Return Type: number

Returns the current angle of incidence of the map, in degrees from the viewport plane to the map plane

getZoom()
Parameters: None
Return Type: number

Returns the current angle of incidence of the map, in degrees from the viewport plane to the map plane.

panBy(x, y)
Parameters:
  • x: number Number of pixels to move the map in the x direction.
  • y: number Number of pixels to move the map in the y direction.
Return Type: void

Changes the center of the map by the given distance in pixels

panTo(latLng, padding?)
Parameters:
Return Type: void

Changes the center of the map to the given LatLng.

flyTo(options)
Parameters:
Return Type: void

Changes any combination of center, zoom, bearing, and pitch, animating the transition along a curve that evokes flight.

panToBounds(latLngBounds, padding)
Parameters:
Return Type: void

Pans the map by the minimum amount necessary to contain the given LatLngBounds. It makes no guarantee where on the map the bounds will be, except that the map will be panned to show as much of the bounds as possible inside {currentMapSizeInPx} - {padding}.

setCenter(center, padding?)
Parameters:
Return Type: void

Sets the map center

setHeading(heading)
Parameters:
  • heading: number
Return Type: void

Sets the compass heading for map measured in degrees from cardinal direction North.

setTilt(tilt)
Parameters:
  • tilt: number
Return Type: void
setZoom(zoom)
Parameters:
  • zoom: number
Return Type: void

Events

This event is fired when the viewport bounds have changed.

This event is fired when the map center property changes.

This event is fired when the user clicks on the map.

This event is fired when the user double-clicks on the map.

This event is repeatedly fired while the user drags the map.

This event is fired when the user stops dragging the map.

This event is fired when the user starts dragging the map.

This event is fired when the map becomes idle after panning or zooming.

This event is fired whenever the user’s mouse moves over the map container.

This event is fired when the user’s mouse exits the map container.

This event is fired when the user’s mouse enters the map container.

This event is fired when the DOM contextmenu event is fired on the map container.

This event is fired when the map zoom property changes.


Marker class

woosmap.map.Marker
This class extends woosmap.map.MVCObject.
Constructor
Marker(options?)
Parameters:

Constructs a Marker


Properties
Type: string
Type: Map | null
Type: LatLng

Methods
setIcon(icon)
Parameters:
  • icon: Icon | string
Return Type: void
setMap(map?)
Parameters:
  • map: (Map | null)
Return Type: void
setOpacity(opacity)
Parameters:
  • opacity: number
Return Type: void

Sets the marker opacity.

getOpacity()
Parameters: None
Return Type: number

Gets the marker opacity.

getPosition()
Parameters: None
Return Type: LatLng

Get the marker’s geographical location.The longitude of the result may differ by a multiple of 360 degrees from the longitude previously set by setLngLat because Marker wraps the anchor longitude across copies of the world to keep the marker on screen.

setPosition(position, animate?, options?)
Parameters:
  • position: LatLng | LatLngLiteral
  • animate: boolean Specifies whether to apply smooth transition between two positions. Animation is disabled by default.
  • options: MarkerAnimateOptions The animation options to apply.
Return Type: void

Sets the position of the marker

getOffset()
Parameters: None
Return Type: Point

Get the marker’s offset.

setOffset(offset)
Parameters:
  • offset: Point The offset in pixels as a {@link PointLike} object to apply relative to the element’s center. Negatives indicate left and up.
Return Type: Marker

Sets the offset of the marker

setDraggable(shouldBeDraggable)
Parameters:
  • shouldBeDraggable: boolean Turns drag functionality on/off
Return Type: Marker

Sets the draggable property and functionality of the marker

getDraggable()
Parameters: None
Return Type: boolean

Returns true if the marker can be dragged

setRotation(rotation)
Parameters:
  • rotation: number The rotation angle of the marker (clockwise, in degrees), relative to its respective {@link Marker#rotationAlignment} setting.
Return Type: Marker

Sets the rotation property of the marker.

getRotation()
Parameters: None
Return Type: number

Returns the current rotation angle of the marker (in degrees).

setRotationAlignment(alignment)
Parameters:
  • alignment: string Sets the rotationAlignment property of the marker.
Return Type: Marker

Sets the rotationAlignment property of the marker.

getRotationAlignment()
Parameters: None
Return Type: string

Returns the current rotationAlignment property of the marker.

setPitchAlignment(alignment?)
Parameters:
  • alignment: string Sets the pitchAlignment property of the marker. If alignment is ‘auto’, it will automatically match rotationAlignment.
Return Type: Marker

Sets the pitchAlignment property of the marker.

getPitchAlignment()
Parameters: None
Return Type: string

Returns the current pitchAlignment property of the marker.


Events

This event is fired when the marker was clicked.

This event is fired when the mouse enters the area of the marker.

This event is fired when the mouse leaves the area of the marker.

This event is fired when markers clickable property changes.

This event is fired when markers cursor property changes.

This event is fired when markers icon property changes.

This event is fired when markers position property changes.

Fired when dragging starts

Fired while dragging

Fired when the marker is finished being dragged

This event is fired when markers draggable property changes.

This event is fired when markers visible property changes.

This event is fired when markers zIndex property changes.


OverlayView class

woosmap.map.OverlayView
Constructor
OverlayView()
Parameters: None

Methods
setMap(map)
Parameters:
  • map: Map | null
Return Type: void

Point class

woosmap.map.Point
Constructor
Point(x, y)
Parameters:
  • x: number
  • y: number

Creates a Point object


Methods
equals(other)
Parameters:
Return Type: boolean

Indicates whether some other object is “equal to” this one.


Polygon class

woosmap.map.Polygon
This class extends BasePolygon.
Constructor
Polygon(options)
Parameters:

Constructs a polygon.


Methods
getPath()
Parameters: None
Return Type: MVCArray<LatLng>

Returns the outer path of the polygon.

getPaths()
Parameters: None
Return Type: MVCArray<MVCArray<LatLng>>

Returns all the path that compose the polygon.

setOptions(options)
Parameters:
Return Type: void

Sets the polygon options.

setPath(path)
Parameters:
Return Type: void

Sets the polygon path.

setPaths(paths)
Parameters:
Return Type: void

Sets the polygon paths.


Polyline class

woosmap.map.Polyline
This class extends BaseGeometry.
Constructor
Polyline(options)
Parameters:

Constructs a Polyline.


Methods
getPath()
Parameters: None
Return Type: MVCArray<LatLng>
setOptions(options)
Parameters:
Return Type: void
setPath(path)
Parameters:
Return Type: void

Rectangle class

woosmap.map.Rectangle
This class extends BasePolygon.
Constructor
Rectangle(options)
Parameters:

Constructs a Rectangle.


Methods
getBounds()
Parameters: None
Return Type: LatLngBounds
setBounds(bounds)
Parameters:
Return Type: void
setOptions(options)
Parameters:
Return Type: void

Size class

woosmap.map.Size
Constructor
Size(width, height)
Parameters:
  • width: number
  • height: number

Creates a Size object


Methods
equals(other)
Parameters:
Return Type: boolean

Indicates whether some other object is “equal to” this one.


StoresOverlay class

woosmap.map.StoresOverlay
This class extends woosmap.map.OverlayView.
Constructor
StoresOverlay(style)
Parameters:

Constructs a StoreOverlay


Methods
clearSelection()
Parameters: None
Return Type: void

Clears selected store if any

setSelection(feature)
Parameters:
  • feature: Object
Return Type: void

Sets the selected store

setQuery(query?)
Parameters:
  • query: (string | null)
Return Type: void

Sets the query used to fetch stores. To clear the query set it to undefined.

setMap(map?)
Parameters:
  • map: (Map | null)
Return Type: void

Events

This event is triggered when a store previously selected was unselected.

This event is triggered when a store is selected


StoresService class

woosmap.map.StoresService

Contains methods related to retrieving stores and stores’ bounds.

Constructor
StoresService()
Parameters: None

Contains methods related to retrieving stores and stores’ bounds.


Methods
autocomplete(request)
Parameters:
Return Type: Promise<StoresAutocompleteResponse>

Retrieves stores autocomplete suggestions based on the supplied autocomplete request.

search(request)
Parameters:
Return Type: Promise<StoresSearchResponse>

Searches stores based on the supplied search request.

getStoreById(storeId)
Parameters:
  • storeId: string The store ID.
Return Type: Promise<StoreResponse>

Retrieves a store object based on the supplied store ID.

getBounds(request)
Parameters:
Return Type: Promise<StoresBoundsResponse>

Retrieves bounds of stores based on the supplied bounds search request.


Feature class

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

Constructs a new Data.Feature


Methods
getGeometry()
Parameters: None

Returns the feature geometry.

setGeometry(geometry)
Return Type: void

Set the feature geometry.

getId()
Parameters: None
Return Type: string

Returns the feature id.

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

Returns the feature property

removeProperty(name)
Parameters:
  • name: string
Return Type: void

Removes property

setProperty(name, newValue)
Parameters:
  • name: string
  • newValue: any
Return Type: void

Sets the value of the specified property. If newValue is undefined this is equivalent to calling removeProperty.

toGeoJson(callback)
Parameters:
Return Type: void

Exports the feature to a GeoJSON object.


Events

This event is triggered when geometry is set.

This event is triggered when a property is removed.

This event is triggered when a property is set.


APIError class

woosmap.map.errors.APIError
This class extends Error.
Constructor
APIError()
Parameters: None

Properties
Type: number

The http Status code extracted from the response.


BadRequestError class

woosmap.map.errors.BadRequestError
This class extends APIError.
Constructor
BadRequestError(message?)
Parameters:
  • message: string

ForbiddenError class

woosmap.map.errors.ForbiddenError
This class extends APIError.
Constructor
ForbiddenError(message?)
Parameters:
  • message: string

InternalServerError class

woosmap.map.errors.InternalServerError
This class extends APIError.
Constructor
InternalServerError(message?)
Parameters:
  • message: string

NotFoundError class

woosmap.map.errors.NotFoundError
This class extends APIError.
Constructor
NotFoundError(message?)
Parameters:
  • message: string

TooManyRequestsError class

woosmap.map.errors.TooManyRequestsError
This class extends APIError.
Constructor
TooManyRequestsError(message?)
Parameters:
  • message: string

UnauthorizedError class

woosmap.map.errors.UnauthorizedError
This class extends APIError.
Constructor
UnauthorizedError(message?)
Parameters:
  • message: string

AutocompleteMatchedSubstring Interface

Properties
Type: number
Type: number

CircleOptions Interface

Properties
Type: (LatLng | null) | (LatLngLiteral | null)

The center of the circle.

Type: (number | null)

The radius of the circle.


ControlPositionType Interface

Type: "top-left" | "top-right" | "bottom-left" | "bottom-right"

Coordinates Interface

Type: [number, number]

Geometry Interface

Methods
getType()
Parameters: None
Return Type: T

Returns the type of the geometry.


DirectionLeg Interface

Properties
Type: Distance
Type: Duration
Type: string
Type: number
Type: string
Type: number

DirectionRequest Interface

Properties
Type: string

Valid values are a timestamp (e.g. 1600799173 for the date:22/09/2020 20:26:13) or now. Use either arrival_time or departure_time, not both.

Type: string

Valid values are a timestamp (e.g. 1600799173 for the date:22/09/2020 20:26:13) or now. Use either arrival_time or departure_time, not both.

Type: "none" | "full"

When set to full the response will contain detailed driving instructions.

Type: boolean
Type: string
Type: string

DirectionResult Interface

Properties
Type: string

DirectionRoute Interface

Properties
Type: DirectionLeg[]
Type: string

additional information of the route.

Type: LatLng[]

The decoded overview path.

The encoded overview polyline.


DirectionStep Interface

Properties
Type: string
Type: string
Type: string

DirectionStepInstructions Interface

Properties
Type: number
Type: string
Type: string
Type: string
Type: string
Type: string

DirectionsBounds Interface

Properties

DirectionsOverviewPolyline Interface

Properties
Type: string

Contains encoded polyline.


DirectionsRendererOptions Interface

Properties
Type: boolean
Type: Map
Type: Object
Type: boolean
Type: number
Type: boolean
Type: boolean
Type: boolean
Type: boolean

DirectionsWayPoint Interface

Properties

Waypoint location.

Type: boolean

If set to true the route will be splitted into two legs.


Distance Interface

A representation of distance as a numeric value and a display string.

Properties
Type: string
Type: number

Duration Interface

A representation of duration as a numeric value and a display string.

Properties
Type: string
Type: number

FeatureData Interface

Properties
Type: any
Type: Object

FlyToOptions Interface

Properties
Type: boolean

Controls weather to animate or not.

If zoom is specified, around determines the point around which the zoom is centered.

Type: number

The target bearing in degrees.

The target center.

Type: number

The animation’s duration (in milliseconds).

Type: (_: number) => number

A function taking a time in the range 0..1 and returning a number where 0 is the start state and 1 is the final state.

Type: boolean

If false, then the animation can be avoided if the user browser has prefers-reduced-motion turned on.

The target center relative to real map container center at the end of animation.

Type: Padding

Padding to apply when centering the map.

Type: number

The target pitch (angle towards horizon) in degrees.

Type: number

The target zoom level.


GeoJSONFeature Interface

Properties
Type: number | string
Type: {}
Type: "Feature"

GeoJSONFeatureCollection Interface

Properties
Type: "FeatureCollection"

GeoJSONGeometry Interface

GeoJSONGeometryCollection Interface

Properties
Type: "GeometryCollection"

GeoJSONLineString Interface

Type: GeoJSONRawGeometry<"LineString", GeoJSONPosition[]>

GeoJSONMultiLineString Interface

Type: GeoJSONRawGeometry<"MultiLineString", GeoJSONPosition[][]>

GeoJSONMultiPoint Interface

Type: GeoJSONRawGeometry<"MultiPoint", GeoJSONPosition[]>

GeoJSONMultiPolygon Interface

Type: GeoJSONRawGeometry<"MultiPolygon", GeoJSONPosition[][][]>

GeoJSONPoint Interface

GeoJSONPolygon Interface

Type: GeoJSONRawGeometry<"Polygon", GeoJSONPosition[][]>

GeoJSONPosition Interface

Type: [number, number]

GeoJSONRawGeometry Interface

Properties
Type: C
Type: T

GeometryArray Interface

GeometryClasses Interface

GeometryCollectionElement Interface

GeometryData Interface

Properties
Type: any
Type: GeometryData[]

GeometryOptions Interface

Properties
Type: (boolean | null)
Type: (boolean | null)
Type: (boolean | null)
Type: (boolean | null)
Type: (Map | null)
Type: (string | null)
Type: (number | null)
Type: string
Type: (number | null)
Type: (boolean | null)

Whether the Geometry is visible or not.

Type: (number | null)

GeometryType Interface

Type: "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "LinearRing" | "Polygon" | "MultiPolygon" | "GeometryCollection"

GestureHandlingMode Interface

Type: "none" | "greedy" | "cooperative" | "auto"

Icon Interface

Properties
Type: string

IconSequence Interface

Properties
Type: (boolean | null)
Type: (SymbolIcon | null)
Type: (string | null)
Type: (string | null)

InfoWindowOptions Interface

Properties
Type: (string | Node | null)

Content to display in the InfoWindow. This can be an HTML element, a plain-text string, or a string containing HTML. The InfoWindow will be sized according to the content.

Type: (boolean | null)

Disable auto-pan on open. By default, the info window will pan the map so that it is fully visible when it opens.

Type: (number | null)

Maximum width of the infowindow, regardless of content’s width. This value is only considered if it is set before a call to open.

Type: Point

The offset, in pixels, of the tip of the info window from the point on the map at whose geographical coordinates the info window is anchored.


LatLngBoundsLiteral Interface

Properties
Type: number
Type: number
Type: number
Type: number

LatLngLiteral Interface

Properties
Type: number

Latitude in degrees. Values will be clamped to the range [-90, 90]. This means that if the value specified is less than -90, it will be set to -90. And if the value is greater than 90, it will be set to 90.

Type: number

Longitude in degrees. Values outside the range [-180, 180] will be wrapped so that they fall within the range. For example, a value of -190 will be converted to 170. A value of 190 will be converted to -170. This reflects the fact that longitudes wrap around the globe.


MapEventListener Interface

An event listener, created by woosmap.map.event.addListener() and friends.

Methods
remove()
Parameters: None
Return Type: void

Calling listener.remove() is equivalent to woosmap.map.event.removeListener(listener).


MapOptions Interface

MapOptions object used to define the properties that can be set on a Map.

Properties

The initial map center to start from.

Type: string
Type: boolean

Disable the rendering of the buildings in 3D when the map is pitched.

Type: boolean

Disables the default maps controls interface, (default: false).

Type: boolean

Disable the tilt control for the users, (default: false).

This option controls how the gesture are handled Depending on the value when gesture on the map is detected (scroll on desktop, one finger pan on mobile) an overlay asking the user to use Cmd or Ctrl while scrolling or use two finger gesture to pan on mobile will be shown.

  • cooperative: Shows the overlay only if the page is scrollable.
  • greedy: Never shows the overlay.
  • none: Disables gesture handling. The map cannot be zoomed or paned using gestures.
  • auto: (default) Use cooperative mode if the page is scrollable, else use greedy mode.
Type: number

The initial heading to start from.

Type: (MapStyleSpec[] | null)
JSON
        [
  {
    "featureType": "poi",
    "stylers": [{
      "visibility": "on"
    }]
  },
  {
    "featureType": "water",
    "stylers": [{
        "saturation": -100
    }]
  }
]

    
Type: number

The initial tilt to start from.

Type: number

The initial map zoom level to start from.


MapPanes Interface

Properties
Type: Element

This pane contains the info window. It is above all map overlays. (Pane 4).

Type: Element
Type: Element

This pane is the lowest pane and is above the tiles. It does not receive DOM events. (Pane 0).

Type: Element

This pane contains polylines, polygons, ground overlays and tile layer overlays. It does not receive DOM events. (Pane 1).

Type: Element

This pane contains elements that receive DOM events. (Pane 3).


MapStyleSpec Interface

Properties
Type: string

The group of elements, to which stylers will be applied. default value: “all”

Type: string

The group of feature, to which stylers will be applied. default value: “all”

Type: MapStyler[]

The rules to apply to the selected features.


MapStyler Interface

Properties
Type: string

The color to use to style features. Expected to be in hex form #RRBBGG.

Type: number

Applies a gamma correction on lightness.

Type: string

The color to extract the hue from. The lightness and saturation will be kept from the original color.

Type: boolean

Inverts the lightness.

Type: number

Changes the lightness.

Type: number

Changes the saturation

Type: string

Sets the visibility of the selected features. Expected to be in hex form #RRBBGG. expected values are “on”, “off”

Type: number

Changes the weight of drawn features (mostly lines, labels outline).


MarkerAnimateOptions Interface

Properties
Type: Function

A callback function to be called after setting the position. null as default

Type: number

The animation’s duration (in milliseconds).


MarkerLabel Interface

Properties
Type: string

The color of the label. Default to: black.

Type: string

The font size of the label in pixels. Default to: 14px.

Type: number
Type: string

The text to be displayed in the label.


MarkerLabelOptions Interface

Properties
Type: (string | null)

A custom className property to be applied to the label’s element.

Type: (string | null)

The color of the label text. (black by default).

Type: (string | null)

The font family for the label.

Type: (string | null)

The font size for the label.

Type: (string | null)

The font weight for the label.

Type: string

The text to be displayed in the label.


MarkerOptions Interface

Properties
Type: Point

The offset from the marker’s position to the tip of an InfoWindow that has been opened with the marker as anchor.

Type: boolean

If true the marker receive the click events. Default value is true.

Type: boolean
Type: string | Icon

The icon to display. When icon is a string it is treated as Icon with the string as url property.

Type: string | MarkerLabelOptions

Adds a letter or number label inside a marker.

Type: Map

The Map where the marker should be displayed.

Type: number

The marker’s opacity (min: 0, max: 1)

The markers’s position.

Type: (string | null)
Type: boolean

If true the marker will be visible. Default value is true


MatchedSubstring Interface

Properties

Padding Interface

Properties
Type: number
Type: number
Type: number
Type: number

Pagination Interface

Properties
Type: number
Type: number

PointLiteral Interface

Properties
Type: number

x coordinate *

Type: number

y coordinate *


PolygonFillOptions Interface

Properties
Type: (string | null)
Type: (number | null)

PolygonOptions Interface

Properties
Type: (MVCArray<MVCArray<LatLng>> | null) | MVCArray<LatLng> | Array<Array<LatLng | LatLngLiteral>> | Array<LatLng | LatLngLiteral>

The paths of the polygon.


PolylineOptions Interface

Properties
Type: (MVCArray<LatLng> | null) | LatLng[] | LatLngLiteral[]

The path of the polyline.


RectangleOptions Interface

Properties
Type: (LatLngBounds | null) | (LatLngBoundsLiteral | null)

The bounds of the Rectangle.


SizeLiteral Interface

Properties
Type: number
Type: number

Style Interface

Properties
Type: number
Type: StyleRule

StyleFunction Interface

Type: (feature: Feature) => StyleOptions

StyleOptions Interface

Properties
Type: Animation
Type: boolean
Type: string
Type: boolean
Type: boolean
Type: string
Type: number
Type: string | Icon
Type: string
Type: IconSequence[]
Type: string | MarkerLabel
Type: number
Type: string
Type: number
Type: number
Type: string
Type: boolean
Type: number

StyleRule Interface

Properties
Type: string
Type: Icon
Type: number
Type: Icon
Type: number

SymbolIcon Interface

Properties
Type: (Point | null)

The position of the symbol relative to the marker or polyline. The coordinates of the symbol’s path are translated left and up by the anchor’s x and y coordinates respectively. By default, a symbol is anchored at(0, 0). The position is expressed in the same coordinate system as the symbol’s path.

Type: (string | null)

The symbol’s fill color. All CSS3 colors are supported except for extended named colors. For symbol markers, this defaults to ‘black’. For symbols on polylines, this defaults to the stroke color of the corresponding polyline.

Type: (number | null)

The symbol’s fill opacity. Defaults to 0.

Type: (Point | null)

The origin of the label relative to the origin of the path, if label is supplied by the marker. By default, the origin is located at(0, 0). The origin is expressed in the same coordinate system as the symbol’s path. ` This property is unused for symbols on polylines.

Type: string

The symbol’s path, which is a built-in symbol path, or a custom path expressed using SVG path notation.

Type: (number | null)

The angle by which to rotate the symbol, expressed clockwise in degrees. Defaults to 0. A symbol in an IconSequence where fixedRotation is false is rotated relative to the angle of the edge on which it lies.

Type: (number | null)

The amount by which the symbol is scaled in size. For symbol markers, this defaults to 1; after scaling, the symbol may be of any size. For symbols on a polyline, this defaults to the stroke weight of the polyline; after scaling, the symbol must lie inside a square 22 pixels in size centered at the symbol’s anchor.

Type: (string | null)

The symbol’s stroke color. All CSS3 colors are supported except for extended named colors. For symbol markers, this defaults to ‘black’. For symbols on a polyline, this defaults to the stroke color of the polyline.

Type: (number | null)

The symbol’s stroke opacity. For symbol markers, this defaults to 1. For symbols on a polyline, this defaults to the stroke opacity of the polyline.

Type: (number | null)

The symbol’s stroke weight. Defaults to the scale of the symbol.


TypedStyleRule Interface

Properties
Type: string
Type: Icon
Type: Icon
Type: string

DistanceIsochroneRequest Interface

A Distance Isochrone request to be sent to DistanceService.getDistanceIsochrone containing an origin and a distance value as minutes or kilometers.

Properties
Type: boolean

If true, instructs the Distance service to avoid ferries where possible. Optional.

Type: boolean

If true, instructs the Distance service to avoid highways where possible. Optional.

Type: boolean

If true, instructs the Distance service to avoid toll roads where possible. Optional.

Type: LatLng[][] | LatLngLiteral[][]

If set, instructs the Distance service to avoid the specific polygons.

Type: string

Defines in which language the results should be returned, if possible

Type: "time" | "distance"

Defines the method to compute the rpute between the start point and the end point. time for the fastest route and distance for the shortest route.

The starting point.

Type: string

The travel mode requested. see woosmap.map.TravelMode

Type: string

The unit system requested. see UnitSystem

Type: number

The value to use for isochrone contour. You can specify time in minutes or distance in kilometers (cf. method parameter). The maximum value that can be specified is 120 (120 minutes : 2 hours or 120 km).


DistanceIsochroneResponse Interface

The response to a DistanceService.getDistanceIsochrone request, consisting of a status, and a DistanceIsoline object.

Properties
Type: string

The message describing a Distance Isochrone API request error. Present only if status is not OK.

Contains the properties of isoline

Type: string

The status returned. see woosmap.map.distance.DistanceServiceStatus {DistanceServiceStatus}


DistanceIsoline Interface

The isochrone object which represents a line of points of equal travel time or distance around the given origin.

Properties
Type: Distance

The distance of the isochrone (returned only if method=distance in parameters)

Type: string

The encoded polyline of the isoline.

An object describing the input location with Latitude and Longitude in decimal degrees.

Type: LatLng[]

The decoded polyline of the isoline.

Type: Duration

The time of the isochrone (returned as default or when specifying method=time in parameters)


DistanceMatrixElement Interface

A single Distance Matrix element which contains the status, duration and distance from one origin to one destination.

Properties
Type: Distance

The total distance of this matrix element expressed in meters (value) and as text.

Type: Duration

The total duration of this matrix element, expressed in seconds (value) and as text.

Type: "OK" | "NOT_FOUND" | "ZERO_RESULTS"

Status returned for Distance Matrix Element.

  • OK indicates the response contains a valid result.
  • NOT_FOUND indicates that the origin and/or destination of this pairing could not be matched to the network.
  • ZERO_RESULTS indicates no route could be found between the origin and destination.

DistanceMatrixRequest Interface

A Distance Matrix request to be sent to DistanceService.getDistanceMatrix containing a list of origins and a list of destinations.

Properties
Type: boolean

If true, instructs the Distance service to avoid ferries where possible. Optional.

Type: boolean

If true, instructs the Distance service to avoid highways where possible. Optional.

Type: boolean

If true, instructs the Distance service to avoid toll roads where possible. Optional.

Type: LatLng[][] | LatLngLiteral[][]

If set, instructs the Distance service to avoid the specific polygons.

Type: Date | string

By using this parameter, Distance will calculate the duration with traffic Specifies the date/time at which to base the calculations on for traffic purposes. Valid values are a Date or a string timestamp or “now”.

Type: LatLng[] | LatLngLiteral[]

An array containing destinations latlng to which to calculate distance and time. Required.

Type: "distance" | "duration" | "duration_distance"

Defines element values that will be part of the response (distance and/or duration). if not specified default is distance

Type: string

Defines in which language the results should be returned, if possible

Type: "time" | "distance"

Defines the method to compute the rpute between the start point and the end point. time for the fastest route and distance for the shortest route.

Type: LatLng[] | LatLngLiteral[]

An array containing origins latlng from which to calculate distance and time. Required.

Type: string
Type: string

The unit system requested. see UnitSystem


DistanceMatrixResponse Interface

The response to a DistanceService.getDistanceMatrix request, consisting of a status, and a list of DistanceMatrixResponseRows, one for each corresponding origin location.

Properties
Type: string

The message describing a Distance Matrix API request error. Present only if status is not OK.

The rows of the matrix, corresponding to the origin locations.

Type: string

The status returned. see woosmap.map.distance.DistanceServiceStatus {DistanceServiceStatus}


DistanceMatrixResponseRow Interface

A row of the DistanceMatrixResponse,consisting of a list of DistanceMatrixElements, one for each corresponding destination locations.

Properties

The row’s elements, corresponding to the destination locations.


AddressComponents Interface

Properties
Type: string | string[]
Type: string | string[]
Type: string[]

LocalitiesAutocompleteRequest Interface

A Localities autocompletion request to be sent to LocalitiesService.autocomplete

Properties

Used to filter over countries. Countries must be passed as an ISO 3166-1 Alpha-2 or Alpha-3 compatible country code.

Type: string

To set the description format for all or some of the suggestion types selected. see https://developers.woosmap.com/products/localities/autocomplete/#custom_description

To open suggestions to worldwide postal codes in addition to postal codes for Western Europe.

Type: string

If set, this parameter allows a refined search over locality names that bears the same postal code. possible value is extended=postal_code

Type: string

The user entered input string.

Type: string

The language code, using ISO 3166-1 Alpha-2 country codes, indicating in which language the results should be returned, if possible. If language is not supplied, the Localities service will use english as default language. No language necessary for postal_code request.

Location for prediction biasing. The location defines the point around which to retrieve predictions in priority.

Type: number

This parameter may be used in addition to the location parameter to define the distance in meters within which the API will return results in priority. Results outside the defined area may still be displayed. Default radius if this parameter is not set is 100 000.

Type: string | string[]

The types of predictions to be returned. By default, suggestions return types locality and postal_code. can be either a single type or a list of LocalitiesTypes see https://developers.woosmap.com/products/localities/autocomplete/#types


LocalitiesAutocompleteResponse Interface

A Localities Autocomplete response returned by the call to LocalitiesService.autocomplete containing a list of LocalitiesPredictions.

Properties

LocalitiesComponentRestrictions Interface

Restricts predictions to the specified country (ISO 3166-1 Alpha-2 or Alpha-3 compatible country code, case-insensitive). For example, ‘FR’, ‘GB’, or ‘DE’. You can provide a single one, or an array of country code strings.

Properties
Type: string | string[]

LocalitiesDetailsAccuracy Interface

Type: "ROOFTOP" | "DISTRICT" | "POSTAL_CODE" | "ROUTE"

This accuracy is present when type address is returned. DISTRICT and POSTAL_CODE are for UK only.

LocalitiesDetailsGeometry Interface

Details geometry, contains a location and optionally bounds viewport.

Properties

LocalitiesDetailsRequest Interface

A Localities details query to be sent to the LocalitiesService.

Properties
Type: "alpha2" | "alpha3"

To specify the format for the short country code expected to be returned in the address_components field. Default is the format used to specify components or alpha2 if no components are specified.

Type: "geometry"

Used to limit the returning fields when type=address. by default, and for other types localities, all fields are return. Only one field is available: geometry.

Type: string

The language code, using ISO 3166-1 Alpha-2 country codes, indicating in which language the results should be returned, if possible. If language is not supplied, the Localities service will use english as default language. No language necessary for postal_code request.

Type: string

A textual identifier that uniquely identifies a locality, returned from a LocalitiesService.autocomplete.


LocalitiesDetailsResponse Interface

A Localities Details response returned by the call to LocalitiesService.getDetails containing a LocalitiesDetailsResult.

Properties

LocalitiesDetailsResult Interface

Defines information about a Locality.

Properties

An array containing Address Components with additional information

Type: string

Contains the readable text description of the result.

The location of the result, in latitude and longitude, eventually associated with a Viewport. Accuracy is also provided for locality of type Address.

Type: string

The postal code name if locality is typeof postal_code

Type: string

Contains a unique ID for each suggestion.

Type: "not_yet_built"

This optional field is only available for UK addresses referenced as not yey built.

available localities types


LocalitiesDetailsSummary Interface

Human readable description of an address and the unique public_id of the address

Properties
Type: string
Type: string

LocalitiesGeocodeGeometry Interface

Defines information about the geometry of a Locality.

Properties

LocalitiesGeocodeLocationType Interface

Type: "ROOFTOP" | "DISTRICT" | "POSTAL_CODE" | "ROUTE"

Defines the type of the returned geocoded element.

LocalitiesGeocodeRequest Interface

A Localities Geocode request to be sent to LocalitiesService.geocode Requires an address string to perform a geocode request or a latlng object for a reverse geocode request.

Properties
Type: string

The input string to geocode. Can represent an address, a street, a locality or a postal code.

Used to filter over countries. Countries must be passed as an ISO 3166-1 Alpha-2 or Alpha-3 compatible country code.

Type: "alpha2" | "alpha3"

To specify the format for the short country code expected to be returned in the address_components field. Default is the format used to specify components or alpha2 if no components are specified.

Whether to retrieve suggestions to worldwide postal codes in addition to postal codes for Western Europe.

Type: "geometry"

Used to limit the returning fields when type=address. by default, and for other types localities, all fields are return. Only one field is available: geometry.

Type: string

The language code, using ISO 3166-1 Alpha-2 country codes, indicating in which language the results should be returned, if possible. If language is not supplied, the Localities service will use english as default language. No language necessary for postal_code request.

The latLng parameter is used for reverse geocoding, it’s required if the address parameter is missing.

Type: boolean

When latlng parameter is used for reverse geocoding, setting list_sub_building=true allows to retrieve all addresses at the same location for a common street number or building.


LocalitiesGeocodeResponse Interface

A Localities Geocode response returned by the call to LocalitiesService.geocode containing a list of LocalitiesGeocodeResult.

Properties

LocalitiesGeocodeResult Interface

Defines information about a Geocoded Locality.

Properties

An array containing Address Components with additional information

Type: string

Contains the readable text description of the result.

The location of the result, in latitude and longitude, eventually associated with a Viewport. Accuracy is also provided for locality of type Address.

Type: string

Contains a unique ID for geocoded locality.

Type: "not_yet_built"

This optional field is only available for UK addresses referenced as not yey built.

When reverse geocoding with list_sub_buildings=true, this field will contain a list of precise addresses that can be found at that location, i.e. all flats within a building.

available localities types


LocalitiesGeocodeTypes Interface

Type: "address" | "locality" | "postal_code" | "route"

Defines the type of the returned geocoded element.

LocalitiesPredictions Interface

Represents a single locality prediction

Properties
Type: string

Concatenation of name, admin_1, admin_0 or requested customDescription. The description can vary depending on the type requested

Type: boolean

On the specific territory of United Kingdom, Localities autocomplete request can return the additional attribute has_addresses for a postal code, which indicates if a postal code bears addresses. When has_addresses is true, it is possible to display a list of the available addresses by requesting details with the Localities public_id.

Contains a set of substrings for each field that match elements in the input. It can be used to highlight those substrings.

Type: string

Contains a unique ID for locality. This ID is required to perform LocalitiesService.getDetails request.

Contains the type of the Localities prediction.


LocalitiesRequestData Interface

Type: "standard" | "advanced"

The advanced value opens suggestions to worldwide postal codes in addition to postal codes for Western Europe. default to standard

LocalitiesTypes Interface

Type: "address" | "locality" | "admin_level" | "airport" | "amusement_park" | "art_gallery" | "country" | "metro_station" | "museum" | "postal_code" | "shopping" | "tourist_attraction" | "train_station" | "zoo"

The types of suggestion to return. By default, suggestions return types locality and postal_code. Check full list of supported types

Store Interface

Defines information about a Store.

Properties

Defines an object containing the separate components applicable to this address.

Defines an object containing the store’s contact available information.

Type: number

Defines the distance in meters from the position if you set lat and lng in your StoresSearchRequest.

Type: string | null

Defines the previous date timestamp when the store has been updated

Type: string

the store’s name

Type: StoreOpen

The current opening status for a store

Type: StoreOpeningHours | null

Defines the opening hours of a store.

Type: string

A textual identifier that uniquely identifies a store

Type: string[]

Contains an array of tags describing the store.

Type: string[]

Contains an array of types describing the store.

Type: any

Contains all additional information relative to a store. No restriction regarding the types of data in it (Arrays, Object, Boolean, String, Numeric…) but you can only query for text matching, numerical comparison or boolean.

The current Weekly Opening taking into account the special hours


StoreAddress Interface

Defines information about a store address.

Properties
Type: string

A city where belongs a store

Type: string | null

An ISO_3166-1 Country Code where the store is located(see https://en.wikipedia.org/wiki/ISO_3166-1 for full list)

Type: string[]

An array for lines of a store Address

Type: string

A Zipcode / Postal code of a store address


StoreContact Interface

Defines information about a store contact.

Properties
Type: string

Contains the store’s email contact.

Type: string

Contains the store’s phone number in its local format.

Type: string

The website contact for this store, such as a business’ homepage.


StoreOpen Interface

Defines the current opening status for a store

Properties
Type: boolean

Defines if the store is currently opened.

Type: number

Represents the day number of the week. possible values are: 1 | 2 | 3 | 4 | 5 | 6 | 7


StoreOpenNextOpening Interface

Defines the next opening hours period

Properties
Type: string
Type: string
Type: string

StoreOpeningHours Interface

Describes the opening hours of a store.

Properties
Type: any

Defines the special opening hours of a store. The format for defining opening and closing hours for a particular day is the same as the usual. Instead of using numeric week day for keys you must use a date YYYY-MM-DD like “2015-03-08” example: `special:{“2015-03-08”: {start:”14:00”, end:”16:00”}}

Type: string

Timezone for the Opening Hours of a store. It is used to compute the open_now property of an asset. see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

Defines the usual opening hours of a store.


StoreOpeningHoursPeriod Interface

Defines the hours for an opening period. To set a slice of time when the asset is open you must define a start and end keys. start and end must belong to the same day (crossing midnight may result in open_now being always false.)

Properties
Type: boolean
Type: string
Type: string

StoreOpeningHoursUsual Interface

Defines the usual opening hours of a store. The key defines the day number. It can be from “1” for monday up to “7” for sunday.

Properties

StorePrediction Interface

Represents a single store prediction.

Properties
Type: number
Type: string
Type: string
Type: string[]

StoreResponse Interface

A Store Response as a GeoJSON Feature Object returned by the call to StoresService.getStoreById

Properties

Defines the geometry of a store

Type: Store

Defines attributes of a Store

Type: "Feature"

StoreWeeklyOpening Interface

Defines the current Weekly Opening taking into account the special hours. The key defines the day number. It can be from “1” for monday up to “7” for sunday.

Properties
Type: string

StoreWeeklyOpeningHoursPeriod Interface

Defines the weekly opening hours of a store.

Properties
Type: boolean

Define if the hours comes from a special opening hours’ day.


StoresAutocompleteRequest Interface

A Stores Autocomplete request to be sent to StoresService.autocomplete containing a search query as string with localized field to autocomplete stores on localizedNames.

Properties
Type: string

The preferred language to match against name (defaults on Accept-Language header)

Type: number

Limits the number of autocomplete results (default 5, max 50).

Type: string

Example: query=name:'My cool store'|type:'click_and_collect' Search query combining one or more search clauses. Each search clause is made up of three parts structured as field : operator value. example: name:="My cool store"


StoresAutocompleteResponse Interface

A Stores Autocomplete response returned by the call to StoresService.autocomplete containing a list of StorePrediction.

Properties

list of StorePrediction.


StoresBoundsRequest Interface

A Stores Bounds request to be sent to StoresService.getBounds

Properties

To bias the results around a specific latlng

Type: string

Example: query=name:'My cool store'|type:'click_and_collect' Search query combining one or more search clauses. Each search clause is made up of three parts structured as field : operator value. example: name:="My cool store"

Type: number

To bias the results within a given circular area. Unit in meters


StoresBoundsResponse Interface

A Stores Bounds response returned by the call to StoresService.getBounds and containing the bounds of searched stores.

Properties

StoresSearchRequest Interface

A Stores Search request to be sent to StoresService.search containing a search query as string to autocomplete stores on.

Properties

To bias the results around a specific latlng

Type: number

Page number when accessing paginated stores

Type: string

Find stores nearby an encoded polyline and inside a defined radius.

Type: string

Example: query=name:'My cool store'|type:'click_and_collect' Search query combining one or more search clauses. Each search clause is made up of three parts structured as field : operator value. example: name:="My cool store"

Type: number

To bias the results within a given circular area. Unit in meters

Type: number

If your request returns a high number of stores, the result will be paginated. You can then request stores by page using page and storesByPage parameters (Default is 100, max is 300).

Type: boolean

whether to search for stores intersecting a zone


StoresSearchResponse Interface

A Stores Search response as a GeoJSON FeatureCollection Object returned by the call to StoresService.search and containing a list of StoreResponse.

Properties

list of StoreResponse features

Pagination to reach all returned assets. max 300 assets par page.

Type: "FeatureCollection"

DirectionStatus Enum

Constants

TravelMode Enum

The valid travel modes that can be specified in a DistanceRouteRequest, DistanceMatrixRequest or DistanceIsochroneRequest. Specify these by value, or by using the constant’s name. For example, 'WALKING' or woosmap.map.TravelMode.WALKING

Constants

Defines a cycling route request.

Defines a driving route request.

Defines a walking route request.


UnitSystem Enum

The valid unit systems that can be specified in a DistanceRouteRequest, DistanceMatrixRequest or DistanceIsochroneRequest.

Constants

Requests distances to be computed using the imperial system.

Requests distances to be computed using the metric system.


DistanceServiceStatus Enum

The status returned by the DistanceService on the resolve of its searches. Specify these by value, or by using the constant’s name. For example, 'OK' or woosmap.map.distance.DistanceServiceStatus.OK.

Constants

The DistanceSerivce request could not be processed due to a server error. This may indicate that the origin and/or destination of this pairing could not be matched to the network. The request may or may not succeed if you try again.

The provided request was invalid.

The product of origins and destinations exceeds the 200 elements per-query limit.

For Distance matrix or isochrone, it means that of computed routes exceeds the maximum of 500km route length. For DistanceRoute, it means that the computed route exceeds the maximum of 1000km route length.

The response contains a valid result.

The application has gone over its request quota.

The application is not allowed to use the DistanceService.


woosmap.map.event Namespace

Functions
addListener(instance, eventName, handler)
Parameters:
  • instance: Object
  • eventName: string
  • handler: Function
Return Type: MapEventListener

Adds the given listener function to the given event name for the given object instance. Returns an identifier for this listener that can be used with removeListener().

addListenerOnce(instance, eventName, handler)
Parameters:
  • instance: Object
  • eventName: string
  • handler: Function
Return Type: MapEventListener

Like addListener, but the handler removes itself after handling the first event.

addDomListener(element, eventName, handler)
Parameters:
  • element: Element
  • eventName: string
  • handler: Function
Return Type: void
removeListener(listener)
Parameters:
Return Type: void

Removes the given listener, which should have been returned by addListener above. Equivalent to calling listener.remove().

clearInstanceListeners(instance)
Parameters:
  • instance: Object
Return Type: void

Removes all listeners for all events for the given instance.

clearListeners(instance, eventName)
Parameters:
  • instance: Object
  • eventName: string
Return Type: void

Removes all listeners for the given event for the given instance.

trigger(instance, eventName, eventArgs?)
Parameters:
  • instance: Object
  • eventName: string
  • eventArgs: (any[] | null)
Return Type: void

Triggers the given event. All arguments after eventName are passed as arguments to the listeners.


woosmap.map.geometry Namespace

Functions
containsLocation(point, polygon)
Parameters:
Return Type: boolean

Computes whether the given point lies inside the specified polygon.

isLocationOnEdge(point, poly, tolerance?)
Parameters:
Return Type: boolean

Computes whether the given point lies on or near to a polyline, or the edge of a polygon, within a specified tolerance. Returns true when the difference between the latitude and longitude of the supplied point, and the closest point on the edge, is less than the tolerance. The tolerance defaults to 10-9 degrees.


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