Longdo Map API Reference
MapOptions
Anonymous type for Map options

Layer layer: Initial layer   (Default: Layers.NORMAL)
number zoom: Initial zoom   (Default: 7)
Range zoomRange: Initial zoom range   (Default: Every zoom)
Location location: Initial location   (Default: Metamedia office)
Element placeholder: Placeholder element   (Default: No UI)
UiComponent ui: Show default UI   (Default: Fit screen size)
bool input: Allow input from user   (Default: true)
bool lastView: Load last location/zoom from local storage if exist   (Default: true)
string language: Language in ISO 639-1 format   (Default: th)

See Also:maplibre.org/maplibre-gl-js/docs/API/types/MapOptions/
for accept maplibre options
^top
LayerOptions
Anonymous type for Layer options

LayerType type: Type of layer   (Default: Vector)

All raster type
URL url: Tile server URL   (Default: Longdo tile server)
Range zoomRange: Visible range   (Default: Every zoom)
Range source: Avaliable tile range   (Default: Every zoom)
number opacity: Layer opacity   (Default: 1)
int weight: Layer with lower weight will show over one with higher weight   (Default: 0)
Bound bound: Only tile in this bounding box will be shown   (Default: World)
string attribution: Attribution   (Default: No attribution)
string extraQuery: Extra query string   (Default: No extra query)
string id: Specify unique layer id   (Default: Layer name)

WMS & WMTS(KVP) type specific options
string format: MIME type   (Default: image/png)
string srs: WMS's spatial reference system or WMTS's tile matrix set   (Default: EPSG:3857)
string tileMatrixPrefix: WMTS's part of tile matrix before zoom level   (Default: No prefix)
string styles: Styles   (Default: Default)

WMTS(RESTful) type specific options
string format: image extension   (Default: png)
string srs: Tile matrix set   (Default: EPSG:3857)
string styles: Styles   (Default: Default)

TMS & XYZ type specific options
string format: image extension   (Default: png)
string srs: Spatial reference system   (Default: Default)
^top
MarkerOptions
Anonymous type for Marker options

Icon icon: Icon   (Default: A certain red pin)
HTML title: Show title when hover   (Default: No title)
HTML detail: Show detail when click   (Default: No detail)
PopupOptions popup: Show popup when click, override detail parameter   (Default: None)
Range visibleRange: Visible range   (Default: Every zoom)
bool clickable: Change cursor when hover   (Default: false)
bool draggable: Allow user to drag this marker   (Default: false)
number weight: Z height   (Default: 0)
number rotate: Rotation angle in degree, clockwise   (Default: 0)

See Also:maplibre.org/maplibre-gl-js/docs/API/types/MarkerOptions/
for accept maplibre options (HTML icon only)
^top
PopupOptions
Anonymous type for Popup options

HTML title: Title   (Default: No title)
HTML detail: Detail   (Default: No detail)
delegate loadDetail: Set detail function(element: Element): void   (Default: Load nothing)
HTML html: Custom content, override detail parameter   (Default: As detail)
delegate loadHtml: Set custom content function(element: Element): void   (Default: Load nothing)
Size size: Size   (Default: Auto)
bool closable: Show close button   (Default: true)

See Also:maplibre.org/maplibre-gl-js/docs/API/types/PopupOptions/
For accept maplibre options
^top
GeometryOptions
Anonymous type for Polyline and it subclasses options

HTML title: Show title when hover   (Default: No title)
HTML detail: Show detail when click   (Default: No detail)
HTML label: Show label at pivot   (Default: No detail)
MarkerOptions labelOptions: Show marker at pivot, override label parameter   (Default: Visible range of geometry)
PopupOptions popup: Show popup when click, override detail parameter   (Default: None)
Range visibleRange: Visible range   (Default: Every zoom)
int lineWidth: Line width   (Default: 3)
CSSColor lineColor: Line color   (Default: Preset color list)
CSSColor fillColor: Fill color   (Default: Preset color list)
LineStyle lineStyle: Line style   (Default: LineStyle.Solid)
Location|delegate pivot: Label location and rotation pivot   (Default: Center of geometry)
bool clickable: Change cursor when hover   (Default: false)
bool draggable: Allow user to drag this geometry   (Default: false)
bool pointer: Show draggable pointer when hover this geometry   (Default: false)
number weight: Z height   (Default: 0)
^top
ObjectOptions
Anonymous type for Overlays.Object options

number simplify: Simplify object, automatic value is around 0.00005 (fine) - 0.001 (rough)   (Default: automatic)
bool combine: Combine multiple objects into one   (Default: false)
bool ignorefragment: Don't load small part of object   (Default: false)
^top
Anonymous type for MenuBar options

