Longdo Map API Reference
anonymous.MapOptions
Anonymous type for Map options

Projections projection: Initial projection   (Default: Projections.EPSG3857)
Layer|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: Use default input device (keyboard. mouse and touchscreen)   (Default: true)
bool autoResize: Auto resize to fit parent element   (Default: true)
bool lastView: Load last location/zoom from local storage if able   (Default: true)
bool smoothZoom: When zoom, show rough map while loading new map   (Default: true)
string language: Language in ISO 639-1 format   (Default: th)
^top
anonymous.LayerOptions
Anonymous type for Layer options

LayerType type: Type of layer   (Default: LayerType.Longdo)
URL url: Image server URL   (Default: Longdo image server)
Range zoomRange: Zoom range   (Default: Every zoom)
int refresh: Refresh interval in second   (Default: No refresh)
number opacity: Layer opacity   (Default: 1)
int weight: Weight, lighter will float, heavier will sink   (Default: 0)
Bound bound: Only tile in this bounding box will be shown   (Default: world)

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: Same as projection)
string styles: Styles   (Default: default)
string extraQuery: Extra query string   (Default: No extra query)

WMTS(KVP) type specific options
delegate tileMatrix: Zoom level to tile matrix translation function(zoom: int): string   (Default: Same as zoom)

TMS & WMTS(RESTful) type specific options
string format: image extension   (Default: png)

TMS type specific options
string zoomOffset: TMS zoom level - Longdo zoom level   (Default: -1)

Custom type specific options
delegate url: Build image url right away function(projection: Projection, tile: Tile, zoom: int): URL|null   (Default: Empty image)
delegate defer: Set image to tile element later function(projection: Projection, tile: Tile, zoom: int, element: ImageElement): void   (Default: None)
^top
anonymous.ExternalOptions
Anonymous type for external map options

string googleQuery: Google API extra query string   (Default: No extra query)
string mapboxKey: mapbox API access token   (Default: -)

^top
anonymous.MarkerOptions
Anonymous type for Marker options

HTML title: Popup title   (Default: No title)
Icon icon: Icon   (Default: A certain blue pin)
HTML detail: Popup detail   (Default: No detail)
PopupOptions popup: Popup options, override detail parameter   (Default: As detail)
Range visibleRange: Visible range   (Default: Every zoom)
bool clickable: Fire click event even if has no popup   (Default: false)
bool draggable: Draggable   (Default: false)
OverlayWeight weight: Weight, for add marker to top   (Default: 0)
number rotate: marker rotation in degree, relative to north   (Default: 0)
CSS style: Custom marker's placeholder styles for HTML icon   (Default: none)
^top
anonymous.PopupOptions
Anonymous type for Popup options

HTML title: Popup title   (Default: No title)
HTML detail: Popup detail   (Default: No detail)
delegate loadDetail: Popup detail function(element: Element): void   (Default: Load nothing)
HTML html: Custom popup code, override detail parameter   (Default: As detail)
delegate loadHtml: Custom popup function(element: Element): void   (Default: Load nothing)
SizeWithRange size: Popup size   (Default: Auto)
bool autoFocus: Auto focus (default popup only)   (Default: false)
bool closable: Show close button   (Default: true)
^top
anonymous.GeometryOptions
Anonymous type for Polyline and subclass options

