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

⌥Projectionsprojection: Initial projection   (Default: Projections.EPSG3857)
⌥Layer|Layer[]layer: Initial layer   (Default: Layers.NORMAL)
⌥Numberzoom: Initial zoom   (Default: 7)
⌥RangezoomRange: Initial zoom range   (Default: Every zoom)
⌥Locationlocation: Initial location   (Default: Metamedia office)
⌥Elementplaceholder: Placeholder element   (Default: No UI)
⌥UiComponentui: Show default UI   (Default: Full mode)
⌥boolinput: Use default input device (keyboard. mouse and touchscreen)   (Default: true)
⌥boolautoResize: Auto resize to fit parent element   (Default: true)
⌥boollastView: Load last location/zoom from local storage if able   (Default: true)
⌥boolsmoothZoom: When zoom, show rough map while loading new map   (Default: true)
^top
anonymous.LayerOptions
Anonymous type for Layer options

⌥LayerTypetype: Type of layer   (Default: LayerType.Longdo)
⌥URL|delegateurl: Image server URL or function(projection, tile, zoom)   (Default: Longdo image server)
⌥RangezoomRange: Zoom range   (Default: Every zoom)
⌥intrefresh: Refresh interval in second   (Default: No refresh)
⌥Numberopacity: Layer opacity   (Default: 1)
⌥intweight: Weight, lighter will float, heavier will sink   (Default: 0)

WMS & WMTS(KVP) type specific options
⌥stringformat: MIME type   (Default: image/png)
⌥stringsrs: WMS's spatial reference system or WMTS's tile matrix set   (Default: Same as projection)
⌥stringtransparent: Transparency   (Default: true)
⌥stringstyles: Styles   (Default: default)
⌥stringextraQuery: Extra query string   (Default: No extra query)
*
WMTS(KVP) type specific options
⌥delegatetileMatrix: Zoom level to tile matrix translation function   (Default: Same as zoom)

TMS & WMTS(RESTful) type specific options
⌥stringformat: image extension   (Default: png)

TMS type specific options
⌥stringzoomOffset: TMS zoom level - Longdo zoom level   (Default: -1)
^top
anonymous.ExternalOptions
Anonymous type for external map options

⌥stringgoogleQuery: Google API extra query string   (Default: No extra query)

^top
anonymous.MarkerOptions
Anonymous type for Marker options

⌥HTMLtitle: Popup title   (Default: No title)
⌥Iconicon: Icon   (Default: A certain blue pin)
⌥HTMLdetail: Popup detail   (Default: No detail)
⌥PopupOptionspopup: Popup options, override detail parameter   (Default: As detail)
⌥RangevisibleRange: Visible range   (Default: Every zoom)
⌥boolclickable: Fire click event even if has no popup   (Default: false)
⌥booldraggable: Draggable   (Default: false)
⌥OverlayWeightweight: Weight, for add marker to top   (Default: 0)
^top
anonymous.PopupOptions
Anonymous type for Popup options

⌥HTMLtitle: Popup title   (Default: No title)
⌥HTMLdetail: Popup detail   (Default: No detail)
⌥delegateloadDetail: Popup detail function   (Default: Load nothing)
⌥HTMLhtml: Custom popup code, override detail parameter   (Default: As detail)
⌥delegateloadHtml: Custom popup function   (Default: Load nothing)
⌥SizeWithRangesize: Popup size   (Default: Auto)
⌥boolautoFocus: Auto focus (default popup only)   (Default: false)
^top
anonymous.GeometryOptions
Anonymous type for Polyline and subclass options