MenuItem[] button: List of buttons
delegate change: Handler function(currentMenuItem: Object, lastMenuItem: Object): void that called when user change menu   (Default: No handler)
^top
Anonymous type for store menu item

string label: Label
string value: Value   (Default: Same as label)
ButtonType type: Item type   (Default: ButtonType.Radio)
^top
SearchUiOptions
Anonymous type for Search.placeholder options

Icon|boolean icon: Icon, set to false to search without marker   (Default: A certain red pin)
^top
SuggestOptions
Anonymous type for Search.suggest options

string area: Geocode of suggest area   (Default: Any area)
int offset: Offset of the first result returned   (Default: 0)
int limit: Number of results returned   (Default: 10)
string dataset: Search dataset   (Default: Default data)
^top
SearchOptions
Anonymous type for Search.search options

string area: Geocode of search area   (Default: Any area)
string tag: Tag   (Default: Any tag)
string span: Span with unit in deg, m or km   (Default: Anywhere)
int offset: Offset of the first result returned   (Default: 0)
int limit: Number of results returned   (Default: 20)
string dataset: Search dataset   (Default: Default data)
bool smart: Use smart search API   (Default: false)
^top
AddressOptions
Anonymous type for Search.address options

int limit: Limit the number of results when search with street address   (Default: 5)
string dataset: Dataset when search with street address   (Default: Default data)
^top
NearPoiOptions
Anonymous type for Search.nearPoi options

string area: Geocode of search area   (Default: Any area)
string tag: Tag   (Default: Any tag)
string span: Span with unit in deg, m or km   (Default: Anywhere)
int zoom: Maximum POI zoom level   (Default: All zoom)
int offset: Offset of the first result returned   (Default: 0)
int limit: Number of results returned   (Default: 20)
string dataset: Search dataset   (Default: Default data)
^top
TagOptions
Anonymous type for TagCollection options

URL source: Tag server URL   (Default: Longdo tag server)
TagType type: Tag type   (Default: Default server)
Icon|string icon: Icon or big/small keyword for default icons with bigger/smaller size, can't use HTML icon   (Default: Default icons)
Range visibleRange: Visible range   (Default: Every zoom)
Range label: Label visible range   (Default: None)
string area: Geocode of tag area (for default server)   (Default: Any area)
string dataset: Tag dataset (for default server)   (Default: Default data)

WFS/OGC type specific options
string name: Data name
string extraQuery: Extra query string   (Default: No extra query)
string version: WFS version   (Default: 2.0.0)
^top
Location
Anonymous type for store location

number lon: Longitude in decimal degrees
number lat: Latitude in decimal degrees
^top
Point
Anonymous type for store 2D point

int x: X-axis value
int y: Y-axis value
^top
Range
Anonymous type for store range

int min: Mininum value (inclusive)
int max: Maximun value (inclusive)
^top
Bound
Anonymous type for store bounding box

number minLon: Mininum longitude (inclusive)
number minLat: Mininum latitude (inclusive)
number maxLon: Maxinum longitude (inclusive)
number maxLat: Maxinum latitude (inclusive)
^top
Icon
Anonymous type for store icon

URL url: Icon image URL
URL urlHD: Icon image URL for high density display
HTML html: Custom icon code, override url parameter
Point offset: Icon offset   (Default: Center of icon)
Size size: Icon size   (Default: Image size)
^top
Tile
Anonymous type for store tile

int x: X-axis tile number
int y: Y-axis tile number
int z: Zoom level
^top
Size
Anonymous type for store size

int width: width
int height: height
^top
beforeContextmenu event
Property List
Method List
Context menu location
Add element to menu

Element|HTML element: Element
^top
EventName
Event name enumeration

Static class
Property List
Ready
Map is ready to use
Resize
Map has been resized
Repaint
Map has been repainted manuallly
Zoom
Zoom level changed
ZoomRange
Zoom range changed
Location
Location changed
Fullscreen
Map enter or exit fullsceen

bool Is fullscreen
Rotate
Map rotated
Pitch
Map pitch changed
ToolbarChange
Toolbar mode changed

string Mode
DrawCreate
Features are created

GeoJSON[] Features that were created
DrawDelete
Features are deleted

GeoJSON[] Features that were deleted
TooltipChange
Map tooltip changed

string Message
BeforeContextmenu
Context menu is going to appear
Can prevent default behavior by return false from handler functions

MenuEvent Menu event
Contextmenu
Context menu is appeared
Mousemove
User move mouse (without drag)

Point|Location Cursor point
Click
User click or tap on the map

Point|Location Click point
DoubleClick
User double click or tap on the map