HTML title: Popup title   (Default: No title)
HTML detail: Popup detail   (Default: No detail)
HTML label: Show label at pivot   (Default: No detail)
MarkerOptions labelOptions: Label options   (Default: Visible range of geometry)
PopupOptions popup: Popup options, override detail parameter   (Default: As detail)
Range visibleRange: Visible range   (Default: Every zoom)
int lineWidth: Line width   (Default: 3)
CSSRGBA lineColor: Line color   (Default: Preset color list)
CSSRGBA fillColor: Fill color (can't use with dashed line)   (Default: Preset color list)
LineStyle lineStyle: Line style   (Default: LineStyle.Solid)
delegate linePattern: Custom drawing with Canvas API function(context: CanvasRenderingContext2D, index: int, x1: int, y1: int, x2: int, y2: int): void, override lineStyle   (Default: Straight line)
int borderWidth: Border width (only work with Polyline)   (Default: 0)
CSSRGBA borderColor: Border color (only work with Polyline)   (Default: Transparent)
Location|delegate pivot: Label location   (Default: Center of geometry)
bool clickable: Fire click event even if has no popup   (Default: false)
bool|Range editable: Can drag node to change geometry's shape   (Default: false)
bool draggable: Can drag node to move   (Default: false)
bool rotatable: Can drag node to rotate   (Default: false)
bool pointer: Show pointer when move mouse over Polyline   (Default: false)
OverlayWeight weight: Weight, for add geometry to top   (Default: 0)
URL texture: Background image URL (only work with Rectangle; can't use cross-site image)   (Default: none)
int textureAlpha: Opacity of texture   (Default: 1)
^top
anonymous.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   (Default: No button)
MenuItem[] dropdown: List of dropdowns   (Default: No dropdown)
string dropdownLabel: Dropdown label   (Default: ...)
delegate change: Handler function(currentMenuItem: Object, lastMenuItem: Object): void 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
anonymous.TagPanelOptions
Anonymous type for TagPanel options

string[] tag: List of tags   (Default: travel, restaurant, gas, bank)
^top
anonymous.CustomControlOptions
Anonymous type for CustomControl options

HTML html: Control body
^top
anonymous.SearchUiOptions
Anonymous type for Search.placeholder options

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

string area: Geocode of search 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
anonymous.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)
^top
anonymous.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
anonymous.NearPoiOptions
Anonymous type for Search.nearPoi options

number span: Span in degree   (Default: Optimal span)
int zoom: Maximum POI zoom level   (Default: All zoom)
int limit: Limit the number of results   (Default: 10)
^top
anonymous.TagOptions
Anonymous type for TagCollection options

URL source: Tag server URL   (Default: Longdo server)
Icon|string icon: Icon or big/small keyword for default icons with bigger/smaller size   (Default: Default icons)
Range visibleRange: Visible range   (Default: Every zoom)
Range label: Label visible range   (Default: None)
string area: Geocode of tag area   (Default: Any area)
string dataset: Tag dataset   (Default: Default data)
^top
anonymous.TouchMeasureOptions
Anonymous type for Touch Measure options

Element measureButton: Add point to measuring button   (Default: Text button)
Element undoButton: Undo button or null to disable   (Default: Text button)
Element doneButton: Done button   (Default: Text button)
Element cancelButton: Cancel button or null to disable   (Default: Text button)
^top
anonymous.Location
Anonymous type for store location

number lon: Longitude
number lat: Latitude
^top
anonymous.Point
Anonymous type for store 2D & 3D point
Page is position from top-left of page
Screen is position from top-left of map
Point is 3D position from top-left of the world

int x: x
int y: y
int z: z   (Default: undefined)
^top
anonymous.Range
Anonymous type for store range

int min: Mininum value (inclusive)
int max: Maximun value (inclusive)
^top
anonymous.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
anonymous.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
anonymous.Tile
Anonymous type for store tile

int u: x-axis id
int v: y-axis id
int w: inverse zoom level
int ux: unbounded u value   (Default: u)
^top
anonymous.NumberUnit
Anonymous type for store number with unit as string

Example
'1deg', '1', 1 = 1 degree
'1.5m' = 1.5 metre
'-1E2km' = -100 km
^top
anonymous.Size
Anonymous type for store size

int width: width
int height: height
^top
anonymous.SizeWithRange
Anonymous type for store size or range of size

int width: width   (Default: Use range of width)
int minWidth: Mininum width   (Default: Equal to width)
int maxWidth: Maximun width   (Default: Equal to width)
int height: height   (Default: Use range of height)
int minHeight: Mininum height   (Default: Equal to height)
int maxHeight: Maximun height   (Default: Equal to height)
^top
anonymous.EventEnum
Event enumeration
Property/Method List
ready
Map is ready to use
beforeResize
Map is going to resized
Can prevent default behavior by return false from handler functions
resize
Map has been resized
repaint
Map has been repainted
zoom
Zoom level changed

Point Pivot of zoom
zoomRange
Zoom range changed
locationAnimationBegin
Location animation begin

Location Target location
location
Location changed
fullscreen
Map enter or exit fullsceen

bool Is fullscreen
rotate
Map rotated
suggest
Suggest result is ready

Object Result
search
Search result is ready

Object Result
address
Address result is ready

Object Result
nearPoi
Nearby POI result is ready

Object Result
toolbarChange
Toolbar is toggled
See Also:Toolbar.activeTool for mode list

string Mode
clearMeasure
Clear measure line
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 Cursor point
click
User click or tap on the map

Point Click point
doubleClick
User double click or tap on the map
Can prevent default behavior by return false

Point Click point
wheel
User scroll mouse wheel

Point Wheel point with direction
pinch
User pinch the map

Point Pinch point
pinchEnd
User stop pinch the map
drag
User drag the map
Can prevent default behavior by return false from handler functions

Point Offset
drop
User stop drag the map
Can prevent default behavior by return false from handler functions
idle
No input from user, no animation and no tile are loaded
layerChange
Layer changed

Layer Change layer
loadTile
All visible tile are start or finish to load

string 'start' or 'finish'
overlayChange
Overlay changed

LongdoOverlay The changed overlay
overlaySelect
User select a overlay

LongdoOverlay The selected overlay
overlayClick
User click a overlay
Can prevent default behavior by return false

LongdoOverlay The clicked overlay
overlayLoad
Predefined overlays are ready

Object The overlays data
overlayDrag
User drag a overlay

LongdoOverlay The dragged overlay
overlayDrop
User drop a overlay

LongdoOverlay The dropped overlay
overlayMove
Overlay is moved

LongdoOverlay The moved overlay
overlayHover
Mouse hover over a overlay

LongdoOverlay The hovered overlay
overlayLeave
Mouse leave a overlay

LongdoOverlay The leaved overlay
pathAnimationEnd
Path animation end

LongdoOverlay The Animated overlay
popupLoadDetail
A popup is going to load it's detail
Can prevent default behavior by return false from handler functions

Popup The popup
popupClose
A popup is closed

Popup|PopupMini The closed popup
guideError
Routing guide error

int Error code
guideComplete
Routing guide complete

Object[] Guide list
pathError
Routing path error

int Error code
pathComplete
Routing path complete

Object Data
beforeGeolocation
Geolocation request
Can prevent default behavior by return false from handler functions
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
beforeContextmenu event
Property/Method List
Context menu location
Add element to menu

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

Static class
Property/Method List
Ready
Map is ready to use
BeforeResize
Map is going to resized
Can prevent default behavior by return false from handler functions
Resize
Map has been resized
Repaint
Map has been repainted
Zoom
Zoom level changed

Point Pivot of zoom
ZoomRange
Zoom range changed
LocationAnimationBegin
Location animation begin

Location Target location
Location
Location changed
Fullscreen
Map enter or exit fullsceen

bool Is fullscreen
Rotate
Map rotated
Suggest
Suggest result is ready

Object Result
Search
Search result is ready

Object Result
Address
Address result is ready

Object Result
NearPoi
Nearby POI result is ready

Object Result
ToolbarChange
Toolbar is toggled
See Also:Toolbar.activeTool for mode list

string Mode
ClearMeasure
Clear measure line
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 Click point
DoubleClick
User double click or tap on the map

Point Click point
Wheel
User scroll mouse wheel

Point Wheel point with direction
Pinch
User pinch the map

Point Pinch point
PinchEnd
User stop pinch the map
Drag
User drag the map
Can prevent default behavior by return false from handler functions

Point Offset
Drop
User stop drag the map
Can prevent default behavior by return false from handler functions
Idle
No input from user, no animation and no tile are loaded
LayerChange
Layer changed

Layer Change layer
loadTile
All visible tile are start or finish to load

string 'start' or 'finish'
OverlayChange
Overlay changed

Overlay The changed overlay
OverlaySelect
User select a overlay

Overlay The selected overlay
OverlayClick
User click a overlay
Can prevent default behavior by return false

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
OverlayMove
Overlay is moved

LongdoOverlay The moved 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
PopupLoadDetail
A popup is going to load it's detail
Can prevent default behavior by return false from handler functions

Popup The popup
PopupClose
A popup is closed

Popup|PopupMini The closed popup
GuideError
Routing guide error

int Error code
GuideComplete
Routing guide complete

Object[] Guide list
PathError
Routing path error

int Error code
PathComplete
Routing path complete

Object Data
BeforeGeolocation
Geolocation request
Can prevent default behavior by return false from handler functions
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
longdo.Event
longdo.Event(map)
Event class

In some event, if any handler return false the event will not excute.
Private constructor
Map map: Map

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

string eventName: Name of event
delegate handler: Handler function(eventData: Object): bool, Return false to prevent default behavior if able
this Self

See Also:EventEnum
unbind
unbind(eventName, handler)
Remove a handler from target event

string eventName: Name of event
delegate handler: Handler function
this Self
pause
pause(state)
Pause event handler from call

Getter
bool Current state

Setter
bool state: New state
this Self
register
register(eventName)
Register new event

string eventName: Name of event
this Self
^top
longdo.LineStyle
Line style enumeration

Static class
Property/Method List
Solid
Solid
Dashed
Dashed
Dot
Dot
^top
longdo.Polylineextends LongdoOverlay
longdo.Polyline(locationList, options)
Polyline class

Location[] locationList: List of locations
GeometryOptions options: Extra options   (Default: Default value)
Property/Method List
linkEditing
linkEditing(geometry)
Link all editing node with another geometry

Polyline geometry: Another geometry
this Self
update
update(newOptions)
Update this geometry options
Only lineWidth, lineColor, fillColor, lineStyle, borderWidth, borderColor and label are support

GeometryOptions newOptions: New options value
this Self
shift
shift(vector)
Translate this geometry

Location vector: Distance to shift
this Self
rotate
rotate(angle)
Rotate this geometry

number angle: Angle to rotate in degree
this Self
size
size()
Formatted area or distance of this geometry

string Size
distance
distance(overlay)
Minimum geodesic distance to the specified overlay

Location|LongdoOverlay overlay: Overlay (support only marker, popup and dot) or location
float|string Distance in metre
^top
longdo.Polygonextends longdo.Polyline
longdo.Polygon(locationList, options)
Polygon class

Location[] locationList: List of locations
GeometryOptions options: Extra options   (Default: Default value)
Property/Method List
contains
contains(overlay)
Tests if the specified overlay is inside this polygon
Points on polygon's edge are count as outside

Location|LongdoOverlay overlay: Overlay (support only marker, popup and dot) or location
bool Is overlay is inside, return null if overlay is exactly on polygon's edge
union
union(overlay, options)
Union this polygon with another polygon

Polygon overlay: Another polygon
GeometryOptions options: Extra options   (Default: Default value)
Polygon Union polygon
intersection
intersection(overlay, options)
Intersection this polygon with another polygon

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

Polygon overlay: Another polygon
GeometryOptions options: Extra options   (Default: Default value)
Polygon Differenced polygon
split
split(splitter, options)
Split this polygon by another polygon or polyline
Can't split polygon with hole by polyline

Polyline|Polygon splitter: Splitter
GeometryOptions options: Extra options   (Default: Default value)
Polygon[] List of split polygons
^top
longdo.Circleextends longdo.Polyline
longdo.Circle(location, radius, options)
Circle class

Location location: Center location
number radius: Circle radius in degree
GeometryOptions options: Extra options   (Default: Default value)
^top
longdo.Polycurveextends longdo.Polyline
longdo.Polycurve(locationList, options)
Polycurve class
Implement as cubic bezier curve

Location[] locationList: List of Locations and control points
GeometryOptions options: Extra options   (Default: Default value)
^top
longdo.Dotextends longdo.Polyline
longdo.Dot(location, options)
Dot class

Location location: Location
GeometryOptions options: Extra options   (Default: Default value)
^top
longdo.Rectangleextends longdo.Polygon
longdo.Rectangle(location, size, options)
Rectangle class
Can apply texture

Location location: Top-left location
Size|Location size: Size in degree or bottom-right location
GeometryOptions options: Extra options   (Default: Default value)
Property/Method List
divide
divide(count, dir, options)
Divide this rectangle to multiple rectangle

int count: Number of divided rectangle
bool dir: Divide direction   (Default: Longer side)
GeometryOptions options: Extra options   (Default: Default value)
LongdoOverlay[] Divided rectangle
^top
longdo.Keyboard
longdo.Keyboard(placeholder, map, handler)
Keyboard class

Private constructor
Element placeholder: Placeholder element
Map map: Map
Object handler: Handler

See Also:UiCollection.Keyboard
Property/Method List
enable
enable(state)
Enable keyboard input

Getter
bool Current state

Setter
bool state: New state
this Self
enableInertia
enableInertia(state)
Enable map to slide a little after move map by keyboard

Getter
bool Current state

Setter
bool state: New state
this Self
^top
longdo.Mouse
longdo.Mouse(placeholder, map, handler)
Mouse class
Support mouse and touchscreen up to 2 touches

Private constructor
Element placeholder: Placeholder element
Map map: Map
Object handler: Handler

See Also:UiCollection.Mouse
Property/Method List
enable
enable(state)
Enable click/drag/wheel in one function

bool state: New state
this Self
enableClick
enableClick(state)
Enable mouse click

Getter
bool Current state

Setter
bool state: New state
this Self
enableDrag
enableDrag(state)
Enable dragging

Getter
bool Current state

Setter
bool state: New state
this Self
enableWheel
enableWheel(state)
Enable wheel scrolling

Getter
bool Current state

Setter
bool state: New state
this Self
enableInertia
enableInertia(state)
Enable map to slide a little after dragging

Getter
bool Current state

Setter
bool state: New state
this Self
overlayDoubleClick
overlayDoubleClick(state)
Enable double click event on overlay

Getter
bool Current state

Setter
bool state: New state
this Self
isTouch
isTouch()
Is touch input

bool Current state
lockPinch
lockPinch(state)
lock pinch location to center of map

Getter
bool Current state

Setter
bool state: New state
this Self
^top
longdo.LayerType
Layer type enumeration

Static class
Property/Method List
WMS
Web Map Service type
TMS
Tile Map Service type
WMTS
Web Map Tile Service (key-value-pairs encoding) type
WMTS_REST
Web Map Tile Service (RESTful encoding) type
ArcGIS_REST
ArcGIS REST Services type
XYZ
XYZ Tiles type
Custom
Custom type, LayerOptions.url must be callback function
External
Render with external library type
Longdo
Default type
^top
longdo.Layer
longdo.Layer(name, options)
Layer class

string name: Name of layer
LayerOptions options: Extra options   (Default: Default value)
Property/Method List
name
name()
Get name

string Name
^top
longdo.MergeLayerextends longdo.Layer
longdo.MergeLayer(base, topper, options)
Merge Layer class

Layer base: Base layer
Layer topper: Topper layer
MergeLayerOptions options: Extra options   (Default: Default value)
^top
longdo.Layers
Layer list singleton class

Static class
Property/Method List
NORMAL
Standard base layer (TH)
NORMAL_EN
Standard base layer (EN)
REVERSE
Upside down base layer (TH)
REVERSE_EN
Upside down base layer (EN)
GRAY
Gray-ish base layer (TH)
GRAY_EN
Gray-ish base layer (EN)
POI
Standard+POI base layer (TH)
POI_EN
Standard+POI base layer (EN)
POLITICAL
Political base layer (TH)
POLITICAL_EN
Political base layer (EN)
POLITICAL_NOLABEL
Political base layer (No label)
BASE
Hillshade base layer
HYDRO
Basic base layer
OSM
Open Street Map base layer
LONGDO_OSM
Longdo OSM base layer
OPENCYCLE
Open Cycle base layer
TERRAIN
Bluemarble terrain base layer
GISTDA_SPOT5
SPOT5 satellite base layer
THAICHOTE
Thaichote satellite base layer
TOMTOM_NORMAL
TomTom standard base layer (TH)
TOMTOM_POI
TomTom standard+POI base layer (TH)
TOMTOM_HYDRO
TomTom basic base layer
ARCGIS_WORLD_IMAGERY
ArcGIS world imagery

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

See Also:goto.arcgisonline.com/maps/World_Street_Map
ARCGIS_WORLD_TOPO_MAP
ArcGIS world topographic map

See Also:goto.arcgisonline.com/maps/World_Topo_Map
ARCGIS_WORLD_DARK
ArcGIS world dark base

See Also:goto.arcgisonline.com/maps/World_Dark_Gray_Base
ARCGIS_WORLD_LIGHT
ArcGIS world light base

See Also:goto.arcgisonline.com/maps/World_Light_Gray_Base
SPHERE_STREETS
sphere streets base layer
SPHERE_HYBRID
sphere satellite/aerial base layer
SPHERE_IMAGES
sphere satellite/aerial base layer
BLANK
White base layer
CLEAR
Transparent base layer
CHECKERED
Checkered base layer
POI_TRANSPARENT
Standard+POI non-base layer (TH)
POI_TRANSPARENT_EN
Standard+POI non-base layer (EN)
TRAFFIC
Traffic non-base layer with auto-refresh
ARCGIS_WORLD_DARK_REF
ArcGIS world dark reference

See Also:goto.arcgisonline.com/maps/World_Dark_Gray_Reference
ARCGIS_WORLD_LIGHT_REF
ArcGIS world light reference

See Also:goto.arcgisonline.com/maps/World_Light_Gray_Reference
ARCGIS_WORLD_PLACE
ArcGIS world boundaries and places

See Also:goto.arcgisonline.com/maps/Reference/World_Boundaries_and_Places
ARCGIS_WORLD_TRANSPORTATION
ArcGIS world transportation

See Also:goto.arcgisonline.com/maps/Reference/World_Transportation
GOOGLE_ROADMAP
Google road map external layer (First load language)

See Also:stackoverflow.com/questions/7065420
GOOGLE_TRAFFIC
Google traffic external layer
GOOGLE_SATELLITE
Google satellite image external layer
GOOGLE_HYBRID
Google satellite image with road map external layer
MAPBOX_STREETS
Mapbox GL streets external layer
MAPBOX_SATELLITE
Mapbox GL satellite image external layer
MAPBOX_HYBRID
Mapbox GL satellite image with streets external layer
MAPBOX_LONGDO
Longdo vector standard external layer
MAPBOX_LONGDO_OSM
Longdo vector OSM external layer
MAPBOX_LONGDO_TRAFFIC
Longdo vector traffic external layer
byName
byName(name)
Get layer by name

@param {string) name Layer name
Layer Layer
^top
longdo.Projections
Projection list singleton class

Static class
Property/Method List
EPSG3857
EPSG:3857 projection (WGS 84 / Pseudo-Mercator) - sphere earth
EPSG4326
EPSG:4326 projection (WGS 84) - ellipsoid earth
getBound
getBound(projection)
Get bounding box

Projections projection: Projection
Bound World bounding box
^top
longdo.Filter
Color filter enumeration

Static class
Property/Method List
Dark
Dark map and UI color
Light
Lighter map color
None
No filter
^top
longdo.LayerCollection
longdo.LayerCollection(map)
LayerCollection class

Private constructor
Map map: Map

See Also:Map.Layers
Property/Method List
setBase
setBase(layer)
Set base layer of this collection
Bind layerChange event

Layer layer: Base layer
this Self
add
add(layer)
Add a non-base layer to this collection
Bind layerChange event to get notify

Layer layer: Non-base layer
this Self
insert
insert(index, layer)
Insert a non-base layer to this collection
Bind layerChange event to get notify

int index: Position of layer
Layer layer: Non-base layer
this Self
remove
remove(layer)
Remove a non-base layer from this collection
Bind layerChange event to get notify

Layer layer: Non-base layer
this Self
clear
clear()
Clear all non-base layers in this collection
Bind layerChange event to get notify

this Self
list
list()
List layers in this collection

Layer[] List of layers in collection
size
size()
Number of layers in this collection

int Size of collection
contains
contains(layer)
Check if this collection contains the specified layer

Layer layer: Layer
bool Contain
externalMap
externalMap()
Get current external map data

object[] External map, provider name and layers
externalOptions
externalOptions(options)
Access external map options
Not affect external map added before set this function

Getter
ExternalOptions Current options

Setter
ExternalOptions state: New options
this Self
^top
longdo.LocationMode
Location mode enumeration

Static class
Property/Method List
Pointer
Get location at mouse position mode
Geolocation
Set value to geolocation mode
^top
longdo.Map
longdo.Map(options)
Map class
Bind ready event to get notify

MapOptions options: Extra options   (Default: Default value)
Property/Method List
id
id()
Get map unique id

int ID
resize
resize()
Resize map
Call this function when resize or reposition map
Bind beforeResize and resize event to get notify

this Self
repaint
repaint(mode)
Repaint map
Bind repaint event to get notify

Object mode: For internal use   (Default: null)
this Self
pause
pause(state)
Pause map from repaint

Getter
bool Current state

Setter
bool state: New state
this Self
placeholder
placeholder()
Get map placeholder

Element Placeholder
projection
projection()
Get map projection

Projection Projection
zoom
zoom(value, animate, pivot)
Access zoom level
Bind zoom event to get notify

Getter
number Current zoom

Setter
number|bool value: New zoom or direction
bool animate: Show animation   (Default: true)
Point pivot: Pivot of zoom   (Default: center of screen)
this Self
zoomRange
zoomRange(value)
Access zoom range
Bind zoomRange event to get notify

Getter
Range Current zoom range

Setter
Range value: New zoom range
this Self
location
location(value, animate)
Access map location
Bind beforeGeolocation, geolocation, geolocationError and location event to get notify

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
bound(value, pivot, allowZoomIn)
Access visible map bounding box

Getter
Bound Current bounding box

Setter
Bound value: New bounding box
Location pivot: Pivot of bounding box   (Default: center of bounding box)
bool allowZoomIn: Allow zoom in to fit bounding box   (Default: yes)
this Self
move
move(offset, animate)
Move map in pixel unit

Point offset: Offset in pixel
bool animate: Show animation   (Default: true)
this Self
pinch
pinch(value, screen)
Pinch map
Bind pinch event to get notify

number value: Multiplier
Point screen: Position on screen
this Self
pinchEnd
pinchEnd(screen)
Stop pinch map
Bind pinchEnd event to get notify

Point screen: Position on screen
this Self
language
language(value)
Access language setting for all components in ISO 639-1 format

Getter
string Current language

Setter
string value: New language
this Self

See Also:en.wikipedia.org/wiki/List_of_ISO_639-1_codes
focus
focus()
Set focus to map

this Self
pageToScreen
pageToScreen(page)
Convert position in page to position in placeholder

Point page: Position from top-left of page
Point Position from top-left of map
loadingTile
loadingTile()
Get number of loading tiles

int Number of loading tiles
rotate
rotate(angle)
Access map rotation

Getter
string Current angle in degree

Setter
number angle: Angle to rotate in degree
this Self
enableFilter
enableFilter(filter)
Enable filter

Getter
Filter Current filter

Setter
Filter state: New filter
this Self
Event
See Also:Event
Layers
See Also:LayerCollection
Overlays
See Also:OverlayCollection
Ui
See Also:UiCollection
Search
See Also:Search
Tags
See Also:TagCollection
Route
See Also:Route
^top
longdo.Math
Math singleton class

Static class
Property/Method List
square
square(value)
Find square of the value

int value: Value
int Square of value
distance
distance(dx, dy)
Find 2D distance from X and Y distance

int dx: X distance
int dy: Y distance
number 2D Distance
isPointInRect
isPointInRect(x, y, l, t, r, b)
Check if the point in the rectangle

int x: X of point
int y: Y of point
int l: Left of rectangle
int t: Top of rectangle
int r: Right of rectangle
int b: Bottom of rectangle
bool Is point in rectangle
isPointInPolygon
isPointInPolygon(point, pointList)
Check if the point is in the polygon
Can't check point on polygon's edge

point point: The point
point[] pointList: List of polygon vertices
bool Is point in polygon
isPointOnPolyline
isPointOnPolyline(point, pointList, width)
Check if the point is on the polyline or polygon border

point point: The point
Point[] pointList: List of polyline/polygon vertices
int width: Line width   (Default: 0)
bool Is point on polyline or polygon border
closestPointOnLine
closestPointOnLine(x, y, x1, y1, x2, y2)
Find closest point on the line

int x: X of point
int y: Y of point
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 on line
^top
longdo.ButtonType
Button type enumeration

Static class
Property/Method List
Radio
Radio button
Toggle
Toggle button
Push
Push button
Reset
Reset button/option
can use in dropdown
Group
Option group
for dropdown only
Custom
HTML
^top
LongdoControl
LongdoControl(element)
Longdo control class
The root of all controls

Private constructor
Element element: Control's elment
Property/Method List
visible
visible(state)
Visible

Getter
bool Current state

Setter
bool state: New state
this Self
^top
longdo.MenuBar(options)
Menu bar class

MenuBarOptions options: Menu options
Property/Method List
selectIndex(index)
Select index

integer index: Menu index
this Self
selectValue(value)
Select value

Object value: Menu value
this Self
^top
longdo.TagPanelextends LongdoControl
longdo.TagPanel(options)
Tag panel class

TagPanelOptions options: Extra options   (Default: Default value)
^top
longdo.CustomControlextends LongdoControl
longdo.CustomControl(options)
Custom control class

CustomControlOptions options: Extra options   (Default: Default value)
^top
longdo.LayerSelector
longdo.LayerSelector(placeholder, map, mode)
LayerSelector class

Private constructor
Element placeholder: Placeholder element
Map map: Map
string mode: Mode (undefined / button / dropdown)

See Also:UiCollection.LayerSelector
Property/Method List
visible
visible(state)
Visible

Getter
bool Current state

Setter
bool state: New state
this Self
^top
longdo.OverlayWeight
Overlay weight enumeration

Static class
Property/Method List
Top
Top flag
^top
longdo.ObjectLabel
Object label flags

Static class
Property/Method List
Title
Use title flag
^top
LongdoOverlay
LongdoOverlay(location, element, offset, visibleRange)
Longdo overlay class
The root of all overlays

Private constructor
Location location: Location
Element|Image element: Icon elment or image (Maximum size for image type icon is 256x256px)
Point offset: Icon offset
Range visibleRange: Visible range   (Default: Every zoom)
Property/Method List
location
location()
Get location

Location Overlay location
offset
offset()
Get offset

Point Icon offset
visibleRange
visibleRange()
Get visible range

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

bool Is active
pop
pop(mode)
Show or hide popup of this overlay if any

bool mode: Show or hide   (Default: toggle)
this Self
move
move(location, animate)
Move this overlay to new location

Location location: New location
bool animate: Show animation   (Default: false)
this Self
^top
longdo.Markerextends LongdoOverlay
longdo.Marker(location, options)
Marker class

Location location: Marker location
MarkerOptions options: Extra options   (Default: Default value)
Property/Method List
update
update(newOptions)
Update overlay options
Only rotate is support

MarkerOptions newOptions: New options value
this Self
^top
longdo.Popup(location, options)
Popup class

Location location: Popup location
PopupOptions options: Extra options   (Default: Default value)
Property/Method List
title
title(value)
Access title of this popup
Not support custom popup

Getter
Element Title

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

Getter
Element Detail

Setter
HTML value: New detail
this Self
fit
fit()
Fit popup width to it's content

this Self
focus
focus()
Move map to make whole popup visible unless it locate outside visible map area

this Self
^top
longdo.Overlays
Overlay list singleton class
Property/Method 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)
Object
Object(id, dataset, options)
Predefined object overlay

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, RID geometry accept GeometryOptions | ObjectOptions
^top
longdo.OverlayCollection
longdo.OverlayCollection(map, handler)
OverlayCollection class