⌥HTMLtitle: Popup title   (Default: No title)
⌥HTMLdetail: Popup detail   (Default: No detail)
⌥HTMLlabel: Show label at pivot   (Default: No detail)
⌥PopupOptionspopup: Popup options, override detail parameter   (Default: As detail)
⌥RangevisibleRange: Visible range   (Default: Every zoom)
⌥intlineWidth: Line width   (Default: 3)
⌥CSSRGBAlineColor: Line color   (Default: Default color list)
⌥CSSRGBAfillColor: Fill color (can't use with dashed line)   (Default: Default color list)
⌥LineStylelineStyle: Line style (only work with Polyline and Polygon without fillColor)   (Default: LineStyle.Solid)
⌥Locationpivot: Label location   (Default: Center of geometry)
⌥boolclickable: Fire click event even if has no popup   (Default: false)
⌥bool|Rangeeditable: Can drag node to change geometry's shape   (Default: false)
⌥boolpointer: Show pointer when move mouse over Polyline   (Default: false)
⌥booldraggable: Draggable Dot   (Default: false)
⌥OverlayWeightweight: Weight, for add geometry to top   (Default: 0)
⌥URLtexture: Background image URL (only work with Rectangle)   (Default: none)
⌥inttextureAlpha: Opacity of texture   (Default: 1)
^top
Anonymous type for MenuBar options

⌥MenuItem[]button: List of buttons   (Default: No button)
⌥MenuItem[]dropdown: List of dropdowns   (Default: No dropdown)
⌥stringdropdpwnLabel: Dropdown label   (Default: ...)
⌥delegatechange: Handler function when user change menu   (Default: No handler)
^top
Anonymous type for store menu item

⎆stringlabel: Label
⌥stringvalue: Value   (Default: Same as label)
⌥ButtonTypetype: Item type   (Default: ButtonType.Radio)
^top
anonymous.TagPanelOptions
Anonymous type for TagPanel options

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

⎆HTMLhtml: Control body
^top
anonymous.SearchUiOptions
Anonymous type for Search.placeholder options

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

⌥stringarea: Geocode of area   (Default: Any area)
⌥intoffset: Result offset   (Default: 0)
⌥intlimit: Limit the number of results   (Default: 10)
^top
anonymous.SearchOptions
Anonymous type for Search.search options

⌥stringarea: Geocode of area   (Default: Any area)
⌥stringtag: Tag   (Default: Any tag)
⌥stringspan: Span with unit in deg, m or km   (Default: Anywhere)
⌥intoffset: Result offset   (Default: 0)
⌥intlimit: Limit the number of results   (Default: 20)
^top
anonymous.NearPoiOptions
Anonymous type for Search.nearPoi options

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

⌥URLsource: Tag server URL   (Default: Longdo server)
⌥RangevisibleRange: Visible range   (Default: Every zoom)
⌥Icon|stringicon: Icon or 'big' keyword for big default icons   (Default: Default icons)
^top
anonymous.Location
Anonymous type for store location

⎆floatlon: Longitude
⎆floatlat: 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

⎆intx: x
⎆inty: y
⌥intz: z   (Default: undefined)
^top
anonymous.Range
Anonymous type for store range

⎆intmin: Mininum value (inclusive)
⎆intmax: Maximun value (inclusive)
^top
anonymous.Bound
Anonymous type for store boundary

⎆floatminLon: Mininum longitude (inclusive)
⎆floatminLat: Mininum latitude (inclusive)
⎆floatmaxLon: Maxinum longitude (inclusive)
⎆floatmaxLat: Maxinum latitude (inclusive)
^top
anonymous.Icon
Anonymous type for store icon

⎆URLurl: Icon image URL
⎆HTMLhtml: Custom icon code, override url parameter
⌥Pointoffset: Icon offset   (Default: Center of icon)
^top
anonymous.Tile
Anonymous type for store tile

⎆intu: x-axis id
⎆intv: y-axis id
⎆intw: inverse zoom level
⌥intux: 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

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

⌥intwidth: width   (Default: Use range of width)
⌥intminWidth: Mininum width   (Default: Equal to width)
⌥intmaxWidth: Maximun width   (Default: Equal to width)
⌥intheight: height   (Default: Use range of height)
⌥intminHeight: Mininum height   (Default: Equal to height)
⌥intmaxHeight: 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 resize
Can prevent default
resize
Map resized
repaint
Map repainted
zoom
Zoom level changed
zoomRange
Zoom range changed
location
Map location changed
fullscreen
Map enter/exit fullsceen
*
⏎boolIs fullscreen
suggest
Suggest result is ready

⏎ObjectResult
search
Search result is ready

⏎ObjectResult
address
Address result is ready

⏎ObjectResult
beforeContextmenu
Context menu is going to appear
Can prevent default

⏎MenuEventMenu event
contextmenu
Context menu appeared
mousemove
User move mouse (without drag)

⏎PointCursor point
click
User click/touch on map

⏎PointClick point
doubleClick
User double click/touch on map
Can prevent default

⏎PointClick point
wheel
User scroll wheel

⏎PointWheel point
pinch
User pinch map

⏎PointPinch point
pinchEnd
User stop pinch map
drag
User drag map
Can prevent default

⏎PointOffset
drop
User stop drag map
Can prevent default
layerChange
Layer changed

⏎LayerChange layer
overlayChange
Overlay changed

⏎LongdoOverlayOverlay
overlaySelect
User select overlay

⏎LongdoOverlayOverlay
overlayClick
User click overlay
Can prevent default

⏎LongdoOverlayOverlay
overlayLoad
overlay result is ready

⏎ObjectData
overlayDrag
User drag overlay

⏎LongdoOverlayOverlay
overlayDrop
User drop overlay

⏎LongdoOverlayOverlay
overlayMove
Overlay moved

⏎LongdoOverlayOverlay
overlayHover
Mouse hover over overlay

⏎LongdoOverlayOverlay
overlayLeave
Mouse leave overlay

⏎LongdoOverlayOverlay
popupLoadDetail
Popup load detail
Can prevent default

⏎PopupPopup
guideError
Routing guide error

⏎intError code
guideComplete
Routing guide complete

⏎Object[]Guide list
pathError
Routing path error

⏎intError code
pathComplete
Routing path complete

⏎ObjectData
beforeGeolocation
Geolocation request
geolocation
Geolocation response

⏎PositionPosition
See Also:dev.w3.org/geo/api/spec-source.html#position_interface
geolocationError
Geolocation error

⏎PositionErrorError
See Also:dev.w3.org/geo/api/spec-source.html#position_error_interface
connectionError
Connection error

⏎stringSource
^top
beforeContextmenu event
Property/Method List
Context menu location
Add element to menu

⎆Element|HTMLelement: Element
^top
longdo.Event
longdo.Event(map)
Event class

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

See Also:Map.Event
Property/Method List
bind
bind(eventName, handler)
Bind event

⎆stringeventName: Name of event
⎆delegatehandler: Handler function
⏎thisSelf

See Also:EventEnum
unbind
unbind(eventName, handler)
Unbind event

⎆stringeventName: Name of event
⎆delegatehandler: Handler function
⏎thisSelf
pause
pause(state)
Pause event

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
^top
longdo.LineStyle
Line style enumeration

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

⎆Location[]locationList: List of locations
⌥GeometryOptionsoptions: Extra options   (Default: Default value)
Property/Method List
update
update(newOptions)
Update overlay options
only lineWidth, lineColor, fillColor and lineStyle are support

⎆GeometryOptionsnewOptions: New options value
⏎thisSelf
^top
longdo.Polygonextends longdo.Polyline
longdo.Polygon(locationList, options)
Polygon class

⎆Location[]locationList: List of Locations
⌥GeometryOptionsoptions: Extra options   (Default: Default value)
Property/Method List
contains
contains(overlay)
Tests if a specified overlay is inside the boundary of this polygon (for simple polygon)

⎆Location|LongdoOverlayoverlay: Overlay (support only location, marker, popup and dot)
⏎boolContain
^top
longdo.Circleextends longdo.Polyline
longdo.Circle(location, radius, options)
Circle class

⎆Locationlocation: Center location
⎆Numberradius: Circle radius in degree
⌥GeometryOptionsoptions: Extra options   (Default: Default value)
^top
longdo.Polycurveextends longdo.Polyline
longdo.Polycurve(locationList, options)
Polycurve class

Cubic bezier curve

⎆Location[]locationList: List of Locations
⌥GeometryOptionsoptions: Extra options   (Default: Default value)
^top
longdo.Dotextends longdo.Polyline
longdo.Dot(location, options)
Dot class

⎆Locationlocation: Location
⌥GeometryOptionsoptions: Extra options   (Default: Default value)
^top
longdo.Rectangleextends longdo.Polygon
longdo.Rectangle(location, size, options)
Rectangle class
can apply texture

⎆Locationlocation: Top-left location
⎆Sizesize: Size in degree
⌥GeometryOptionsoptions: Extra options   (Default: Default value)
^top
longdo.Keyboard
longdo.Keyboard(placeholder, map, handler)
Keyboard class

Private constructor
⎆Elementplaceholder: Placeholder element
⎆Mapmap: Map
⎆Objecthandler: Handler

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

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
enableInertia
enableInertia(state)
Enable inertia when key up

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
^top
longdo.Mouse
longdo.Mouse(placeholder, map, handler)
Mouse class
Support mouse and touchscreen up to 2 touches

Private constructor
⎆Elementplaceholder: Placeholder element
⎆Mapmap: Map
⎆Objecthandler: Handler

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

⎆boolstate: New state
⏎thisSelf
enableClick
enableClick(state)
Enable click

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
enableDrag
enableDrag(state)
Enable drag

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
enableWheel
enableWheel(state)
Enable wheel

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
enableInertia
enableInertia(state)
Enable inertia when drag end

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
overlayDoubleClick
overlayDoubleClick(state)
Enable double click event on overlay

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
^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
Custom
Custom type, LayerOptions.url must be function
Longdo
Default type
^top
longdo.Layer
longdo.Layer(name, options)
Layer class

⎆stringname: Name of layer
⌥LayerOptionsoptions: Extra options   (Default: Default value)
Property/Method List
name
name()
Get name

⏎stringName
refresh
refresh()
Get refresh interval

⏎intRefresh interval in second
opacity
opacity()
Get opacity

⏎NumberLayer opacity
weight
weight()
Get weight

⏎intWeight, lighter will float, heavier will sink
^top
longdo.Layers
Layer list singleton class

Static class
Property/Method List
NORMAL
Standard base layer (TH)
NORMAL_EN
Standard 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
MAPQUEST
Map Quest base layer
OPENCYCLE
Open Cycle base layer
SATELLITE
Satellite image base layer
TERRAIN
Bluemarble terrain base layer
GISTDA_SPOT5
SPOT5 satellite layer
THAICHOTE
Thaichote satellite layer
BLANK
Blank base layer
CLEAR
Clear 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
GOOGLE
Google satellite image external layer (TH)
GOOGLE_EN
Google satellite image external layer (EN)
GOOGLE_ROAD
Google road external layer (First load language)

See Also:stackoverflow.com/questions/7065420
byName
byName(name)
Get layer by name

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

Static class
Property/Method List
EPSG3857
EPSG3857 projection (WGS 84 / Pseudo-Mercator) - sphere earth
EPSG4326
EPSG4326 projection (WGS84) - ellipsoid earth
getBound
getBound(projection)
Get boundary

⎆Projectionsprojection: Projection
⏎BoundWorld boundary
^top
longdo.LayerCollection
longdo.LayerCollection(map)
LayerCollection class

Private constructor
⎆Mapmap: Map

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

⎆Layerlayer: Base layer
⏎thisSelf
add
add(layer)
Add non-base layer to collection

⎆Layerlayer: Non-base layer
⏎thisSelf
insert
insert(index, layer)
Insert non-base layer to collection

⎆intindex: Position of layer
⎆Layerlayer: Non-base layer
⏎thisSelf
remove
remove(layer)
Remove non-base layer from collection

⎆Layerlayer: Non-base layer
⏎thisSelf
clear
clear()
Clear all non-base layers in collection

⏎thisSelf
list
list()
List layers in collection

⏎Layer[]List of layers in collection
size
size()
Size of collection

⏎intSize of collection
contains
contains(layer)
Is collection contains a specified layer

⎆Layerlayer: Layer
⏎boolContain
externalMap
externalMap()
External map

⏎stringExternal map layer
externalOptions
externalOptions(options)
External options

Getter
⏎ExternalOptionsCurrent options

Setter
⎆ExternalOptionsstate: New options
⏎thisSelf
^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

⌥MapOptionsoptions: Extra options   (Default: Default value)
Property/Method List
id
id()
Get map id

⏎intID
resize
resize()
Resize map
Call this function when resize or reposition map

⏎thisSelf
repaint
repaint(mode)
Repaint map

⌥Objectmode: For internal use   (Default: null)
⏎thisSelf
pause
pause(state)
Pause map from repaint

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
placeholder
placeholder()
Placeholder

⏎ElementPlaceholder
projection
projection()
Projection

⏎ProjectionProjection
zoom
zoom(value, animate, pivot)
Zoom

Getter
⏎NumberCurrent zoom

Setter
⎆Number|boolvalue: New zoom or direction
⌥boolanimate: Show animation   (Default: true)
⌥Pointpivot: Pivot of zoom   (Default: center of screen)
⏎thisSelf
zoomRange
zoomRange(value)
Zoom range

Getter
⏎RangeCurrent zoom range

Setter
⎆Rangevalue: New zoom range
⏎thisSelf
location
location(value, animate)
Location

Getter
⏎LocationCurrent location
⌥Point|LocationModemode: use LocationMode.Pointer for get location at mouse position or Point for arbitrary location   (Default: crosshair location)

Setter
⎆Location|LocationModevalue: New location, use LocationMode.Geolocation for set value to geolocation
⌥boolanimate: Show animation   (Default: true)
⏎thisSelf
bound
bound(value, pivot)
Bound

Getter
⏎BoundCurrent bound

Setter
⎆Boundvalue: New bound
⌥Locationpivot: Pivot of bound   (Default: center of bound)
⏎thisSelf
move
move(offset, animate)
Move map

⎆Pointoffset: Offset in pixel
⌥boolanimate: Show animation   (Default: true)
⏎thisSelf
pinch
pinch(value, screen)
Pinch

⎆floatvalue: Multiplier
⎆Pointscreen: Position on screen
⏎thisSelf
pinchEnd
pinchEnd(screen)
Pinch end

⎆Pointscreen: Position on screen
⏎thisSelf
language
language(value)
All components language in ISO 639-1

Getter
⏎stringCurrent language

Setter
⎆stringvalue: New language
⏎thisSelf

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

⏎thisSelf
pageToScreen
Point in placeholder

⎆Pointpage: Position from top-left of page
@returns {Point) position from top-left of map
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.OverlayWeight
Overlay weight enumeration

Static class
Property/Method List
Top
Top flag
^top
longdo.Markerextends LongdoOverlay
longdo.Marker(location, options)
Marker class

⎆Locationlocation: Marker location
⌥MarkerOptionsoptions: Extra options   (Default: Default value)
^top
longdo.Popup(location, options)
Popup class

⎆Locationlocation: Popup location
⌥PopupOptionsoptions: Extra options   (Default: Default value)
Property/Method List
title
title(value)
Title of default style popup

Getter
⏎ElementTitle

Setter
⎆HTMLvalue: New title
⏎thisSelf
detail
detail(value)
Detail of default style popup

Getter
⏎ElementDetail

Setter
⎆HTMLvalue: New detail
⏎thisSelf
fit
fit()
Fit popup width to content

⏎thisSelf
focus
focus()
Move popup into map

⏎thisSelf
^top
longdo.Overlays
Overlay list singleton class
Property/Method List
cameras
Cameras overlay

⌥boolpopup: Enable popup   (Default: true)
⌥boolmotion: Enable motion camera   (Default: true)
events
Events overlay

⌥boolpopup: Enable popup   (Default: true)
Object
Object(id, dataset, options)
Predefined object overlay

⎆stringid: Object ID
⎆stringdataset: Object dataset
⌥MarkerOptions|GeometryOptionsoptions: Extra options   (Default: Default value)
^top
longdo.OverlayCollection
longdo.OverlayCollection(map, handler)
OverlayCollection class

Private constructor
⎆Mapmap: Map
⎆Objecthandler: Handler

See Also:Map.Overlays
Property/Method List
add
add(overlay)
Add overlay to collection

⎆LongdoOverlayoverlay: Overlay
⏎thisSelf
remove
remove(overlay)
remove overlay from collection

⎆LongdoOverlayoverlay: Overlay
⏎thisSelf
clear
clear()
Clear all overlays in collection

⏎thisSelf
list
list()
List overlays in collection

⏎LongdoOverlay[]List of overlays
size
size()
Size of collection

⏎intSize
move
move(overlay, location)
Move overlay

⎆LongdoOverlayoverlay: Overlay
⎆Locationlocation: New location
⏎thisSelf
load
load(mode)
Load pre-defined overlays to collection

⎆Overlaysmode: Mode
⏎thisSelf
unload
unload(mode)
Unload pre-defined overlays from collection

⎆Overlaysmode: Mode
⏎thisSelf
pop
pop(overlay, mode, atPointer)
Show/hide popup if any

⎆LongdoOverlayoverlay: Overlay
⌥boolmode: Show or hide   (Default: toggle)
⏎thisSelf
enableAutoClosePopup
enableAutoClosePopup(state)
Enable auto close popup

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
enableAutoFocusPopup
enableAutoFocusPopup(state)
Enable auto focus popup

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
lastOpenPopup
lastOpenPopup()
Last open popup

⏎PopupLast open popup
^top
longdo.RouteType
Route type enumeration

Static class
Property/Method List
Road
Road
Air
Air
Railway
Railway
Ferry
Ferry
Tollway
Tollway
All
All
^top
longdo.RouteMode
Route mode enumeration

Static class
Property/Method List
Traffic
Traffic
Cost
Cost
Distance
Distance
^top
longdo.Route
longdo.Route(map)
Route class

Private constructor
⎆Mapmap: Map

See Also:Map.Routing
Property/Method List
language
language(value)
Language in ISO 639-1

Getter
⏎stringCurrent language

Setter
⎆stringvalue: New language
⏎thisSelf

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

Getter
⏎ElementCurrent placeholder

Setter
⎆Elementvalue: New placeholder
⏎thisSelf
enableContextMenu
enableContextMenu()
Enable context menu

⏎thisSelf
line
line(type, value)
Route line options
Avaliable type are road, air, rail, ferry, focus

Getter
⎆stringtype: Route type
⏎GeometryOptionsCurrent options

Setter
⎆stringtype: Route type
⎆GeometryOptionsvalue: New options
⏎thisSelf
auto
auto(state)
Auto update

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
mode
mode(value)
Search mode

Getter
⏎RouteModeCurrent mode

Setter
⎆RouteModevalue: New mode
⏎thisSelf
enableRoute
enableRoute(routeType, state)
Enable route

Getter
⎆RouteTyperouteType: Route type
⏎boolCurrent state

Setter
⎆RouteTyperouteType: Route type
⎆boolstate: New state
⏎thisSelf
useStopMarker
useStopMarker(state)
Use stop marker for last destination

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
usePoiName
usePoiName(state)
Use near by POI name as destination in the guide
This function don't change current guide

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
add
add(destination)
Add destination to collection

⎆Marker|Locationdestination: Destination
⏎thisSelf
insert
insert(index, destination)
Insert destination to collection

⎆Marker|Locationdestination: Destination
⏎thisSelf
remove
remove(destination)
Remove destination from collection

⎆Markerdestination: Destination
⏎thisSelf
removeAt
removeAt(index)
Remove destination at index

⎆intindex: Destination index
⏎thisSelf
clearDestination
clearDestination()
Clear destination

⏎thisSelf
clearPath
clearPath()
Clear path

⏎thisSelf
clear
clear()
Clear everything

⏎thisSelf
list
list()
List destination in collection

⏎Marker[]List of destinations
size
size()
Size of collection

⏎intSize
reverse
reverse()
Reverse destinations

⏎thisSelf
search
search()
Search the route

⏎thisSelf
distance
distance(format)
Distance of route

⎆boolformat: With format
⏎int|stringDistance
interval
interval(format)
Interval of time for travel through route

⎆boolformat: With format
⏎int|stringInterval
guide
guide(format)
Guide for travel through route

⎆boolformat: With format
⏎string|ElementElement
exportRouteLine
exportRouteLine(options)
Get route line as single polyline

⌥GeometryOptionsoptions: Extra options   (Default: Default value)
⏎PolylineGeometry overlay
^top
longdo.Search(map)
Search class

Private constructor
⎆Mapmap: Map

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

Getter
⏎stringCurrent language

Setter
⎆stringvalue: New language
⏎thisSelf

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

Getter
⏎ElementCurrent placeholder
⌥SearchUiOptionsoptions: Extra options   (Default: Default value)

Setter
⎆Elementvalue: New placeholder
⏎thisSelf
suggest
suggest(keyword, options)
Suggest

⎆stringkeyword: Keyword
⌥SuggestOptionsoptions: Extra options   (Default: Default value)
⏎thisSelf
search
search(keyword, options)
Search

⎆stringkeyword: Keyword
⌥SearchOptionsoptions: Extra options   (Default: Default value)
⏎thisSelf
address
address(location)
Address

⎆Location|stringlocation: Location / Geocode / POI ID
⏎thisSelf
nearPoi
nearPoi(location, options)
Near by POI

⎆Locationlocation: Location
⌥NearPoiOptionsoptions: Extra options   (Default: Default value)
⏎thisSelf
clear
clear()
Clear

⏎thisSelf
^top
longdo.TagCollection
longdo.TagCollection(map)
TagCollection class

Private constructor
⎆Mapmap: Map

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

Getter
⏎stringCurrent language

Setter
⎆stringvalue: New language
⏎thisSelf

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

⎆string|delegatetag: Name of tag or callback function
⌥TagOptionsoptions: Extra options   (Default: Default value)
⏎thisSelf
add
add(tag, options)
Add tag to collection

⎆string|delegatetag: Name of tag or callback function
⌥TagOptionsoptions: Extra options   (Default: Default value)
⏎thisSelf
remove
remove(tag)
Remove tag from collection

⎆stringtag: Name of tag
⏎thisSelf
clear
clear()
Clear all tags in collection

⏎thisSelf
list
list()
List tags in collection

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

⏎intSize
pop
Show tag popup

⎆Objectdata: Tag data
⏎thisSelf
^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
longdo.MenuBar(options)
Menu bar class

Private constructor
⌥MenuBarOptionsoptions: Extra options   (Default: Default value)
Property/Method List
selectIndex(index)
Select index

⎆integerindex: Menu index
⏎thisSelf
selectValue(value)
Select value

⎆Objectvalue: Menu value
⏎thisSelf
visible(state)
Visible

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
^top
longdo.TagPanel
longdo.TagPanel(options)
Tag panel class
⌥TagPanelOptionsoptions: Extra options   (Default: Default value)
^top
longdo.CustomControl
longdo.CustomControl(options)
Custom control class
⌥CustomControlOptionsoptions: Extra options   (Default: Default value)
^top
longdo.DPad
longdo.DPad(placeholder, map)
DPad class

Private constructor
⎆Elementplaceholder: Placeholder element
⎆Mapmap: Map

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

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
^top
longdo.Zoombar
longdo.Zoombar(placeholder, map)
Zoombar class

Private constructor
⎆Elementplaceholder: Placeholder element
⎆Mapmap: Map

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

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
^top
longdo.ZoombarMini
longdo.ZoombarMini(placeholder, map)
ZoombarMini class

Private constructor
⎆Elementplaceholder: Placeholder element
⎆Mapmap: Map

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

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
^top
longdo.Geolocation
longdo.Geolocation(placeholder, map)
Geolocation class

Private constructor
⎆Elementplaceholder: Placeholder element
⎆Mapmap: Map

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

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
^top
longdo.Toolbar
longdo.Toolbar(placeholder, map, handler)
Toolbar class

Private constructor
⎆Elementplaceholder: Placeholder element
⎆Mapmap: Map
⎆Objecthandler: Handler

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

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
measureList
measureList()
List measure overlays

⏎LongdoOverlay[]List of overlays
activeTool
activeTool()
Get current active tool

⏎stringMode
^top
longdo.LayerSelector
longdo.LayerSelector(placeholder, map, mode)
LayerSelector class

Private constructor
⎆Elementplaceholder: Placeholder element
⎆Mapmap: Map
⎆stringmode: Mode (undefined / button / dropdown)

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

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
^top
longdo.Fullscreen
longdo.Fullscreen(placeholder, map)
Fullscreen class

Private constructor
⎆Elementplaceholder: Placeholder element
⎆Mapmap: Map

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

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
toggle
toggle(mode)
Toggle fullscreen

⌥boolmode: Force fullscreen or normal size   (Default: toggle)
⏎thisSelf
^top
longdo.Crosshair
longdo.Crosshair(placeholder, isMini)
Crosshair class

Private constructor
⎆Elementplaceholder: Placeholder element

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

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
^top
longdo.Scale
longdo.Scale(placeholder)
Scale class

Private constructor
⎆Elementplaceholder: Placeholder element

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

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
^top
longdo.Legend
longdo.Legend(placeholder, map)
Legend class

Private constructor
⎆Elementplaceholder: Placeholder element
⎆Mapmap: Map

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

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
enableLoadEvents
enableLoadEvents(state)
Enable automaic load events when trafic layer is present

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
enableLoadCameras
enableLoadCameras(state)
Enable automaic load cameras when trafic layer is present

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
^top
longdo.Notice
longdo.Notice(placeholder, isMini)
Notice class

Private constructor
⎆Elementplaceholder: Placeholder element

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

Private constructor
⎆Elementplaceholder: Placeholder element
⎆Mapmap: Map

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

Getter
⏎boolCurrent state

Setter
⌥Point|boolscreen: Point on screen   (Default: hide)
⌥Locationlocation: Location   (Default: hide)
⏎thisSelf
^top
longdo.Tooltip
longdo.Tooltip(placeholder, map)
Tooltip

Private constructor
⎆Elementplaceholder: Placeholder element
⎆Mapmap: Map

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

Getter
⏎boolCurrent state

Setter
⌥Point|boolscreen: Point on screen   (Default: hide)
⏎thisSelf
set
set(message)
Set message

@param {HTML} [message] Message
⏎thisSelf
get
get(message)
Get currentmessage

⏎HTMLMessage
^top
longdo.PopupMini
longdo.PopupMini(placeholder, map)
PopupMini class

Private constructor
⎆Elementplaceholder: Placeholder element
⎆Mapmap: Map

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

@param {Popup} popup
⌥boolmode: Show or hide   (Default: toggle)
⏎thisSelf
visible
visible(state)
Visible

Getter
⏎boolCurrent state

Setter
⎆boolstate: New state
⏎thisSelf
^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
Mobile
Mobile mode
None
No UI mode
^top
longdo.UiCollection
longdo.UiCollection(map, handler, ui, input)
UiCollection class

Private constructor
⎆Mapmap: Map
⎆Objecthandler: Handler
⎆UiComponentui: Default UI
⎆boolinput: Use default input

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

Getter
⏎stringCurrent language

Setter
⎆stringvalue: New language
⏎thisSelf

See Also:en.wikipedia.org/wiki/List_of_ISO_639-1_codes
add
add(control, position)
Add control

⎆LongdoControlcontrol: Control
⌥UiPositionposition: Position   (Default: UiPosition.Left)
⏎thisSelf
remove
remove(control)
Remove control

⎆LongdoControlcontrol: Control
⏎thisSelf
TopLeft
Top-left area
TopRight
Top-right area
BottomLeft
Bottom-left area
BottomRight
Bottom-right area
DPad
Directional pad

See Also:DPad
Geolocation
Geolocation

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
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)
Append element