Point|Location Click point
Wheel
User scroll mouse wheel

Point Wheel point with direction
Drag
User drag the map
Drop
User stop drag the map
Idle
No input from user, no animation and no tile are loaded
LayerChange
Layer changed

Layer The added layer
Layer The removed layer
loadTile
Tiles are loaded

string Layer name
OverlayChange
Overlay changed

Overlay The changed overlay
OverlayUpdate
Overlay updated

Overlay The updated overlay
OverlayClick
User click a overlay

Overlay The clicked overlay
OverlayLoad
Predefined overlays are ready

Object The overlays data
OverlayDrag
User drag a overlay

Overlay The dragged overlay
OverlayDrop
User drop a overlay

Overlay The dropped overlay
OverlayHover
Mouse hover over a overlay

Overlay The hovered overlay
OverlayLeave
Mouse leave a overlay

Overlay The leaved overlay
PathAnimationEnd
Path animation end

Overlay The Animated overlay
BeforeTagPopup
A popup is going to open
Can prevent default behavior by return false from handler functions

Object The POI data
PopupClose
A popup is closed

Popup The closed popup
GuideError
Routing guide error

int Error code
GuideComplete
Routing guide complete

Object[] Guide list
Geolocation
Geolocation response

Position Current position
See Also:dev.w3.org/geo/api/spec-source.html#position_interface
GeolocationError
Geolocation error

PositionError Error
See Also:dev.w3.org/geo/api/spec-source.html#position_error_interface
ConnectionError
Connection error

string Source
^top
Event
Event class

See Also:Map.Event
Method List
bind(eventName, handler)
Attach a handler to target event

EventName eventName: Name of event
delegate handler: Handler function(eventData: Object): void|bool
this Self
unbind(eventName, handler)
Remove a handler from target event

EventName eventName: Name of event
delegate handler: Handler function
this Self
^top
LineStyle
Line style enumeration

Static class
Property List
Solid
Solid style
Dashed
Dashed style
Dot
Dot style
^top
Polylineextends Overlay
Polyline class

Location[]|GeoJSON locationList: List of locations represent the line or GeoJSON Feature/LineString
GeometryOptions options: Extra options   (Default: Default value)
Method List
popup()
Get popup

Popup Popup of this geometry
pop(mode, location)
Show or hide popup of this geometry

bool mode: Show or hide   (Default: toggle)
Location location: Location of popup   (Default: pivot)
this Self
pivot()
Get a point on this geometry

Location Pivot location
centroid()
Find geometric center of this geometry

Location Centroid location
bound()
Find bounding box of this geometry

Bound bounding box
update(newOptions)
Update this geometry options
Only lineWidth, lineColor, fillColor and lineStyle are support

GeometryOptions newOptions: New options value
this Self
rotate(angle)
Rotate this geometry

number angle: Angle to rotate in degree, clockwise
this Self
size(language)
Length of this geometry

string language: ISO 639-1 language code   (Default: neutral)
number|string Length in meters or formatted text if provided language
^top
Polygonextends Polyline
Polygon class

Location[]|GeoJSON locationList: List of locations represent the polygon or GeoJSON Feature/Polygon
GeometryOptions options: Extra options   (Default: Default value)
Method List
union(overlay, options)
Combined this polygon with another polygon

Polygon overlay: Another polygon
GeometryOptions options: Extra options   (Default: Default value)
Polygon Union polygon
intersection(overlay, options)
Finds intersection of this polygon and another polygon

Polygon overlay: Another polygon
GeometryOptions options: Extra options   (Default: Default value)
Polygon Intersected polygon
difference(overlay, options)
Clipping this polygon by another polygon

Polygon overlay: Another polygon
GeometryOptions options: Extra options   (Default: Default value)
Polygon Differenced polygon
split(splitter, options)
Split this polygon by another polygon

Polygon splitter: Splitter
GeometryOptions options: Extra options   (Default: Default value)
Polygon[] List of split polygons
^top
Circleextends Polyline
Circle class

Location|GeoJSON location: Circle center or GeoJSON Feature/Point
number radius: Circle radius in degree
GeometryOptions options: Extra options   (Default: Default value)
Method List
radius(language)
Radius of this circle

string language: ISO 639-1 language code   (Default: neutral)
number|string Radius in meters or formatted text if provided language
^top
Dotextends Polyline
Dot class

Location|GeoJSON location: Dot location or GeoJSON Feature/Point
GeometryOptions options: Extra options   (Default: Default value)
Method List
^top
Rectangleextends Polygon
Rectangle class

Location location: Top-left location
Size|Location size: Size in degree or bottom-right location
GeometryOptions options: Extra options   (Default: Default value)
Method List
^top
LayerType
Layer type enumeration