Private constructor
Map map: Map
Object handler: Handler

See Also:Map.Overlays
Property/Method List
add
add(overlay)
Add an overlay to this collection
Bind overlayChange event to get notify

LongdoOverlay overlay: Overlay
this Self
remove
remove(overlay)
Remove an overlay from this collection
Bind overlayChange event to get notify

LongdoOverlay overlay: Overlay
this Self
clear
clear()
Clear all overlays in this collection
Bind overlayChange event to get notify

this Self
list
list()
List overlays in this collection

LongdoOverlay[] List of overlays
size
size()
Number of overlays in this collection

int Size
load
load(mode)
Load predefined overlays and add to this collection
Bind overlayLoad event to get notify

Overlays.Object mode: Mode
this Self
unload
unload(mode)
Remove predefined overlays from this collection

Overlays mode: Mode
this Self
floorPlan
floorPlan(overlay)
Show floor plan of the overlay if any

LongdoOverlay overlay: Overlay
this Self
drop
drop(overlay)
Show drop animation of the overlay and add to this collection

LongdoOverlay overlay: Overlay
this Self
bounce
bounce(overlay)
Show bounce animation of the overlay

LongdoOverlay overlay: Overlay
this Self
enableAutoClosePopup
enableAutoClosePopup(state)
Enable automatically close previous popup when open new one