⎆Elementelement: Parent element
⎆stringchildName: Child element name
⌥ObjectpropertyMap: Child element property   (Default: no property)
⏎ElementChild element
prepend
prepend(element, childName, propertyMap, beforeElement)
Prepend element

⎆Elementelement: Parent element
⎆stringchildName: Child element name
⌥ObjectpropertyMap: Child element property   (Default: no property)
⌥ElementbeforeElement: Before element   (Default: First child)
⏎ElementChild element
empty
empty(element)
Empty element

⎆Elementelement: Parent element
⏎Elementelement
addClass
addClass(element, className)
Add class to element

⎆Elementelement: Element
⎆stringclassName: Class
⏎ElementElement
removeClass
removeClass(element, className)
Remove class from element

⎆Elementelement: Element
⎆stringclassName: Class
⏎ElementElement
hasClass
hasClass(element, className)
Has class

⎆Elementelement: Element
⎆stringclassName: Class
⏎boolHas class
scale
Scale element

⎆Elementelement: Element
⎆Numberscale: Scale
⎆Pointoffset: offsety
⎆Pointorigin: origin
translate
translate(element, offset)
Translate element

⎆Elementelement: Element
⎆Pointoffset: Offset
transition
transition(element, state)
Transition element

⎆Elementelement: Element
⎆boolstate: State;
transitionEnd
transitionEnd(element, callback)
Transition end callback