Static class
Property List
Vector
Mapbox Vector Tiles type (default)
Longdo
Longdo Tiles type
XYZ
XYZ Tiles type
WMS
Web Map Service type
WMTS
Web Map Tile Service (key-value-pairs encoding) type
WMTS_REST
Web Map Tile Service (RESTful encoding) type
TMS
Tile Map Service type
ArcGIS_REST
ArcGIS REST Services type
Custom
Custom type, provide URL template in options.url
Supported placeholder are {x}, {y}, {z}, {bbox-epsg-3857}, {quadkey}, {ratio}, {prefix}
^top
Layer
Layer class

string name: Name of raster layer or style of vector layer
LayerOptions options: Extra options   (Default: Default value)
^top
Layers
Layer list singleton class

Static class
Property List
EASY
Low-complexity base layer
NORMAL
Standard base layer
HARD
Hybrid of Aerial, Road and DEM base layer
GRAY
Colorful light theme base layer
LIGHT
Monochrome light theme base layer
NIGHT
Colorful dark theme base layer
DARK
Monochrome dark theme base layer
POLITICAL
Political base layer
OSM
OSM base layer
SPHERE_SIMPLE
sphere simple base layer
SPHERE_STREETS
sphere streets base layer
SPHERE_HYBRID
sphere satellite/aerial/streets hybrid base layer
CLEAR
Transparent base layer
TRAFFIC
Traffic non-base layer, auto-refresh every 3 minutes
RASTER_POI
Longdo standard+POI raster base layer (TH)
RASTER_POI_EN
Longdo standard+POI raster base layer (TH)
RASTER_OSM
Longdo OSM raster base layer (Local)
THAICHOTE
Thaichote satellite base layer
SPHERE_IMAGES
sphere satellite/aerial base layer
TOMTOM_NORMAL
TomTom standard raster base layer (TH)
TOMTOM_POI
TomTom standard+POI raster base layer (TH)
ARCGIS_WORLD_TOPO_MAP
ArcGIS world topographic map

See Also:goto.arcgisonline.com/maps/World_Topo_Map
ARCGIS_WORLD_STREET_MAP
ArcGIS world street map

See Also:goto.arcgisonline.com/maps/World_Street_Map
GOOGLE_ROADMAP
Google vector map external layer
GOOGLE_SATELLITE
Google satellite image external layer
GOOGLE_HYBRID
Google satellite image external layer
^top
LayerCollection
LayerCollection class

See Also:Map.Layers
Method List
language(value)
Access language of base layer in ISO 639-1 language code
Support only built-in layers

Getter
string Current language

Setter
string value: New language
this Self
setBase(layer)
Set the base layer of the map

Layer|deck.MapboxLayer|Object|String layer: Base layer, deck.gl layer, MapLibre Style Specification object or a URL to such JSON
this Self
add(layer, beforeId)
Add a non-base layer to the map

Layer|deck.MapboxLayer|Object layer: Non-base layer, deck.gl layer or MapLibre Style Specification's layer object
string beforeId: ID of an existing layer to add the new layer before   (Default: Symbol layer)
this Self
remove(layer)
Remove a non-base layer from the map

Layer|deck.MapboxLayer|Object layer: Non-base layer, deck.gl layer or MapLibre Style Specification's layer object
this Self
clear()
Remove all non-base layers from the map

this Self
list()
List all layers on the map

Object[] List of layers on the map
size()
Number of layers on the map

int Number of layers
externalMap()
Get current external map data

object[] External map, provider name and layers
^top
LocationMode
Location mode enumeration

Static class
Property List
Pointer
Get location at mouse position mode
Geolocation
Set value to geolocation mode
^top
Filter
Color filter enumeration

Static class
Property List
Dark
Dark map and UI color
Light
Lighter map color
None
No filter
^top
Map
Map class

MapOptions options: Extra options   (Default: Default value)
Property List
Method List
Event
Event

See Also:Event
Layers
Layers

See Also:LayerCollection
Overlays
Overlays

See Also:OverlayCollection
Ui
UI

See Also:UiCollection
Search
Search

See Also:Search
Tags
Tags

See Also:TagCollection
Route
Route

See Also:Route
id()
Get unique id

int ID
resize()
Resize the map

this Self
repaint()
Repaint the map

this Self
placeholder()
Get the map's placeholder element

Element Placeholder
zoom(value, animate, pivot)
Access the map's zoom level

Getter
number Current zoom

Setter
Number|bool value: New zoom or direction
bool animate: Show animation   (Default: true)
this Self
zoomRange(value)
Access the map's allow zoom range