Getter
bool Current state

Setter
bool state: New state
this Self
enableAutoFocusPopup
enableAutoFocusPopup(state)
Enable automatically move map to make whole popup visible

Getter
bool Current state

Setter
bool state: New state
this Self
enableFloorPlan
enableFloorPlan(state)
Enable automatically show floor plan if any

Getter
bool Current state

Setter
bool state: New state
this Self
enableEditGuide
enableEditGuide(state)
Enable edit guide

bool state: New state
this Self
lastOpenPopup
lastOpenPopup()
Get the last open popup

Popup Last open popup
pathAnimation
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
longdo.RouteType
Route type enumeration

Static class
Property/Method 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
longdo.RouteMode
Route mode enumeration

Static class
Property/Method List
Traffic
Driving via fastest route, avoid traffic jam with real-time and predicted data
Cost
Driving via fastest route
Distance
Driving via shortest route
Walk
Walking via shortest route or use fastest 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
longdo.RouteLabel
Route label enumeration

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

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

Private constructor
Map map: Map

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

Getter
string Current language

Setter
string value: New language
this Self

See Also:en.wikipedia.org/wiki/List_of_ISO_639-1_codes
placeholder
placeholder(value)
Access placeholder element

Getter
Element Current placeholder

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

this Self
line
line(type, value)
Access route line options
Avaliable type are
  destination - the direct lines from routing path to destination, set to false to disable
  road
  air
  rail - all ground public transport
  ferry
  focus - when select a guide