⎆Elementelement: Element
⌥delegatecallback: Callback function   (Default: no callback)
loadStyle
loadStyle(url, media)
Load stylesheet

⎆stringurl: Stylesheet URL
⌥stringmedia: Media   (Default: all)
loadScript
loadScript(url, callback)
Load script

⎆stringurl: Script URL
⌥delegatecallback: Callback function   (Default: no callback)
validateLocation
validateLocation(location)
Validate location

⎆Locationlocation: Location
⏎boolIs location valid
boundOfTile
boundOfTile(projection, tile)
Boundary of tile

⎆Projectionsprojection: Projection
⎆Tiletile: Tile
⏎BoundLocation bound
centerOfBound
centerOfBound(bound)
Center of boundary

⎆BoundLocation: bound
⏎Locationlocation Location
isInRange
isInRange(value, range)
Is value inside range

⎆intvalue: Value
⎆Rangerange: Range
⏎boolIs value inside range
isAbsInRange
isAbsInRange(value, range)
Is Absolute value inside range

⎆intvalue: Value
⎆intrange: Range
⏎boolIs Absolute value inside range
isPointInRect
isPointInRect(x, y, l, t, r, b)
Is point in rectangle

⎆intx: X of point
⎆inty: Y of point
⎆intl: Left of rectangle
⎆intt: Top of rectangle
⎆intr: Right of rectangle
⎆intb: bottom of rectangle
⏎boolIs point in rectangle
isPointInPolygon
isPointInPolygon(x, y, pointList)
Is point in polygon