Getter
Range Current zoom range

Setter
Range value: New zoom range
this Self
location(value, animate)
Access the map's center location

Getter
Point|LocationMode mode: use LocationMode.Pointer for get location at mouse position or Point for arbitrary location   (Default: crosshair location)
Location Current location

Setter
Location|LocationMode value: New location, use LocationMode.Geolocation for set value to geolocation
bool animate: Show animation   (Default: true)
this Self
bound(value, options, allowZoomIn)
Access bounding box of the map's visible area

Getter
Bound Current bounding box

Setter
Bound value: New bounding box
FitBoundsOptions options: Extra options   (Default: Default value)
bool allowZoomIn: Allow zoom in to fit bounding box   (Default: yes)
this Self

See Also:maplibre.org/maplibre-gl-js/docs/API/types/FitBoundsOptions/
for FitBoundsOptions
move(offset, animate)
Move the map by the specified offset

Point offset: Offset in pixel
bool animate: Show animation   (Default: true)
this Self
language(value)
Access language setting for all components in ISO 639-1 language code

Getter
string Current language

Setter
string value: New language
this Self
rotate(angle, animate)
Access the map's rotation

Getter
string Current angle of map that point to top of screen, in degree, clockwise from north

Setter
number angle: Angle to rotate
bool animate: Show animation   (Default: true)
this Self
pitch(angle)
Access the map's pitch

Getter
string Current pitch angle away from screen, in degree

Setter
number angle: Angle to pitch
this Self
enableFilter(filter)
Enable color filter

Getter
Filter Current filter

Setter
Filter filter: New filter
this Self
goTo(target, animate)
Changes any combination of location, zoom, rotation, pitch, and padding

FlyToOptions target: Target and options
bool animate: Show animation   (Default: true)
this Self

See Also:maplibre.org/maplibre-gl-js/docs/API/types/FlyToOptions/
for FlyToOptions (with animation)
See Also:maplibre.org/maplibre-gl-js/docs/API/types/JumpToOptions/
for JumpToOptions (without animation)
^top
Math
Math singleton class

Static class
Method List
distance(dx, dy)
Find 2D Euclidean distance from X-axis and Y-axis distance

int dx: X-axis distance
int dy: Y-axis distance
number 2D Distance
closestPointOnLine(x, y, x1, y1, x2, y2)
Find closest point on a line from a point

int x: Point's X
int y: Point's Y
int x1: Begin of line's X
int y1: Begin of line's Y
int x2: End of line's X
int y2: End of line's Y
Point Closest point
lineIntersectPoint(x1, y1, x2, y2, u1, v1, u2, v2, skipOverlap)
Find intersect points of two lines

int x1: Begin of first line's X
int y1: Begin of first line's Y
int x2: End of first line's X
int y2: End of first line's Y
int u1: Begin of second line's X
int v1: Begin of second line's Y
int u2: End of second line's X
int v2: End of second line's Y
Point|int[] Intersect point or location of intersect points or null
^top
OverlayWeight
Overlay weight enumeration

Static class
Property List
Top
Top flag
^top
ObjectLabel
Object label enumeration

Static class
Property List
Title
Use title flag
^top
Overlay
Overlay class
The root of all overlays
Method List
location(geojson, animate)
Access location

Getter
Location|Location[] Overlay location

