Map JS API v1.4

Map JS API Reference v1.4
  1. BaseGeometry abstract class 
  2. BasePolygon abstract class 
  3. Circle class 
  4. Data class 
  5. Data.GeometryCollection class 
  6. Data.LineString class 
  7. Data.LinearRing class 
  8. Data.MultiLineString class 
  9. Data.MultiPoint class 
  10. Data.MultiPolygon class 
  11. Data.Point class 
  12. Data.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 object Specification 
  31. Coordinates object Specification 
  32. DirectionLeg object Specification 
  33. DirectionRequest object Specification 
  34. DirectionResult object Specification 
  35. DirectionRoute object Specification 
  36. DirectionsBounds object Specification 
  37. DirectionsOverviewPolyline object Specification 
  38. DirectionsWayPoint object Specification 
  39. Distance object Specification 
  40. Duration object Specification 
  41. FeatureData object Specification 
  42. GeometryArray object Specification 
  43. GeometryClasses object Specification 
  44. GeometryCollectionElement object Specification 
  45. GeometryData object Specification 
  46. GeometryOptions object Specification 
  47. GeometryType object Specification 
  48. Icon object Specification 
  49. IconSequence object Specification 
  50. InfoWindowOptions object Specification 
  51. LatLngBoundsLiteral object Specification 
  52. LatLngLiteral object Specification 
  53. MapOptions object Specification 
  54. MapPanes object Specification 
  55. MapStyleSpec object Specification 
  56. MapStyler object Specification 
  57. MarkerLabel object Specification 
  58. MarkerLabelOptions object Specification 
  59. MarkerOptions object Specification 
  60. Padding object Specification 
  61. PolygonOptions object Specification 
  62. PolylineOptions object Specification 
  63. RectangleOptions object Specification 
  64. Style object Specification 
  65. StyleOptions object Specification 
  66. StyleRule object Specification 
  67. TypedStyleRule object Specification 
  68. DirectionStatus constants 
  69. TravelMode constants 
  70. UnitSystem constants 
  71. event namespace 
  72. geometry namespace 
  73. Geometry interface 
  74. MapEventListener interface 

BaseGeometry abstract class 🔗


BaseGeometry
This class extends MVCObject.

Methods
getDraggable()

Return Value: Boolean

Returns whether the geometry is draggable or not.

getEditable()

Return Value: Boolean

Returns whether the geometry is editable or not.

getMap()

Return Value: ?Map

Returns the current parent Map.

getVisible()

Return Value: Boolean

Returns whether the geometry is visible or not.

setDraggable(draggable:Boolean)

Return Value: void

Sets the geometry draggable.

setEditable(editable:Boolean)

Return Value: void

Sets the geometry editable.

setMap(map:?Map)

Return Value: void

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

setVisible(visible:Boolean)

Return Value: void

Sets the visibility of the geometry.


BasePolygon abstract class 🔗


BasePolygon
This class extends BaseGeometry.

Constructor
constructor(options:GeometryOptions)

Circle class 🔗


woosmap.map.Circle
This class extends BasePolygon.

Methods
getBounds()

Return Value: LatLngBounds

Returns the bounds for the circle geometry.

getCenter()

Return Value: LatLng

Returns the center for the circle geometry.

getRadius()

Return Value: Number

Returns the radius for the circle geometry.

setCenter(center:LatLng | LatLngLiteral)

Return Value: void

Sets the center for the circle.

setRadius(radius:Number)

Return Value: void

Sets the radius for the circle.

setOptions(options:CircleOptions)

Return Value: void

Sets the options for the circle.


Data class 🔗


woosmap.map.Data
This class extends MVCObject.

Constructor
constructor()

Creates an empty collection.


Methods
add(feature:Feature | FeatureData)

Adds the feature passed as parameter.

remove(feature:Feature)

Remove the feature passed as parameter.

addGeoJson(geojson:Object, options?:{idPropertyName : String})

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

toGeoJson(callback:Function)

Exports the features in the collection to a GeoJSON object.

contains(feature:Feature)

Return Value: Boolean

Checks whether the given feature is in the collection.

forEach(callback:Function)

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

getFeatureById(id:String)

Return Value: ?Feature

Returns the feature matching the id.

getMap()

Return Value: ?Map