Getter
string type: Line type
GeometryOptions Current options

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

Getter
bool Current state

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

Getter
RouteMode Current mode

Setter
RouteMode value: New mode
this Self
enableRoute
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
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
time(value)
Access search time

Getter
Date Current time

Setter
Date value: New time
this Self
modeOf
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
useStopMarker
useStopMarker(state)
Use stop marker for last destination

Getter
bool Current state

Setter
bool state: New state
this Self
usePoiName
usePoiName(state)
Use near by POI name as destination in the guide
This function don't change current guide

Getter
bool Current state

Setter
bool state: New state
this Self
useCumulativeDistance
useCumulativeDistance(state)
Use cumulative distance
This function don't change current guide

Getter
bool Current state

Setter
bool state: New state
this Self
showUnknownRoad
showUnknownRoad(state)
Show unknown road in guide
This function don't change current guide

Getter
bool Current state

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

Getter
RouteLabel Current mode

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

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

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

Marker destination: Destination
this Self
removeAt
removeAt(index)
Remove destination at the index

int index: Destination index
this Self
clearDestination
clearDestination()
Clear all destinations

this Self
clearPath
clearPath()
Clear all paths

this Self
clear
clear()
Clear everything

this Self
list
list()
List destination in this route

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

int Size
reverse
reverse()
Reverse the direction of route

