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. InfoWindow class
  16. LatLng class
  17. LatLngBounds class
  18. MVCArray class
  19. MVCObject class
  20. Map class
  21. Marker class
  22. OverlayView class
  23. Point class
  24. Polygon class
  25. Polyline class
  26. Rectangle class
  27. Size class
  28. StoresOverlay class
  29. Feature class
  30. CircleOptions Interface
  31. Coordinates Interface
  32. Geometry Interface
  33. DirectionLeg Interface
  34. DirectionRequest Interface
  35. DirectionResult Interface
  36. DirectionRoute Interface
  37. DirectionsBounds Interface
  38. DirectionsOverviewPolyline Interface
  39. DirectionsRendererOptions Interface
  40. DirectionsWayPoint Interface
  41. Distance Interface
  42. Duration Interface
  43. FeatureData Interface
  44. FlyToOptions Interface
  45. GeoJSONFeature Interface
  46. GeoJSONFeatureCollection Interface
  47. GeoJSONGeometry Interface
  48. GeoJSONGeometryCollection Interface
  49. GeoJSONLineString Interface
  50. GeoJSONMultiLineString Interface
  51. GeoJSONMultiPoint Interface
  52. GeoJSONMultiPolygon Interface
  53. GeoJSONPoint Interface
  54. GeoJSONPolygon Interface
  55. GeoJSONPosition Interface
  56. GeoJSONRawGeometry Interface
  57. GeometryArray Interface
  58. GeometryClasses Interface
  59. GeometryCollectionElement Interface
  60. GeometryData Interface
  61. GeometryOptions Interface
  62. GeometryType Interface
  63. GestureHandlingMode Interface
  64. Icon Interface
  65. IconSequence Interface
  66. InfoWindowOptions Interface
  67. LatLngBoundsLiteral Interface
  68. LatLngLiteral Interface
  69. MapEventListener Interface
  70. MapOptions Interface
  71. MapPanes Interface
  72. MapStyleSpec Interface
  73. MapStyler Interface
  74. MarkerLabel Interface
  75. MarkerLabelOptions Interface
  76. MarkerOptions Interface
  77. Padding Interface
  78. PointLiteral Interface
  79. PolygonFillOptions Interface
  80. PolygonOptions Interface
  81. PolylineOptions Interface
  82. RectangleOptions Interface
  83. SizeLiteral Interface
  84. Style Interface
  85. StyleFunction Interface
  86. StyleOptions Interface
  87. StyleRule Interface
  88. SymbolIcon Interface
  89. TypedStyleRule Interface
  90. DirectionStatus Enum
  91. TravelMode Enum
  92. UnitSystem Enum
  93. woosmap.map.event Namespace
  94. 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 woosmap.map.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.


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.


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


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.


CircleOptions Interface

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

The center of the circle.

Type: (number | null)

The radius of the circle.


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

DirectionRequest Interface

Properties
Type: boolean
Type: string
Type: string

DirectionResult Interface

Properties

DirectionRoute Interface

Properties
Type: DirectionLeg[]
Type: LatLng[]

The decoded overview path.

The encoded overview polyline.

Type: string

The description of the route.


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

Properties
Type: string
Type: number

Duration Interface

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: (MapStyleSpec[] | null)
JSON
        [
  {
    "featureType": "poi",
    "stylers": [{
      "visibility": "on"
    }]
  },
  {
    "featureType": "water",
    "stylers": [{
        "saturation": -100
    }]
  }
]

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


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


Padding Interface

Properties
Type: number
Type: number
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

DirectionStatus Enum

Constants

TravelMode Enum

Constants

Requests a route for a bicycle.

Requests a route for a car.

Requests a route for a pedestrian.


UnitSystem Enum

Constants

Requests distances to be computed using the imperial system.

Requests distances to be computed using the metric system.


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