⎆intx: X of point
⎆inty: Y of point
⎆point[]pointList: Points of polygon
⏎boolIs point in polygon
isPointOnPolyline
isPointOnPolyline(x, y, pointList, width)
Is point on polyline

⎆intx: X of point
⎆inty: Y of point
⎆Point[]pointList: Points of polyline
⌥intwidth: Line width   (Default: 0)
⏎boolIs point on polyline
closestPointOnLine
closestPointOnLine(x, y, x1, y1, x2, y2)
Find closest point on line

⎆intx: X of point
⎆inty: Y of point
⎆intx1: Begin of line's X
⎆inty1: Begin of line's Y
⎆intx2: End of line's X
⎆inty2: End of line's Y
⏎PointClosest point on line
polygonPivot
polygonPivot(locationList)
Polygon pivot

⎆Location[]locationList: List of location
⏎LocationLocation mean
polylinePivot
polylinePivot(locationList)
Polyline pivot (asymmetric)

⎆Location[]locationList: List of Location
⏎LocationLocation median
locationBound
locationBound(locationList)
Location bound

⎆Location[]locationList: List of Location
⏎BoundLocation bound
averageLocation
averageLocation(projection, location1, location2)
Average location

⎆Projectionsprojection: Projection
⎆Locationlocation1: Location 1
⎆Locationlocation2: Location 2
⏎LocationLocation mean
square
square(value)
Square value