this Self
search
search()
Search the route
Bind guideComplete, guideError, pathComplete, pathError event to get notify

this Self
distance
distance(format)
Distance of the route

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

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

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

GeometryOptions options: Extra options   (Default: Default value)
Polyline Geometry overlay
nextGuide
nextGuide()
Show next guide

this Self
^top
longdo.Search(map, secondary)
Search class

Private constructor
Map map: Map
bool secondary: Is secondary search provider   (Default: false)

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

Getter
string Current language

Setter
string value: New language
this Self

See Also:en.wikipedia.org/wiki/List_of_ISO_639-1_codes
placeholder
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
suggest(keyword, options)
Request suggest data
Bind suggest event to receive the result

string keyword: Keyword
SuggestOptions options: Extra options   (Default: Default value)
this Self
search
search(keyword, options)
Request search data
Bind search event to receive the result

string keyword: Keyword
SearchOptions options: Extra options   (Default: Default value)
this Self
address
address(location, options)
Request address data
Bind address event to receive the result

Location|string location: Location / POI ID / Geocode / Postcode / Street address
AddressOptions options: Extra options   (Default: Default value)
this Self
nearPoi
nearPoi(location, options)
Request near by POI
Bind nearPoi event to receive the result

Location location: Location
NearPoiOptions options: Extra options   (Default: Default value)
this Self
clear
clear()
Clear result

this Self
enablePopup
enablePopup(state)
Enable popup

Getter
bool Current state

Setter
bool state: New state
this Self
^top
longdo.TagCollection
longdo.TagCollection(map)
TagCollection class

Private constructor
Map map: Map

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

Getter
string Current language

Setter
string value: New language
this Self

See Also:en.wikipedia.org/wiki/List_of_ISO_639-1_codes
set
set(tag, options)
Clear and set single tag to collection

string|delegate tag: Name of tag or callback function(tile: Tile, zoom: int): void
TagOptions options: Extra options   (Default: Default value)
this Self
add
add(tag, options)
Add tag to collection

string|delegate tag: Name of tag or callback function(tile: Tile, zoom: int): void
TagOptions options: Extra options   (Default: Default value)
this Self
remove
remove(tag)
Remove tag from collection

string tag: Name of tag
this Self
clear
clear()
Clear all tags in collection

this Self
list
list()
List tags in collection

string[] List of tags
size
size()
Size of collection

int Size
pop
pop(overlay)
Show tag popup

LongdoOverlay overlay: Tag overlay
this Self
enablePopup
enablePopup(state)
Enable popup

Getter
bool Current state

Setter
bool state: New state
this Self
^top
longdo.DPad
longdo.DPad(placeholder, map)
DPad class

Private constructor
Element placeholder: Placeholder element
Map map: Map

See Also:UiCollection.DPad
Property/Method List
visible
visible(state)
Visible

Getter
bool Current state

Setter
bool state: New state
this Self
^top
longdo.Zoombar
longdo.Zoombar(placeholder, map)
Zoombar class

Private constructor
Element placeholder: Placeholder element
Map map: Map

See Also:UiCollection.Zoombar
Property/Method List
visible
visible(state)
Visible

Getter
bool Current state

Setter
bool state: New state
this Self
^top
longdo.ZoombarMini
longdo.ZoombarMini(placeholder, map)
ZoombarMini class

Private constructor
Element placeholder: Placeholder element
Map map: Map

See Also:UiCollection.Zoombar
Property/Method List
visible
visible(state)
Visible

Getter
bool Current state

Setter
bool state: New state
this Self
^top
longdo.Geolocation
longdo.Geolocation(placeholder, map)
Geolocation class

Private constructor
Element placeholder: Placeholder element
Map map: Map

See Also:UiCollection.Geolocation
Property/Method List
visible
visible(state)
Visible

Getter
bool Current state

Setter
bool state: New state
this Self
updateCurrentLocation
updateCurrentLocation(move)
Show geolocation marker on current location

bool move: Show move animation to current location or undefined to prevent moving   (Default: sitting duck)
this Self
^top
longdo.Toolbar
longdo.Toolbar(placeholder, map)
Toolbar class

Private constructor
Element placeholder: Placeholder element
Map map: Map
Object handler: Handler

See Also:UiCollection.Toolbar
Property/Method List
visible
visible(state)
Visible

Getter
bool Current state

Setter
bool state: New state
this Self
measureToggle
measureToggle(mode)
Toggle measure tool

bool mode: On or off   (Default: toggle)
this Self
rangeToggle
rangeToggle(mode)
Toggle range tool

bool mode: On or off   (Default: toggle)
this Self
measureList
measureList()
List measure overlays

LongdoOverlay[] List of overlays
measureClear
measureClear()
Clear all measure

this Self
activeTool
activeTool()
Get current active tool
'M' if measure is active
'R' if range is active
null if none are active

string Mode
^top
longdo.Fullscreen
longdo.Fullscreen(placeholder, map)
Fullscreen class

Private constructor
Element placeholder: Placeholder element
Map map: Map

See Also:UiCollection.Fullscreen
Property/Method List
visible
visible(state)
Visible

Getter
bool Current state

Setter
bool state: New state
this Self
toggle
toggle(mode)
Toggle fullscreen

bool mode: Force fullscreen or normal size   (Default: toggle)
this Self
^top
longdo.Crosshair
longdo.Crosshair(placeholder, isMini)
Crosshair class