Returns the map on which the features are displayed.

setMap(map:?Map)

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

setStyle(style:function(Feature): StyleOptions | StyleOptions)

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

getStyle()

Return Value: Function | StyleOptions

Gets the style for all features in the collection.

overrideStyle(feature:Feature, style:StyleOptions)

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

revertStyle(feature:Feature)

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

loadGeoJson(url:String, options?:{idPropertyName : String}, callback?:function(Array<Feature>): void)

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


Events
removefeature

This event is triggered when a feature was removed.

addfeature

This event is triggered when a feature was added.

click

This event is triggered when a feature is clicked.

contextmenu

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

dblclick

This event is triggered when a feature is double clicked.

mousedown
mouseup
mouseout

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

mouseover

This event is triggered when a feature was hovered

mouseenter

This event is triggered when a feature is hovered.


Data.GeometryCollection class 🔗


woosmap.map.Data.GeometryCollection

Constructor
constructor(elements:GeometryArray | Array<GeometryData>)

Constructs a geometry collection from an array of geometries.


Methods
getAt(n:Number)

Return Value: GeometryCollectionElement

Returns the n-th Geometry of the GeometryCollection.

getArray()

Return Value: GeometryArray

getLength()

Return Value: Number

forEachLatLng(callback:function(LatLng): void)

Return Value: void

getCoordinates()

Return Value: any

getType()

Return Value: GeometryType

Returns "GeometryCollection".


Data.LineString class 🔗


woosmap.map.Data.LineString

Constructor
constructor(points:Array<LatLng> | Array<Coordinates> | Array<LatLngLiteral>)

Methods
getAt(n:Number)

Return Value: LatLng

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

getArray()

Return Value: Array<LatLng>

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

getLength()

Return Value: Number

Returns the count of points in the linestring.

getCoordinates()

Return Value: Array<Coordinates>

Returns the points of the polyline as an array of pairs of Number.

getType()

Return Value: GeometryType

Returns "LinearString".


Data.LinearRing class 🔗


woosmap.map.Data.LinearRing

Constructor
constructor(points:Array<LatLng> | Array<Coordinates> | Array<LatLngLiteral>)

Constructs a linear ring.


Methods
getAt(n:Number)

Return Value: LatLng

Returns the n-th Point of the LinearRing.

getArray()

Return Value: Array<LatLng>

Returns coordinates as an array of LatLng.

getLength()

Return Value: Number

Returns the number of points in the linearring.

forEachLatLng(callback:function(LatLng): void)

Return Value: void

Call callback for each point in the linear ring

getCoordinates()

Return Value: Array<Coordinates>

Returns the coordinates of the linear ring as an array of pair of number.

getType()

Return Value: GeometryType

Returns "LinearRing".


Data.MultiLineString class 🔗


woosmap.map.Data.MultiLineString

Constructor
constructor(linestrings:Array<LineString> | Array<Array<LatLng>> | Array<Array<LatLngLiteral>>)

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


Methods
getAt(n:Number)

Return Value: LineString

Returns the n-th LineString of the MultiLineString.

getArray()

Return Value: Array<LineString>

getType()

Return Value: GeometryType

Returns "MultiLineString".


Data.MultiPoint class 🔗


woosmap.map.Data.MultiPoint

Constructor
constructor(points:Array<LatLng> | Array<Coordinates> | Array<LatLngLiteral>)

Constructs a Multipoint geometry.


Methods
getAt(n:Number)

Return Value: LatLng

Returns n-th Point of the MultiPoint.

getArray()

Return Value: Array<LatLng>

Return the array of points

getLength()

Return Value: Number

Returns the length of the multipoint.

forEachLatLng(callback:function(LatLng): void)

Return Value: void

For each point calls the callback.

getCoordinates()

Return Value: Array<Coordinates>

Returns all the point coordinates of the multipoint.

getType()

Return Value: GeometryType

Returns "MultiPoint".


Data.MultiPolygon class 🔗


woosmap.map.Data.MultiPolygon

Constructor
constructor(elements:Array<Polygon> | Array<Array<LinearRing>> | Array<Array<Array<LatLng>>> | Array<Array<Array<LatLngLiteral>>>)

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


Methods
getAt(n:Number)

Return Value: Polygon