Setter
@param {{Location|Location[]|GeoJSON} geojson New location or GeoJSON Feature/geometry
bool animate: Show moving animation   (Default: false)
visibleRange()
Get visible range

Range Visible range
active()
Check if this overlay is added to the map

bool Is active
shift(vector)
Move this overlay by distance

Location vector: Distance to move
this Self
distance(overlay, language)
Minimum geodesic distance to the overlay

Location|Overlay overlay: Location or Overlay
string language: ISO 639-1 language code   (Default: neutral)
number|string Distance in meters or formatted text if provided language
intersects(overlay)
Tests if both overlays share any space

Location|Overlay overlay: Location or Overlay
bool Is overlays intersects
contains(overlay)
Tests if the overlay is inside this overlay

Location|Overlay overlay: Location or Overlay
bool Is the overlay inside
toJSON(key)
Convert this overlay to GeoJSON

GeoJSON GeoJSON
^top
Markerextends Overlay
Marker class

Location|GeoJSON location: Marker location
MarkerOptions options: Extra options   (Default: Default value)
Method List
popup()
Get popup

Popup Popup of this overlay
element()
Get element on the map if exists

Element HTML element
pop(mode)
Show or hide popup of this overlay

bool mode: Show or hide   (Default: toggle)
this Self
update(newOptions)
Update overlay options
Only draggable and rotate are support

MarkerOptions newOptions: New options value
this Self
^top
Popup class

Location|GeoJSON location: Popup location
PopupOptions options: Extra options   (Default: Default value)
Method List
element()
Get element on the map if exists

Element HTML element
title(value)
Access title of this popup
Not support custom popup

Getter
Element Title

Setter
HTML value: New title
this Self
detail(value)
Access detail of this popup
Not support custom popup

Getter
Element Detail

Setter
HTML value: New detail
this Self
^top
Overlays
Predefined overlay singleton class

Static class
Property List
cameras
Cameras overlay

bool popup: Enable popup   (Default: true)
bool motion: Enable motion camera   (Default: true)
events
Events overlay

bool popup: Enable popup   (Default: true)
aqi
Thai AQI overlay

bool popup: Enable popup   (Default: true)
Object
Predefined object overlay class

string id: Object ID
string dataset: Object dataset
Object options: Extra options, see accept parameters for each dataset below   (Default: Default options value)
LONGDO-A poi accept MarkerOptions, Set icon to 'big' for big default icon
LONGDO-G geometry accept GeometryOptions
LONGDO-Y layer accept LayerOptions | PopupOptions, Set title to true for default name
IG geometry accept GeometryOptions | ObjectOptions
^top
OverlayCollection
OverlayCollection class

See Also:Map.Overlays
Method List
add(overlay)
Add an overlay to the map

Overlay overlay: Overlay
this Self
remove(overlay)
Remove an overlay from the map

Overlay overlay: Overlay
this Self
load(mode)
Load predefined overlays and add to the map

Overlays mode: Predefined overlays
this Self
unload(mode)
Remove predefined overlays from the map

Overlays mode: Predefined overlays
this Self
clear()
Remove all overlays from the map

this Self
list()
List all overlays on the map

Overlay[] List of overlays
size()
Number of overlays on the map

int Size
drop(overlay)
Add marker to the map with drop animation

Marker overlay: Marker
this Self
bounce(overlay)
Show bounce animation of a marker

Marker overlay: Marker
this Self
lastOpenPopup()
Get the last open popup

Popup Last open popup
pathAnimation(marker, path, speed)
Move marker along the line

Marker marker: The marker to move
Polyline path: Motion path
number speed: Speed   (Default: 2^-zoom)
this Self
^top
RouteLine
Route line enumeration

Static class
Property List
Destination
Line from destination to nearest road
Road
Driving or walking, road
Air
Public transport, airline
Rail
Public transport, all railway
Ferry
Driving or public transport, Ferry
Focus
Highlight when hover
^top
RouteMode
Route mode enumeration

Static class
Property List
Traffic
Fastest route and avoid traffic congestions, with the real-time or predicted traffic condition
Cost
Fastest route (disregarding traffic condition), return static travel time
Distance
Shortest route, return static travel time
DistanceTraffic
Shortest route, return travel time with traffic condition
Walk
Walking via shortest route or use less transfer public transport
Both
Driving via fastest route, ignore driving direction
*For calulation only don't do this in real life
Fly
Fly directly to destination with superluminal speed
^top
RouteType
Route type enumeration

Static class
Property List
Road
Driving or walking, road
Air
Public transport, airline
Railway
Public transport, intercity railway
Ferry
Driving or public transport, Ferry
Tollway
Driving, tollway
Bus
Public transport, bus
Metro
Public transport, rapid transit
All
All
AllDrive
All driving (road, ferry, tollway)
AllTransit
All public transport (walk, air, railway, ferry, bus, metro)
^top
RouteLabel
Route label enumeration

Static class
Property List
Distance
Show distance
Time
Show time
Hide
Hide
^top
RouteRestrict
Vehicle restriction enumeration

Static class
Property List
Bike
Don't use route that restrict motorcycle
Wheelchair
Don't use route that restrict wheelchair (walk/public transport mode only)
^top
Route
Route class

See Also:Map.Route
Method List
language(value)
Access language setting in ISO 639-1 language code

Getter
string Current language

Setter
string value: New language
this Self
placeholder(value)
Access placeholder element

Getter
Element Current placeholder

Setter
Element value: New placeholder
this Self
enableContextMenu()
Enable routing menu in context menu

this Self
line(type, value)
Access route line options

Getter
RouteLine type: Line type
GeometryOptions Current options

Setter
RouteLine type: Line type
GeometryOptions value: New options
this Self
auto(state)
Access auto update setting

Getter
bool Current state

Setter
bool state: New state
this Self
mode(value)
Access search mode

Getter
RouteMode Current mode

Setter
RouteMode value: New mode
this Self
modeOf(index, value)
Access search mode of each destination

Getter
int index: Index
RouteMode Current search mode of each destination

Setter
int index: Index
RouteMode value: New mode
this Self
enableRoute(routeType, state)
Enable type of route

Getter
RouteType routeType: Route type
bool Current state

Setter
RouteType routeType: Route type
bool state: New state
this Self
enableRestrict(routeRestrict, state)
Enable vehicle restriction

Getter
RouteRestrict routeRestrict: Restrict vehicle
bool Current state

Setter
RouteRestrict routeRestrict: Restrict vehicle
bool state: New state
this Self
time(value)
Access search time

Getter
Date Current time

Setter
Date value: New time
this Self
label(value)
Access label mode

Getter
RouteLabel Current mode

Setter
RouteLabel value: New mode
this Self
add(destination, mode)
Add a destination to the route

Marker|Location destination: Destination
this Self
insert(index, destination, mode)
Insert a destination to the route

int index: Index
Marker|Location destination: Destination
this Self
remove(destination)
Remove a destination from the route

Marker destination: Destination
this Self
removeAt(index)
Remove destination by index

int index: Destination's index
this Self
clearDestination()
Remove all destinations

this Self
clearPath()
Remove all paths

this Self
clear()
Remove the route

this Self
list()
List all destinations in the route

Marker[] List of destinations
size()
Number of destinations in the route

int Size
reverse()
Reverse direction of the route

this Self
search()
Calulate the route

this Self
distance(format)
Distance of the route

bool format: With format
int|string Distance
interval(format)
Time to travel through the route

bool format: With format
int|string Interval
guide(format)
Guide for travel through the route

bool format: With format
Object[]|Element Guide
exportRouteLine(options)
Export the route as single polyline

GeometryOptions options: Extra options   (Default: Default value)
Polyline Line
^top
Search class

See Also:Map.Search
Method List
language(value)
Access language setting in ISO 639-1 language code

Getter
string Current language

Setter
string value: New language
this Self
placeholder(value, options)
Access placeholder element

Getter
Element Current placeholder
SearchUiOptions options: Extra options   (Default: Default value)

Setter
Element value: New placeholder
this Self
suggest(keyword, options)
Request suggest data

string keyword: Keyword
SuggestOptions options: Extra options   (Default: Default value)
Object Result
Asynchronous method
search(keyword, options)
Request search data

string keyword: Keyword
SearchOptions options: Extra options   (Default: Default value)
Object Result
Asynchronous method
address(location, options)
Request address data

Location|string location: Location / POI ID / Geocode / Postcode / Street address
AddressOptions options: Extra options   (Default: Default value)
Object Result
Asynchronous method
nearPoi(location, options)
Request near by POIs

Location location: Location
NearPoiOptions options: Extra options   (Default: Default value)
Object Result
Asynchronous method
clear()
Clear search results in placeholder

this Self
enablePopup(state)
Enable searched POIs popup

Getter
bool Current state

Setter
bool state: New state
this Self
^top
TagType
Tag type enumeration

Static class
Property List
WFS
Web Feature Service type
OGC
OGC API - Feature type (ISO 19168)
^top
TagCollection
TagCollection class

See Also:Map.Tags
Method List
language(value)
Access language setting in ISO 639-1 language code

Getter
string Current language

Setter
string value: New language
this Self
set(tag, options)
Clear and set a tag on the map

string|delegate tag: Name of tag or callback function(tile: Tile): Object[]
TagOptions options: Extra options   (Default: Default value)
this Self
add(tag, options)
Add a tag to the map

string|delegate tag: Name of tag or callback function(tile: Tile): Object[]
TagOptions options: Extra options   (Default: Default value)
this Self
remove(tag)
Remove a tag from the map

string tag: Name of tag
this Self
clear()
Remove all tags from the map

this Self
list()
List all tags on the map

string[] List of tags
size()
Number of tags on the map

int Size
enablePopup(state)
Enable tag POIs popup

Getter
bool Current state

Setter
bool state: New state
this Self
^top
ButtonType
Button type enumeration

Static class
Property List
Radio
Radio button
Toggle
Toggle button
Push
Push button
Reset
Reset button/dropdown
Group
Dropdown's options group
Custom
HTML
^top
CustomControl
Custom control class

HTML content: Content
Method List
visible(state)
Visible

Getter
bool Current state

Setter
bool state: New state
this Self
^top
Menu bar class

MenuBarOptions options: Menu options
Property List
Method List
Selected menu
Current dropdown label
Select menu by index

integer index: Menu index
this Self
^top
Crosshair
Crosshair class
Method List
visible(state)
Visible

Getter
bool Current state

Setter
bool state: New state
this Self
^top
ContextMenu
ContextMenu class

See Also:UiCollection.ContextMenu
Method List
enableNearPoi(state)
Enable near by POI

Getter
bool Current state

Setter
bool state: New state
this Self
enableAddress(state)
Enable address

Getter
bool Current state

Setter
bool state: New state
this Self
^top
UiComponent
UI component enumeration

Static class
Property List
Full
Full mode
Mobile
Mobile mode
None
No UI mode
^top
UiCollection
UiCollection class

See Also:Map.Ui
Property List
Method List
DPad
Directional pad

See Also:CustomControl
Geolocation
Geolocation button

See Also:CustomControl
Zoombar
Zoom bar

See Also:CustomControl
Terrain
Terrain button

See Also:CustomControl
Toolbar
Drawing toolbar
Not show by default and not avaliable on mobile device

See Also:CustomControl
LayerSelector
Layer selector

See Also:CustomControl
Fullscreen
Fullscreen botton
Not avaliable on mobile device

See Also:CustomControl
Crosshair
Crosshair

See Also:Crosshair
Scale
Scale

See Also:CustomControl
ContextMenu
Context menu

See Also:ContextMenu
Keyboard
Keyboard

Method List
enable(state)
Enable keyboard input
Mouse
Mouse

Method List
enable(state)
Enable mouse input

enableClick(state)
Enable mouse click

enableDrag(state)
Enable dragging

enableWheel(state)
Enable wheel scrolling
language(value)
Access language setting in ISO 639-1 language code

Getter
string Current language

Setter
string value: New language
this Self
add(control)
Add a control to the map

CustomControl control: Control object
this Self
remove(control)
Remove a control from the map

CustomControl control: Control object
this Self
^top
Util
Utility singleton class

Static class
Method List
append(element, childName, propertyMap)
Create and append content to an element

Element element: Parent element
string childName: Type of element to be created
@param {Object} propertyMap="No properties"] New element's properties
Element Newly created element
prepend(element, childName, propertyMap, beforeElement)
Create and prepend content to an element