⎆intvalue: Value
⏎intSquare of value
distance
distance(locationList, language)
Polyline distance

⎆Location[]locationList: List of Location
⌥stringlanguage: Language in ISO 639-1   (Default: unformated)
⏎float|stringDistance
area
area(locationList, language)
Polygon area (for simple polygon)

⎆Location[]locationList: List of Location
⌥stringlanguage: Language in ISO 639-1   (Default: unformated)
⏎float|stringArea
longitudeLength
longitudeLength(lat)
Length of a degree of longitude

⎆floatlat: Latitude
⏎floatmetre
latitudeLength
latitudeLength(lat)
Length of a degree of latitude

⎆floatlat: Latitude
⏎floatmetre
bound
bound(value, min, max)
Bound value

⎆intvalue: Value
⎆intmin: Lower bound
⎆intmax: Upper bound
⏎intBounded value
sameLocation
sameLocation(a, b)
Is same location

⎆Locationa: First location
⎆Locationb: Second location
⏎boolIs same location
lastItem
lastItem(arr)
Last item in array

⎆Object[]array: Array
⏎ObjectLast item in array
capFirst
capFirst(string)
Capitalise first letter

@param {string} String
⏎stringFormatted string
formatDate
formatDate(date, language)
Format date

⎆stringdate: Date string
⌥stringlanguage: Language in ISO 639-1   (Default: th)
⏎stringFormatted date string
formatTime
formatTime(time)
Format time