Returns the n-th polygon of the MultiPolygon.

getArray()

Return Value: Array<Polygon>

Returns the array of Polygons that makes the MultiPolygon.

getLength()

Return Value: Number

Return the count of Polygon in the MultiPolygon.

forEachLatLng(callback:function(LatLng): void)

Return Value: void

getCoordinates()

Return Value: Array<Array<Array<Coordinates>>>

Returns the Polygons elements as a 3D-array of Coordinates.

getType()

Return Value: String

Returns "MultiPolygon".


Data.Point class 🔗


woosmap.map.Data.Point

Constructor
constructor(point:LatLng | Coordinates | LatLngLiteral)

Constructs a Point geometry


Methods
get()

Return Value: LatLng

Returns the point geometry

forEachLatLng(callback:function(LatLng): void)

Return Value: void

getCoordinates()

Return Value: Coordinates

Returns the coordinates of the geometry.

getType()

Return Value: GeometryType

Returns "Point".


Data.Polygon class 🔗


woosmap.map.Data.Polygon

Constructor
constructor(elements:Array<LinearRing> | Array<Array<LatLng>> | Array<Array<LatLngLiteral>>)

Constructs a Polygon, using a set of linear ring.


Methods
getAt(n:Number)

Return Value: LinearRing

Returns the n-th LinearRing of the Polygon.

getArray()

Return Value: Array<LinearRing>

Returns the array of LinearRing that composes the Polygon.

getLength()

Return Value: Number

Returns the count of LinearRings that composes the Polygon.

forEachLatLng(callback:function(LatLng): void)

Return Value: void

For each LinearRing call callback.

getCoordinates()

Return Value: Array<Array<Coordinates>>

Returns the set of linear rings as a 2D-array of Coordinates.

getType()

Return Value: GeometryType

Returns "Polygon".


DirectionsRenderer class 🔗


woosmap.map.DirectionsRenderer
This class extends MVCObject.

Methods
setMap(map:?Map)

Sets the map where to render the directions.

setDirections(directions:DirectionResult)

Sets the directions result to render.

setRouteIndex(routeIndex:Number)

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


Events
routeIndex_changed

This event is triggered when the routeIndex changes.


DirectionsService class 🔗


woosmap.map.DirectionsService

Methods
route(request:DirectionRequest, callback:function(DirectionResultDirectionStatus): void)

Issue a directions search request.


InfoWindow class 🔗


woosmap.map.InfoWindow
This class extends MVCObject.

Constructor
constructor(options:InfoWindowOptions)

Methods
open(map:Map, anchor:Marker | LatLng | LatLngLiteral)

Opens the info window.

close()

Closes this InfoWindow by removing it from the DOM structure.

setContent(content:String)

Sets the info window content

setPosition(positionOrMarker:Marker | LatLng | LatLngLiteral)

Sets the anchor

setOffset(offset:Point)

Sets the offset

setMarker(marker:?Marker)

Sets the marker

setMap(map:Map)

Sets the info window map.

getMap()

Return Value: ?Map

Gets the current map bound to the


LatLng class 🔗


woosmap.map.LatLng

Constructor
constructor(lat:Number | Function, lng:Number | Function, noWrap?:Boolean)

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.


Methods
lat()

Return Value: Number

Returns the latitude in degrees.

lng()

Return Value: Number

Returns the longitude in degrees.

equals(other:LatLng)

Return Value: Boolean

Comparison function.

toJSON()

Return Value: LatLngLiteral

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


LatLngBounds class 🔗


woosmap.map.LatLngBounds

Constructor
constructor(northEast:?LatLng | LatLngLiteral, southWest:?LatLng | LatLngLiteral)

Creates a LatLngBounds object


Methods
extend(latlng:LatLng | LatLngLiteral)

Extends the current bounds with point.

contains(latlng:LatLng | LatLngLiteral)

Return Value: Boolean

Checks if current bounds contain latlng.

intersects(other:LatLngBounds)

Return Value: Boolean

Checks if bounds are intersecting with other.

union(other:LatLngBounds)

Computes the union of this bounds and other.

getNorthEast()

Return Value: LatLng

Returns the north-east corner of this bounds.

getSouthWest()

Return Value: LatLng

Returns the south-west corner of this bounds.