Private constructor
Element placeholder: Placeholder element

See Also:UiCollection.Crosshair
Property/Method List
visible
visible(state)
Visible

Getter
bool Current state

Setter
bool state: New state
this Self
^top
longdo.Scale
longdo.Scale(placeholder)
Scale class

Private constructor
Element placeholder: Placeholder element

See Also:UiCollection.Scale
Property/Method List
visible
visible(state)
Visible

Getter
bool Current state

Setter
bool state: New state
this Self
enableAbsolute
enableAbsolute(state)
Enable absolute scale, assume that display is 96 PPI by default

Getter
bool Current state

Setter
bool state: New state
this Self
enableRelative
enableRelative(state)
Enable relative scale

Getter
bool Current state

Setter
bool state: New state
this Self
ppi
ppi(value)
Access PPI

Getter
Range Current PPI

Setter
Range value: New PPI
this Self
^top
longdo.Legend
longdo.Legend(placeholder, map)
Legend class

Private constructor
Element placeholder: Placeholder element
Map map: Map

See Also:UiCollection.Legend
Property/Method List
visible
visible(image)
Visible

Getter
bool Current state

Setter
URL|bool image: Legend image   (Default: hide)
this Self
enableLoadEvents
enableLoadEvents(state)
Enable automaic load events when trafic layer is present

Getter
bool Current state

Setter
bool state: New state
this Self
enableLoadCameras
enableLoadCameras(state)
Enable automaic load cameras when trafic layer is present

Getter
bool Current state

Setter
bool state: New state
this Self
^top
longdo.Notice
longdo.Notice(placeholder, isMini)
Notice class

Private constructor
Element placeholder: Placeholder element

See Also:UiCollection.Notice
^top
longdo.ContextMenu
longdo.ContextMenu(placeholder, map)
ContextMenu class

Private constructor
Element placeholder: Placeholder element
Map map: Map

See Also:UiCollection.ContextMenu
Property/Method List
visible
visible(screen, location)
Visible

Getter
bool Current state

Setter
Point|bool screen: Point on screen   (Default: hide)
Location location: Location   (Default: hide)
this Self
enableNearPoi
enableNearPoi(state)
Enable near POI

Getter
bool Current state

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

Getter
bool Current state

Setter
bool state: New state
this Self
^top
longdo.Tooltip
longdo.Tooltip(placeholder, map)
Tooltip class

Private constructor
Element placeholder: Placeholder element
Map map: Map

See Also:UiCollection.Tooltip
Property/Method List
visible
visible(screen)
Visible

Getter
bool Current state

Setter
Point|bool screen: Point on screen   (Default: hide)
this Self
set
set(message)
Set message

@param {HTML} [message] Message
this Self
get
get()
Get currentmessage

HTML Message
^top
longdo.Toast
longdo.Toast(placeholder, map)
Toast class

Private constructor
Element placeholder: Placeholder element
Map map: Map

See Also:UiCollection.Toast
^top
longdo.PopupMini
longdo.PopupMini(placeholder, map)
PopupMini class

Private constructor
Element placeholder: Placeholder element
Map map: Map

See Also:UiCollection.Popup
Property/Method List
set
set(popup, mode)
Set popup

@param {Popup} popup
bool mode: Show or hide   (Default: toggle)
this Self
get
get()
Get last popup

Popup popup
visible
visible(state)
Visible

Getter
bool Current state

Setter
bool state: New state
this Self
^top
longdo.FloorSelector
longdo.FloorSelector(placeholder, map)
FloorSelector class

Private constructor
Element placeholder: Placeholder element
Map map: Map

See Also:UiCollection.FloorSelector
Property/Method List
visible
visible(id, floorList)
Visible

Getter
bool Current state

Setter
string id: POI ID
string[] floorList: Floor list
this Self
^top
longdo.UiPosition
UI position enumeration

Static class
Property/Method List
Left
Left side flag
Right
Right side flag
^top
longdo.UiComponent
UI Component enumeration

Static class
Property/Method List
Full
Full mode
Compact
Compact mode - Same as full mode but layer selector will show as dropdown
Mobile
Mobile mode - Same as compact mode but with small zoombar, No directional pad and toolbar
None
No UI mode
^top
longdo.UiCollection
longdo.UiCollection(map, handler, ui, input)
UiCollection class

Private constructor
Map map: Map
Object handler: Handler
UiComponent ui: Default UI
bool input: Use default input

See Also:Map.Ui
Property/Method List
language
language(value)
Access language setting in ISO 639-1 format

Getter
string Current language

Setter
string value: New language
this Self

See Also:en.wikipedia.org/wiki/List_of_ISO_639-1_codes
add
add(control, position)
Add a control to top-right of the map

LongdoControl control: Control object
UiPosition position: Position   (Default: UiPosition.Left)
this Self
remove
remove(control)
Remove a control from the map

LongdoControl|string control: Control object or default control name
this Self
enableTouchMeasure
enableTouchMeasure(options)
Enable measurement tool for touchscreen devices

TouchMeasureOptions options: Extra options   (Default: Default value)
this Self
lockMap
lockMap()
Lock map interaction

this Self
TopLeft
Top-left area of map
TopRight
Top-right area of map
BottomLeft
Bottom-left area of map
BottomRight
Bottom-right area of map
DPad
Directional pad

See Also:DPad
Geolocation
Geolocation button

See Also:Geolocation
Zoombar
Zoombar

See Also:Zoombar
Toolbar
Toolbar

See Also:Toolbar
LayerSelector
Layer selector

See Also:LayerSelector
Fullscreen
Fullscreen

See Also:Fullscreen
Scale
Scale

See Also:Scale
Legend
Legend

See Also:Legend
Notice
Notice

See Also:Notice
ContextMenu
Context menu

See Also:ContextMenu
Tooltip
Tooltip

See Also:Tooltip
Toast
Toast

See Also:Toast
Crosshair
Crosshair

See Also:Crosshair
Keyboard
Keyboard

See Also:Keyboard
Mouse
Mouse

See Also:Mouse
^top
longdo.MapTheme
Longdo map theme singleton class

Static class
^top
longdo.Util
Utility singleton class

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

Element element: Parent element
string childName: Type of element to be created
Object propertyMap: New element property   (Default: no property)
Element Newly created element
prepend
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 property   (Default: no property)
Element beforeElement: Insert content before this element   (Default: First child of the element)
Element Newly created element
empty
empty(element)
Remove all children from an element

Element element: Parent element
Element Empty element
addClass
addClass(element, className)
Add class to an element

Element element: Element
string className: Class
Element Element with added class
removeClass
removeClass(element, className)
Remove class from an element

Element element: Element
string className: Class
Element Element without removed class
hasClass
hasClass(element, className)
Check if an element has the specified class

Element element: Element
string className: Class
bool Has class
transformOrigin
transformOrigin(element, origin)
Set transform origin of the element