⎆stringtime: Time string
⏎stringFormatted time string
formatDateTimeRange
formatDateTimeRange(startDatetime, stopDatetime, language)
Format datetime range

⎆stringstartDatetime: Start datetime string
⎆stringstopDatetime: Stop datetime string
⌥stringlanguage: Language in ISO 639-1   (Default: th)
⏎stringFormatted datetime range string
formatInterval
formatInterval(interval, language)
Format interval

⎆Numberinterval: Time interval
⌥stringlanguage: Language in ISO 639-1   (Default: th)
⏎stringFormatted interval string
formatDistance
formatDistance(distance, language)
Format distance

⎆Numberdistance: Distance
⌥stringlanguage: Language in ISO 639-1   (Default: th)
⏎stringFormatted distance string
formatArea
formatArea(area, language)
Format area

⎆Numberarea: Area
⌥stringlanguage: Language in ISO 639-1   (Default: th)
⏎stringFormatted area string
formatThaiArea
formatThaiArea(area, language)
Format thai area

⎆Numberarea: Area
⌥stringlanguage: Language in ISO 639-1   (Default: th)
⏎stringFormatted area string
numberWithCommas
numberWithCommas(number)
Number with commas

⎆int|stringnumber: Number
⏎stringNumber with commas
overlayFromWkt
overlayFromWkt(wkt, options)
Create overlay from WKT

⎆stringwkt: Well-known text
⌥GeometryOptionsoptions: Extra options   (Default: Default value)
⏎Polyline[]Geometry overlay
hexToRgba
hexToRgba(color)
Create rgba color notation from hexadecimal color notation

⎆stringcolor: Hexadecimal color notation
⏎stringEquivalent rgba color notation
locationToDMS
locationToDMS(location)
Location to degrees minutes seconds

@param {Location} location
⏎Objectdegrees minutes seconds version of location
locationToUTMZone
locationToUTMZone(location)
Location to UTM zone

@param {Location} location
⏎ObjectUTM zone and hemisphere
isHD
isHD()
Is screen HD

⏎boolIs screen HD
^top