getCenter()

Return Value: LatLng

Computes the center of the latlng bounds.

isEmpty()

Return Value: Boolean

Checks if the current bounds are empty.


MVCArray class 🔗


woosmap.map.MVCArray
This class extends MVCObject.

Methods
clear()

Return Value: void

Removes all elements from the array.

forEach(callback:function(TNumber): void)

Return Value: void

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

getArray()

Return Value: Array<T>

getAt(i:Number)

Return Value: T

Get the element at the specified index.

getLength()

Return Value: Number

Get the number of elements in this array.

insertAt(i:Number, elem:T)

Return Value: void

Inserts an element at the specified index.

pop()

Return Value: T

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

push(elem:T)

Return Value: Number

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

removeAt(i:Number)

Return Value: T

Removes an element from the specified index.

setAt(i:Number, elem:T)

Return Value: void

Sets an element at the specified index.

indexOf(elem:T)

Return Value: Number

Returns the index of a given element.


MVCObject class 🔗


woosmap.map.MVCObject

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

Return Value: Void

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

isPropertyBound(key:String)

Return Value: Boolean

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

get(key:String)

Return Value: Mixed

Returns the value of the property specified by key

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

Return Value: Void

Sets value to key on this.

setOptions(key_value_pairs:Object)

Return Value: Void

Set all the values of the properties contained in key_value_pairs

unbind(key:String)

Return Value: Void

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

unbindAll()

Unbind all bound properties on this object

addListener(eventName:String, handler:Function)

Return Value: MapEventListener

Adds a listener for eventName.


Map class 🔗


woosmap.map.Map
This class extends MVCObject.

Constructor
constructor(mapDiv:HTMLElement | String, options?:MapOptions)

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


Methods
fitBounds(bounds:LatLngBounds | LatLngBoundsLiteral, padding?:Padding)

Sets the viewport to contain the given bounds.

getBounds(padding?:Padding)

Return Value: ?LatLngBounds

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

getCenter()

Return Value: LatLng

Returns the position displayed at the center of the map.

getDiv()

Return Value: Element

getHeading()

Return Value: Number

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

getTilt()

Return Value: Number

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

getZoom()

Return Value: Number

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

panBy(x:Number, y:Number)

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

panTo(latLng:LatLng | LatLngLiteral, padding?:Padding)

Changes the center of the map to the given LatLng.

panToBounds(latLngBounds:LatLngBounds | LatLngBoundsLiteral, padding?:?Padding)

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:LatLng | LatLngLiteral, padding?:Padding)

Sets the map center

setHeading(heading:Number)

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

setTilt(tilt:Number)
setZoom(zoom:Number)

Events
bounds_changed

This event is fired when the viewport bounds have changed.

center_changed

This event is fired when the map center property changes.

click

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

dblclick

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

drag

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

dragend

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

dragstart

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

idle

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

mousemove

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

mouseout

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

mouseover

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

rightclick

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

zoom_changed

This event is fired when the map zoom property changes.


Marker class 🔗


woosmap.map.Marker
This class extends MVCObject.

Constructor
constructor(options?:MarkerOptions)

Constructs a Marker


Methods
setIcon(icon:Icon | String)
setMap(map:Map)
setOpacity(opacity:Number)

Sets the marker opacity.

getOpacity()

Return Value: Number

Gets the marker opacity.

getPosition()

Return Value: 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:LatLng | LatLngLiteral)

Sets the position of the marker

getOffset()

Return Value: Point

Get the marker’s offset.

setOffset(offset:Point)

Return Value: Marker

Sets the offset of the marker

setDraggable(shouldBeDraggable:Boolean)

Return Value: Marker

Sets the draggable property and functionality of the marker

getDraggable()

Return Value: Boolean

Returns true if the marker can be dragged

setRotation(rotation:Number)

Return Value: Marker

Sets the rotation property of the marker.

getRotation()

Return Value: Number

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

setRotationAlignment(alignment:String)

Return Value: Marker

Sets the rotationAlignment property of the marker.

getRotationAlignment()

Return Value: String

Returns the current rotationAlignment property of the marker.

setPitchAlignment(alignment?:String)

Return Value: Marker

Sets the pitchAlignment property of the marker.

getPitchAlignment()

Return Value: String