Element element: Parent element
string childName: Type of element to be created
Object propertyMap: New element's properties   (Default: No properties)
Element beforeElement: Insert content before this element   (Default: First child of the element)
Element Newly created element
empty(element)
Remove all children from an element

Element element: Parent element
Element Empty element
loadStyle(url, media)
Load an additional stylesheet

string url: Stylesheet URL
string media: Media type   (Default: all)
loadScript(url, callback)
Load an additional script

string url: Script URL
delegate callback: Callback function(isLoad: bool): void   (Default: no callback)
getJson(url, responseType)
Load JSON with GET request

string url: Service URL
Object Response JSON
Asynchronous method
isHD()
Check if display device has high pixel density

int HD level
validateLocation(location)
Check if a location is valid

Location location: Location
bool Validity of location
sameLocation(a, b)
Check if both locations are equal

Location a: First location
Location b: Second location
bool Equlity of location
longitudeLength(lat)
Find length of a degree of longitude at the given latitude
Algorithm: fourier series

number lat: Latitude
number Length in meters
latitudeLength(lat)
Find length of a degree of latitude at the given latitude
Algorithm: fourier series

number lat: Latitude
number Length in meters
isInRange(value, range)
Check if the value is in the range

int value: Value
Range range: Range
bool Is value inside range
isAbsInRange(value, range)
Check if value is in [-range, +range] interval