Element element: Element
Point origin: Origin
transform
transform(element, mode, value, offset)
Scale element

Element element: Element
string mode: Transform mode
number value: value
Point offset: Translation offset
translate
translate(element, offset)
Translate element

Element element: Element
Point offset: Translation offset
transition
transition(element, state)
Animate or stop an element

Element element: Element
bool state: State
transitionEnd
transitionEnd(element, callback)
Add animation end callback to an element

Element element: Element
delegate callback: Callback function(event: Event): void   (Default: no callback)
loadStyle
loadStyle(url, media)
Load an additional stylesheet

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

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

string url: Service URL
delegate callback: Callback function(data: Object): void   (Default: no callback)
XMLHttpRequest The request
isHD
isHD()
Check if display device has high pixel density or not

int HD level
stripTag
stripTag(html)
Strip HTML tag

string html: HTML text
string Plain text
validateLocation
validateLocation(location)
Validate the location

Location location: Location in degree
bool Is location valid
boundOfTile
boundOfTile(projection, tile)
Find bounding box of the tile in target projection

Projections projection: Projection
Tile tile: Tile
Bound Bounding box
centerOfBound
centerOfBound(bound)
Find center of the bounding box

Bound Bounding: box
Location Center location
sizeOfBound
sizeOfBound(bound)
Find size of the bounding box

Bound Bounding: box
Size Size in degree
polygonPivot
polygonPivot(locationList)
Find a location to represent the polygon

Location[] locationList: List of polygon vertices
Location Pivot Location
See Also:gis.stackexchange.com/a/76563
polylinePivot
polylinePivot(locationList)
Find a location to represent the polyline

Location[] locationList: List of polyline vertices
Location Pivot Location
locationBound
locationBound(locationList)
Find bounding box of the list of locations

Location[] locationList: List of locations
Bound Bounding box
averageLocation
averageLocation(projection, location1, location2)
Find midpoint of the given locations in target projection

Projections projection: Projection
Location location1: Location 1 in degree
Location location2: Location 2 in degree
Location Location mean
distance
distance(locationList, language)
Find distance of the polyline
Using haversine formula

Location[] locationList: List of polyline vertices
string language: Language in ISO 639-1   (Default: neutral)
float|string Distance in metre or formatted text if provided language
area
area(locationList, language)
Find approximate area of the polygon

Location[] locationList: List of polygon vertices
string language: Language in ISO 639-1   (Default: neutral)
float|string Area in square metre or formatted text if provided language
areaCircle
areaCircle(locationList, language)
Find approximate area of the circle

Location[] locationList: Circle's center and radius
string language: Language in ISO 639-1   (Default: neutral)
float|string Area in square metre or formatted text if provided language
contains
contains(point, locationList)
Check if the point is in the polygon
Points on polygon's edge are count as outside

Location point: The point
Location[] locationList: List of polygon vertices
bool Is point in polygon, return null if overlay is exactly on polygon's edge
translateGeom
translateGeom(locationList, vector)
Translate geometry

Location[] locationList: List of geometry vertices
Location vector: Distance to shift
Location[] List of translated geometry vertices
rotateGeom
rotateGeom(locationList, pivot, angle)
Rotate geometry

Location[] locationList: List of geometry vertices
Location pivot: Pivot point
number angle: Angle to rotate in radian
Location[] List of rotated geometry vertices
longitudeLength
longitudeLength(lat)
Find length of a degree of longitude at the given Latitude
Using fourier series

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

number lat: Latitude
number Length in metre
sameLocation
sameLocation(a, b)
Check if the given locations are equal

Location a: First location
Location b: Second location
bool Is same location
overlayFromWkt
overlayFromWkt(wkt, options, forceType)
Create overlay from well-known text

string wkt: Well-known text
GeometryOptions options: Extra options   (Default: Default value)
Polyline forceType: Force geometry type
Polyline[] Geometry overlays
overlayToWkt
overlayToWkt(overlayList)
Export overlay to well-known text

Polyline[] overlayList: List of homogeneous geometries
string Well-known text
overlayFromGeoJSON
overlayFromGeoJSON(geo, options)
Create overlay from GeoJSON

Object geo: GeoJSON Object
GeometryOptions options: Extra options   (Default: Default value)
Polyline[] Geometry overlays
overlayToGeoJSON
overlayToGeoJSON(overlayList)
Export overlay to GeoJSON

Polyline[] overlayList: List of homogeneous geometries
Object GeoJSON
locationToDMS
locationToDMS(location)
Convert decimal degrees location to degrees minutes seconds

Location location: Location in degree
Object degrees minutes seconds version of location
locationToUTMZone
locationToUTMZone(location)
Find UTM zone from the Location
This function ignore special zone

Location location: Location in degree
Object UTM zone and hemisphere or null if location is outside zone
locationToGeohash
locationToGeohash(location, precision)
Find Geohash from the Location

Location location: Location in degree
@param {int} precision
String Geohash
boundOfGeohash
boundOfGeohash(geohash)
Find bounding box of the geohash

String geohash: Geohash
Bound Bounding box
isInRange
isInRange(value, range)
Check if the value is in the range

int value: Value
Range range: Range
bool Is value inside range
isAbsInRange
isAbsInRange(value, range)
Check if absolute of the value is in the range

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

int value: Value
int min: Lower bound
int max: Upper bound
int Bounded value
boundAngle
boundAngle(value)
Limit angle to 0 - 360

number value: Angle in degree
number Bounded angle
lastItem
lastItem(array)
Get last item in the array

Object[] array: Array
Object Last item in array
pushOrder
pushOrder(array, item, comparator)
Push new item to sorted array

Object[] array: Sorted array
Object item: New item
delegate comparator: Comparator function(a: Object, b: Object): int
int insert position
capFirst
capFirst(string)
Capitalise first letter of the string

string string: String
string Formatted string
formatDate
formatDate(date, language)
Format the given date

string date: Date string
string language: Language in ISO 639-1
string Formatted date string
formatTime
formatTime(time)
Format the given time

string time: Time string
string Formatted time string
formatDateTimeRange
formatDateTimeRange(startDatetime, stopDatetime, language)
Format the given datetime range

string startDatetime: Start datetime string
string stopDatetime: Stop datetime string
string language: Language in ISO 639-1
string Formatted datetime range string
formatInterval
formatInterval(interval, language)
Format the given time interval

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

number distance: Distance in metre
string language: Language in ISO 639-1
string Formatted distance string
formatArea
formatArea(area, language)
Format the given area

number area: Area in square metre
string language: Language in ISO 639-1
string Formatted area string
formatThaiArea
formatThaiArea(area, language)
Format the given area to Thai unit

number area: Area in square metre
string language: Language in ISO 639-1
string Formatted area string in thai unit
numberWithCommas
numberWithCommas(number)
Add thousands separator to the number

int|string number: Number
string Number string with commas
hexToRgba
hexToRgba(color)
Convert hexadecimal color notation to RGBA

string color: Hexadecimal color notation
string Equivalent RGBA color notation
^top