Returns the current pitchAlignment property of the marker.


Properties
cursor Type: String

Events
click

This event is fired when the marker was clicked.

mouseover

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

mouseout

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

clickable_changed

This event is fired when markers clickable property changes.

cursor_changed

This event is fired when markers cursor property changes.

icon_changed

This event is fired when markers icon property changes.

position_changed

This event is fired when markers position property changes.

dragstart

Fired when dragging starts

drag

Fired while dragging

dragend

Fired when the marker is finished being dragged

draggable_changed

This event is fired when markers draggable property changes.

visible_changed

This event is fired when markers visible property changes.

zIndex_changed

This event is fired when markers zIndex property changes.


OverlayView class 🔗


woosmap.map.OverlayView

Methods
setMap(map:Map)

Point class 🔗


woosmap.map.Point

Constructor
constructor(x:Number, y:Number)

Creates a Point object


Polygon class 🔗


woosmap.map.Polygon
This class extends BasePolygon.

Constructor
constructor(options:PolygonOptions)

Constructs a polygon.


Methods
getPath()

Return Value: MVCArray<LatLng>

Returns the outer path of the polygon.

getPaths()

Return Value: MVCArray<MVCArray<LatLng>>

Returns all the path that compose the polygon.

setOptions(options:PolygonOptions)

Return Value: void

Sets the polygon options.

setPath(path:MVCArray<LatLng> | Array<LatLng | LatLngLiteral>)

Return Value: void

Sets the polygon path.

setPaths(paths:MVCArray<MVCArray<LatLng>> | MVCArray<LatLng> | Array<Array<LatLng | LatLngLiteral>> | Array<LatLng | LatLngLiteral>)

Return Value: void

Sets the polygon paths.


Polyline class 🔗


woosmap.map.Polyline
This class extends BaseGeometry.

Constructor
constructor(options:PolylineOptions)

Constructs a Polyline.


Methods
getPath()

Return Value: MVCArray<LatLng>

setOptions(options:PolylineOptions)

Return Value: void

setPath(path:MVCArray<LatLng> | Array<LatLng | LatLngLiteral>)

Return Value: void


Rectangle class 🔗


woosmap.map.Rectangle
This class extends BasePolygon.

Constructor
constructor(options:RectangleOptions)

Constructs a Rectangle.


Methods
getBounds()

Return Value: LatLngBounds

setBounds(bounds:LatLngBounds | LatLngBoundsLiteral)

Return Value: void

setOptions(options:RectangleOptions)

Return Value: void


Size class 🔗


woosmap.map.Size

Constructor
constructor(width:Number, height:Number)

Creates a Size object


StoresOverlay class 🔗


woosmap.map.StoresOverlay
This class extends OverlayView.

Constructor
constructor(style:Style)

Constructs a StoreOverlay


Methods
clearSelection()

Clears selected store if any

setSelection(feature:Object)

Sets the selected store

setQuery(query:?String)

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

setMap(map:Map)

Events
store_unselected

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

store_selected

This event is triggered when a store is selected


Feature class 🔗


woosmap.map.data.Feature

Methods
getGeometry()

Return Value: woosmap.map.Data.Geometry

Returns the feature geometry.

getId()

Return Value: String

Returns the feature id.

getProperty(name:String)

Return Value: any

Returns the feature property

removeProperty(name:String)

Removes property

setProperty(name:String, newValue:any)

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

toGeoJson(callback:Function)

Exports the feature to a GeoJSON object.


CircleOptions object Specification  🔗


This object specification extends GeometryOptions.
Properties
center Type: ?LatLng | ?LatLngLiteral

The center of the circle.

radius Type: ?Number

The radius of the circle.


Coordinates object Specification  🔗


This object specification extends ArrayType.

DirectionLeg object Specification  🔗


Properties
distance Type: Distance
duration Type: Duration
end_location Type: LatLngLiteral
start_location Type: LatLngLiteral

DirectionRequest object Specification  🔗


Properties
travelMode Type: String

See TravelMode.

unitSystem Type: String

See UnitSystem.

origin Type: LatLng | LatLngLiteral
destination Type: LatLng | LatLngLiteral
provideRouteAlternatives Type: Boolean?
waypoints Type: Array<DirectionsWayPoint>?