int value: Value
int range: Range
bool Is the value in the range
bound(value, min, max)
Limit value to a bound

int value: Value
int min: Lower bound
int max: Upper bound
int Bounded value
capFirst(string)
Capitalise first letter of the string

string string: String
string Formatted string
formatDate(date, language)
Format date to "D MMM YY" (B.E.)

string date: ISO 8601 calendar date (extended format)
string language: ISO 639-1 language code
string Formatted date
formatTime(time)
Format time to "hh:mm"

string time: ISO 8601 time (extended format)
string Formatted time
formatDateTimeRange(startDatetime, stopDatetime, language)
Format datetime range

string startDatetime: Start datetime with space as a delimiter
string stopDatetime: Stop datetime
string language: ISO 639-1 language code
string Formatted datetime range
formatInterval(interval, language)
Format time interval

number interval: Time interval in second
string language: ISO 639-1 language code
string Formatted interval
formatDistance(distance, language)
Format distance

number distance: Distance in meters
string language: ISO 639-1 language code
string Formatted distance
formatArea(area, language)
Format area

number area: Area in square meters
string language: ISO 639-1 language code
string Formatted area
formatThaiArea(area, language)
Format area to Thai unit

number area: Area in square meters
string language: ISO 639-1 language code
string Formatted area
^top