DirectionResult object Specification  🔗


Properties
routes Type: Array<DirectionRoute>

DirectionRoute object Specification  🔗


Properties
overview_polyline Type: DirectionsOverviewPolyline

The encoded overview polyline.

overview_path Type: Array<LatLng>

The decoded overview path.

summary Type: String

The description of the route.

legs Type: Array<DirectionLeg>
bounds Type: DirectionsBounds

DirectionsBounds object Specification  🔗


Properties
northeast Type: LatLngLiteral
southwest Type: LatLngLiteral

DirectionsOverviewPolyline object Specification  🔗


Properties
points Type: String

Contains encoded polyline.


DirectionsWayPoint object Specification  🔗


Properties
location Type: LatLng

Waypoint location.

stopover Type: Boolean

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


Distance object Specification  🔗


Properties
value Type: Number
text Type: String

Duration object Specification  🔗


Properties
value Type: Number
text Type: String

FeatureData object Specification  🔗


Properties
id Type: any?
properties Type: Object?
geometry Type: GeometryClasses | GeometryData?

GeometryArray object Specification  🔗


This object specification extends Array<GeometryCollectionElement>.

GeometryClasses object Specification  🔗


This object specification extends GeometryCollectionElement | GeometryCollection.

GeometryCollectionElement object Specification  🔗


This object specification extends Point | MultiPoint | LineString | MultiLineString | LinearRing | Polygon | MultiPolygon.

GeometryData object Specification  🔗


Properties
type Type: GeometryType
coordinates Type: any
geometries Type: Array<GeometryData>?

GeometryOptions object Specification  🔗


Properties
clickable Type: ?Boolean
draggable Type: ?Boolean
editable Type: ?Boolean
geodesic Type: ?Boolean
map Type: ?Map
strokeColor Type: ?String
strokeOpacity Type: ?Number
strokeWeight Type: ?Number
visible Type: ?Boolean

Whether the Geometry is visible or not.

zIndex Type: ?Number
strokePosition Type: String?

GeometryType object Specification  🔗


This object specification extends "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "LinearRing" | "Polygon" | "MultiPolygon" | "GeometryCollection".

Icon object Specification  🔗


Properties
url Type: String
size Type: Size?
scaledSize Type: Size?
anchor Type: Point?
labelOrigin Type: Point?

IconSequence object Specification  🔗


Properties
fixedRotation Type: ?Boolean?
icon Type: ?SymbolIcon?
offset Type: ?String?
repeat Type: ?String?

InfoWindowOptions object Specification  🔗


Properties
content Type: ?String | Node

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.

disableAutoPan Type: ?Boolean

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

maxWidth Type: ?Number

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

pixelOffset 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 object Specification  🔗


Properties
east Type: Number
west Type: Number
north Type: Number
south Type: Number

LatLngLiteral object Specification  🔗


Properties
lat 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.

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


MapOptions object Specification  🔗


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

Properties
zoom Type: Number

The initial map zoom level to start from.

center Type: LatLng | LatLngLiteral

The initial map center to start from.

gestureHandling Type: String

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.

styles Type: ?Array<MapStyleSpec>
[
  {
    "featureType": "poi",
    "stylers": [{
      "visibility": "on"
    }]
  },
  {
    "featureType": "water",
    "stylers": [{
        "saturation": -100
    }]
  }
]
disableDefaultUI Type: Boolean

Disables the default maps controls interface.

defaultStyle Type: String?

MapPanes object Specification  🔗


Properties
floatPane Type: Element

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

markerLayer Type: Element

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

overlayLayer Type: Element

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

overlayMouseTarget Type: Element

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

mapPane Type: Element

MapStyleSpec object Specification  🔗


Properties
featureType Type: String

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

elementType Type: String

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

stylers Type: Array<MapStyler>

The rules to apply to the selected features.


MapStyler object Specification  🔗


Properties
color Type: String

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

visibility Type: String

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

hue Type: String

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

saturation Type: Number

Changes the saturation

gamma Type: Number

Applies a gamma correction on lightness.

invert_lightness Type: Boolean

Inverts the lightness.

weight Type: Number

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

lightness Type: Number

Changes the lightness.


MarkerLabel object Specification  🔗


Properties
text Type: String

The text to be displayed in the label.

color Type: String

The color of the label. Default to: black.

fontSize Type: String

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

parsedFontSize Type: Number

MarkerLabelOptions object Specification  🔗


Properties
text Type: String

The text to be displayed in the label.

className Type: ?String

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

color Type: ?String

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

fontFamily Type: ?String

The font family for the label.

fontSize Type: ?String

The font size for the label.

fontWeight Type: ?String

The font weight for the label.


MarkerOptions object Specification  🔗


Properties
map Type: Map

The Map where the marker should be displayed.

icon Type: String | Icon

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

clickable Type: Boolean

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

position Type: LatLng | LatLngLiteral

The markers’s position.

opacity Type: Number

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

visible Type: Boolean

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

anchorPoint Type: Point

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

label Type: String | MarkerLabelOptions

Adds a letter or number label inside a marker.

draggable Type: Boolean?
title Type: ?String?

Padding object Specification  🔗


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

PolygonOptions object Specification  🔗


This object specification extends GeometryOptions.
Properties
paths Type: ?MVCArray<MVCArray<LatLng>> | MVCArray<LatLng> | Array<Array<LatLng | LatLngLiteral>> | Array<LatLng | LatLngLiteral>

The paths of the polygon.


PolylineOptions object Specification  🔗


This object specification extends GeometryOptions.
Properties
path Type: ?MVCArray<LatLng> | Array<LatLng | LatLngLiteral>

The path of the polyline.

icons Type: ?Array<IconSequence>

RectangleOptions object Specification  🔗


This object specification extends GeometryOptions.
Properties
bounds Type: ?LatLngBounds | ?LatLngBoundsLiteral

The bounds of the Rectangle.


Style object Specification  🔗


Properties
rules Type: Array<TypedStyleRule>
default Type: StyleRule
breakPoint Type: Number

StyleOptions object Specification  🔗


Properties
clickable Type: Boolean?
cursor Type: String?
fillColor Type: String?
fillOpacity Type: Number?
icon Type: String | Icon?
icons Type: Array<IconSequence>?
label Type: String | MarkerLabel?
opacity Type: Number?
strokeColor Type: String?
strokeOpacity Type: Number?
strokeWeight Type: Number?
visible Type: Boolean?
iconImage Type: String

StyleRule object Specification  🔗


Properties
color Type: String
minSize Type: Number?
size Type: Number?
icon Type: Icon
selectedIcon Type: Icon?

TypedStyleRule object Specification  🔗


Properties
color Type: String
icon Type: Icon
selectedIcon Type: Icon?
type Type: String

DirectionStatus constants  🔗


woosmap.map.DirectionStatus

Constants
OK Type: String

TravelMode constants  🔗


woosmap.map.TravelMode

Constants
BICYCLING Type: String

Requests a route for a bicycle.

DRIVING Type: String

Requests a route for a car.

WALKING Type: String

Requests a route for a pedestrian.


UnitSystem constants  🔗


woosmap.map.UnitSystem

Constants
METRIC Type: String

Requests distances to be computed using the metric system.

IMPERIAL Type: String

Requests distances to be computed using the imperial system.


event namespace 🔗


woosmap.map.event

Functions
addListener(instance:Object, eventName:String, handler:Function)

Return Value: 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:Object, eventName:String, handler:Function)

Return Value: MapEventListener

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

addDomListener(element:Element, eventName:String, handler:Function)
removeListener(listener:MapEventListener)

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

clearInstanceListeners(instance:Object)

Removes all listeners for all events for the given instance.

clearListeners(instance:Object, eventName:String)

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

trigger(instance:Object, eventName:String, eventArgs:?Array<any>)

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


geometry namespace 🔗


woosmap.map.geometry

Functions
containsLocation(point:LatLng | LatLngLiteral, polygon:Polygon)

Return Value: Boolean

Computes whether the given point lies inside the specified polygon.

isLocationOnEdge(point:LatLng | LatLngLiteral, poly:Polygon, tolerance?:Number)

Return Value: 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.


Geometry interface 🔗


woosmap.map.Data.Geometry
Methods
getType()

Return Value: GeometryType

Returns the type of the geometry.


MapEventListener interface 🔗


MapEventListener
Methods
remove()

Return Value: void

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


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