new Map(container, options) [source]
var map = new maptalks.Map("map",{
center: [180,0],
zoom: 4,
baseLayer : new maptalks.TileLayer("base",{
urlTemplate:'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
subdomains:['a','b','c']
}),
layers : [
new maptalks.VectorLayer('v', [new maptalks.Marker([180, 0]])
]
});
Parameter | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
container
|
string | HTMLElement | object | The container to create the map on, can be: 1. A HTMLElement container. 2. ID of a HTMLElement container. 3. A canvas compatible container in node, e.g. node-canvas, canvas2svg |
||||||||||||||||||||||||||||
options
|
Object | construct options
Properties
|
Extends:
Mixes From:
Fires:
- viewchange
- baselayerchangestart
- baselayerchangeend
- setbaselayer
- baselayerload
- baselayerremove
- addlayer
- removelayer
- resize
- movestart
- moving
- moveend
- load
- zoomstart
- zooming
- zoomend
- mousedown
- mouseup
- mouseover
- mouseout
- mousemove
- click
- dblclick
- contextmenu
- keypress
- touchstart
- touchmove
- touchend
- fullscreenstart
- fullscreenend
- cancelfullscreen
- touchzoomstart
- touchzooming
- touchzoomend
Members
(constant) options
Properties:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options
|
Object | map's options, options must be updated by config method: map.config('zoomAnimation', false); Properties
|
- Source:
(constant) JSON_VERSION
Properties:
Type | Description |
---|---|
String | Version of the JSON schema. |
- Source:
Static Methods
(protected, static) addOnLoadHook(fn) [source]
Add hooks for additional codes when map's loading complete, useful for plugin developping.
Parameter | Type | Description |
---|---|---|
fn
|
function |
Returns:
Map:(static) fromJSON(container, mapJSON, optionsopt) [source]
Reproduce a map from map's profile JSON.
var map = Map.fromJSON('map', mapProfile);
Parameter | Type | Default | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
container
|
string | HTMLElement | object | The container to create the map on, can be: 1. A HTMLElement container. 2. ID of a HTMLElement container. 3. A canvas compatible container in node, e.g. node-canvas, canvas2svg |
|||||||||||||
mapJSON
|
Object | map's profile JSON | |||||||||||||
options
opt
|
Object | null | options
Properties
|
Returns:
Map:Methods
isLoaded() [source]
Whether the map is loaded or not.
Returns:
Boolean:(protected) isCanvasRender() [source]
Whether the map is rendered by canvas
var isCanvas = map.isCanvasRender();
Returns:
Boolean:getView() [source]
Get the view of the Map.
Returns:
View: map's viewsetView(view) [source]
Change the view of the map.
A view is a series of settings to decide the map presentation:
1. the projection.
2. zoom levels and resolutions.
3. full extent.
There are some predefined views, and surely you can define a custom one..
View can also be set by map.config('view', view);
A view is a series of settings to decide the map presentation:
1. the projection.
2. zoom levels and resolutions.
3. full extent.
There are some predefined views, and surely you can define a custom one..
View can also be set by map.config('view', view);
map.setView({
projection:'EPSG:4326',
resolutions: (function() {
var resolutions = [];
for (var i=0; i < 19; i++) {
resolutions[i] = 180/(Math.pow(2, i)*128);
}
return resolutions;
})()
});
Parameter | Type | Description |
---|---|---|
view
|
View | view settings |
Fires:
Returns:
Map: thisgetProjection() [source]
Get the projection of the map.
Projection is an algorithm for map projection, e.g. well-known Mercator Projection
A projection must have 2 methods:
1. project(coordinate) - project the input coordinate
2. unproject(coordinate) - unproject the input coordinate
Projection also contains measuring method usually extended from a measurer:
1. measureLength(coord1, coord2) - compute length between 2 coordinates.
2. measureArea(coords[]) - compute area of the input coordinates.
3. locate(coord, distx, disty) - compute the coordinate from the coord with xdist on axis x and ydist on axis y.
Projection is an algorithm for map projection, e.g. well-known Mercator Projection
A projection must have 2 methods:
1. project(coordinate) - project the input coordinate
2. unproject(coordinate) - unproject the input coordinate
Projection also contains measuring method usually extended from a measurer:
1. measureLength(coord1, coord2) - compute length between 2 coordinates.
2. measureArea(coords[]) - compute area of the input coordinates.
3. locate(coord, distx, disty) - compute the coordinate from the coord with xdist on axis x and ydist on axis y.
Returns:
Object:getFullExtent() [source]
Get map's full extent, which is defined in map's view.
eg: {'left': -180, 'right' : 180, 'top' : 90, 'bottom' : -90}
eg: {'left': -180, 'right' : 180, 'top' : 90, 'bottom' : -90}
Returns:
Extent:setCursor(cursor) [source]
Set map's cursor style, cursor style is same with CSS.
map.setCursor('url(cursor.png) 4 12, auto');
Parameter | Type | Description |
---|---|---|
cursor
|
String | cursor style |
Returns:
Map: thisgetCenter() [source]
Get center of the map.
Returns:
Coordinate:setCenter(center) [source]
Set a new center to the map.
Parameter | Type | Description |
---|---|---|
center
|
Coordinate |
Returns:
Map: thisgetSize() [source]
Get map's size (width and height) in pixel.
Returns:
Size:getContainerExtent() [source]
Get container extent of the map
Returns:
PointExtent:getExtent() [source]
Get the geographical extent of map's current view extent.
Returns:
Extent:getProjExtent() [source]
Get the projected geographical extent of map's current view extent.
Returns:
Extent:getMaxExtent() [source]
Get the max extent that the map is restricted to.
Returns:
Extent:setMaxExtent(extent) [source]
Sets the max extent that the map is restricted to.
map.setMaxExtent(map.getExtent());
Parameter | Type | Description |
---|---|---|
extent
|
Extent |
Returns:
Map: thisgetZoom() [source]
Get map's current zoom.
Returns:
Number:getZoomForScale(scale, fromZoom) [source]
Caculate the target zoom if scaling from "fromZoom" by "scale"
Parameter | Type | Description |
---|---|---|
scale
|
Number | |
fromZoom
|
Number |
Returns:
Number: zoom fit for scale starting from fromZoomsetZoom(zoom) [source]
Sets zoom of the map
Parameter | Type | Description |
---|---|---|
zoom
|
Number |
Returns:
Map: thisgetMaxZoom() [source]
Get the max zoom that the map can be zoom to.
Returns:
Number:setMaxZoom(maxZoom) [source]
Sets the max zoom that the map can be zoom to.
Parameter | Type | Description |
---|---|---|
maxZoom
|
Number |
Returns:
Map: thisgetMinZoom() [source]
Get the min zoom that the map can be zoom to.
Returns:
Number:setMinZoom(minZoom) [source]
Sets the min zoom that the map can be zoom to.
Parameter | Type | Description |
---|---|---|
minZoom
|
Number |
Returns:
Map: thiszoomIn() [source]
zoom in
Returns:
Map: thiszoomOut() [source]
zoom out
Returns:
Map: thissetCenterAndZoom(center, zoom) [source]
Sets the center and zoom at the same time.
Parameter | Type | Description |
---|---|---|
center
|
Coordinate | |
zoom
|
Number |
Returns:
Map: thisgetFitZoom(extent) [source]
Caculate the zoom level that contains the given extent with the maximum zoom level possible.
Parameter | Type | Description |
---|---|---|
extent
|
Extent |
Returns:
Number: zoom fit for the extentgetResolution(zoom) [source]
Get map's resolution
Parameter | Type | Description |
---|---|---|
zoom
|
Number | zoom or current zoom if not given |
Returns:
Number: resolutiongetScale(zoom) [source]
Get scale of resolutions from zoom to max zoom
Parameter | Type | Description |
---|---|---|
zoom
|
Number | zoom or current zoom if not given |
Returns:
Number: scalefitExtent(extent, zoomOffset) [source]
Set the map to be fit for the given extent with the max zoom level possible.
Parameter | Type | Description |
---|---|---|
extent
|
Extent | extent |
zoomOffset
|
Number | zoom offset |
Returns:
Map: - thisgetBaseLayer() [source]
Get the base layer of the map.
Returns:
Layer:setBaseLayer(baseLayer) [source]
Sets a new base layer to the map.
Some events will be thrown such as baselayerchangestart, baselayerload, baselayerchangeend.
Some events will be thrown such as baselayerchangestart, baselayerload, baselayerchangeend.
Parameter | Type | Description |
---|---|---|
baseLayer
|
Layer | new base layer |
Fires:
Returns:
Map: thisremoveBaseLayer() [source]
Remove the base layer from the map
Fires:
Returns:
Map: thisgetLayers(filteropt) [source]
Get the layers of the map, except base layer (which should be by getBaseLayer).
A filter function can be given to filter layers, e.g. exclude all the VectorLayers.
A filter function can be given to filter layers, e.g. exclude all the VectorLayers.
var vectorLayers = map.getLayers(function (layer) {
return (layer instanceof VectorLayer);
});
Parameter | Type | Description |
---|---|---|
filter
opt
|
function | a filter function of layers, return false to exclude the given layer. |
Returns:
Array.<Layer>:getLayer(id) [source]
Get the layer with the given id.
Parameter | Type | Description |
---|---|---|
id
|
String | layer id |
Returns:
Layer:addLayer(layer) [source]
Add a new layer on the top of the map.
Parameter | Type | Description |
---|---|---|
layer
|
Layer | Array.<Layer> | one or more layers to add |
Fires:
Returns:
Map: thisremoveLayer(layer) [source]
Remove a layer from the map
Parameter | Type | Description |
---|---|---|
layer
|
String | Array.<String> | Layer | Array.<Layer> | one or more layers or layer ids |
Fires:
Returns:
Map: thissortLayers(layers) [source]
Sort layers according to the order provided, the last will be on the top.
map.addLayer([layer1, layer2, layer3]);
map.sortLayers([layer2, layer3, layer1]);
map.sortLayers(['3', '2', '1']); // sort by layer ids.
Parameter | Type | Description |
---|---|---|
layers
|
Array.<string> | Array.<Layer> | layers or layer ids to sort |
Returns:
Map: thistoDataURL(optionsopt) [source]
Exports image from the map's canvas.
Parameter | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options
opt
|
Object | options
Properties
|
Returns:
String: image of base64 format.coordinateToPoint(coordinate, zoomopt) [source]
Converts a coordinate to the 2D point in current zoom or in the specific zoom.
The 2D point's coordinate system's origin is the same with map's origin.
The 2D point's coordinate system's origin is the same with map's origin.
var point = map.coordinateToPoint(new Coordinate(121.3, 29.1));
Parameter | Type | Description |
---|---|---|
coordinate
|
Coordinate | coordinate |
zoom
opt
|
Number | zoom level |
Returns:
Point: 2D pointpointToCoordinate(point, zoom) [source]
Converts a 2D point in current zoom or a specific zoom to a coordinate.
var coord = map.pointToCoordinate(new Point(4E6, 3E4));
Parameter | Type | Description |
---|---|---|
point
|
Point | 2D point |
zoom
|
Number | zoom level |
Returns:
Coordinate: coordinatecoordinateToViewPoint(coordinate) [source]
Converts a geographical coordinate to view point.
A view point is a point relative to map's mapPlatform panel's position.
A view point is a point relative to map's mapPlatform panel's position.
Parameter | Type | Description |
---|---|---|
coordinate
|
Coordinate |
Returns:
Point:viewPointToCoordinate(viewPoint) [source]
Converts a view point to the geographical coordinate.
Parameter | Type | Description |
---|---|---|
viewPoint
|
Point |
Returns:
Coordinate:coordinateToContainerPoint(coordinate) [source]
Convert a geographical coordinate to the container point.
A container point is a point relative to map container's top-left corner.
A container point is a point relative to map container's top-left corner.
Parameter | Type | Description |
---|---|---|
coordinate
|
Coordinate |
Returns:
Point:containerPointToCoordinate(containerPoint) [source]
Converts a container point to geographical coordinate.
Parameter | Type | Description |
---|---|---|
containerPoint
|
Point |
Returns:
Coordinate:containerPointToViewPoint(containerPoint) [source]
Converts a container point to the view point.
Parameter | Type | Description |
---|---|---|
containerPoint
|
Point |
Returns:
Point:viewPointToContainerPoint(viewPoint) [source]
Converts a view point to the container point.
Parameter | Type | Description |
---|---|---|
viewPoint
|
Point |
Returns:
Point:containerToExtent(containerExtent) [source]
Converts a container point extent to the geographic extent.
Parameter | Type | Description |
---|---|---|
containerExtent
|
PointExtent | containeproints extent |
Returns:
Extent: geographic extentcheckSize() [source]
Checks if the map container size changed and updates the map if so.
Fires:
Returns:
Map: thisdistanceToPixel(xDist, yDist) [source]
Converts geographical distances to the pixel length.
The value varis with difference zoom level.
The value varis with difference zoom level.
Parameter | Type | Description |
---|---|---|
xDist
|
Number | distance on X axis. |
yDist
|
Number | distance on Y axis. |
Returns:
Size: result.width: pixel length on X axis; result.height: pixel length on Y axispixelToDistance(width, height) [source]
Converts pixel size to geographical distance.
Parameter | Type | Description |
---|---|---|
width
|
Number | pixel width |
height
|
Number | pixel height |
Returns:
Number: distance - Geographical distancelocate(coordinate, dx, dy) [source]
Computes the coordinate from the given coordinate with xdist on axis x and ydist on axis y.
Parameter | Type | Description |
---|---|---|
coordinate
|
Coordinate | source coordinate |
dx
|
Number | distance on X axis from the source coordinate |
dy
|
Number | distance on Y axis from the source coordinate |
Returns:
Coordinate: Result coordinategetMainPanel() [source]
Return map's main panel
Returns:
HTMLElement:getPanels() [source]
Returns map panels.
Returns:
Object:(protected) _pointToExtent(extent2D) [source]
Converts a view point extent to the geographic extent.
Parameter | Type | Description |
---|---|---|
extent2D
|
PointExtent | view points extent |
Returns:
Extent: geographic extentoffsetPlatform() [source]
Gets map platform panel's current view point.
Returns:
Point:panTo(coordinate, optionsopt) [source]
Pan to the given coordinate
Parameter | Type | Default | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
coordinate
|
Coordinate | coordinate to pan to | |||||||||||||
options
opt
|
Object | null | pan options
Properties
|
Returns:
Map: thispanBy(point, optionsopt) [source]
Pan the map by the give point
Parameter | Type | Default | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
point
|
Point | distance to pan, in pixel | |||||||||||||
options
opt
|
Object | null | pan options
Properties
|
Returns:
Map: thiscomputeLength(coord1, coord2) [source]
Caculate distance of two coordinates.
var distance = map.computeLength([0, 0], [0, 20]);
Parameter | Type | Description |
---|---|---|
coord1
|
Array.<Number> | Coordinate | coordinate 1 |
coord2
|
Array.<Number> | Coordinate | coordinate 2 |
Returns:
Number: distance, unit is metercomputeGeometryLength(geometry) [source]
Caculate a geometry's length.
Parameter | Type | Description |
---|---|---|
geometry
|
Geometry | geometry to caculate |
Returns:
Number: length, unit is metercomputeGeometryArea(geometry) [source]
Caculate a geometry's area.
Parameter | Type | Description |
---|---|---|
geometry
|
Geometry | geometry to caculate |
Returns:
Number: area, unit is sq.meteridentify(opts, callback) [source]
Identify the geometries on the given coordinate.
map.identify({
coordinate: [0, 0],
layers: [layer]
},
geos => {
console.log(geos);
});
Parameter | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts
|
Object | the identify options
Properties
|
||||||||||||||||||||||||||||
callback
|
function | the callback function using the result geometries as the parameter. |
Returns:
Map: thisrequestFullScreen() [source]
Request for the full screen
Returns:
Map: thiscancelFullScreen() [source]
Cancel full screen
Returns:
Map: thistoJSON(optionsopt) [source]
Export the map's json, a snapshot of the map in JSON format.
It can be used to reproduce the instance by fromJSON method
It can be used to reproduce the instance by fromJSON method
Parameter | Type | Default | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options
opt
|
Object | null | export options
Properties
|
Returns:
Object: layer's JSONaddControl(control) [source]
Add a control on the map.
Parameter | Type | Description |
---|---|---|
control
|
control.Control | contorl to add |
Returns:
Map: thisremoveControl(control) [source]
Remove a control from the map.
Parameter | Type | Description |
---|---|---|
control
|
control.Control | control to remove |
Returns:
Map: this(mixin) on(eventsOn, handler, contextopt) [source]
Register a handler function to be called whenever this event is fired.
foo.on('mousedown mousemove mouseup', onMouseEvent, foo);
Parameter | Type | Default | Description |
---|---|---|---|
eventsOn
|
String | event types to register, seperated by space if more than one. | |
handler
|
function | handler function to be called | |
context
opt
|
Object | null | the context of the handler |
Mixes From:
Returns:
Any: this(mixin) addEventListener(eventTypes, handler, contextopt) [source]
Alias for on
Parameter | Type | Default | Description |
---|---|---|---|
eventTypes
|
String | event types to register, seperated by space if more than one. | |
handler
|
function | handler function to be called | |
context
opt
|
Object | null | the context of the handler |
Mixes From:
Returns:
: this(mixin) once(eventTypes, handler, contextopt) [source]
Same as on, except the listener will only get fired once and then removed.
foo.once('mousedown mousemove mouseup', onMouseEvent, foo);
Parameter | Type | Default | Description |
---|---|---|---|
eventTypes
|
String | event types to register, seperated by space if more than one. | |
handler
|
function | listener handler | |
context
opt
|
Object | null | the context of the handler |
Mixes From:
Returns:
: this(mixin) off(eventsOff, handler, contextopt) [source]
Unregister the event handler for the specified event types.
foo.off('mousedown mousemove mouseup', onMouseEvent, foo);
Parameter | Type | Default | Description |
---|---|---|---|
eventsOff
|
String | event types to unregister, seperated by space if more than one. | |
handler
|
function | listener handler | |
context
opt
|
Object | null | the context of the handler |
Mixes From:
Returns:
: this(mixin) removeEventListener(eventTypes, handler, contextopt) [source]
Alias for off
Parameter | Type | Default | Description |
---|---|---|---|
eventTypes
|
String | event types to unregister, seperated by space if more than one. | |
handler
|
function | listener handler | |
context
opt
|
Object | null | the context of the handler |
Mixes From:
Returns:
: this(mixin) listens(eventType, hanlderopt, contextopt) [source]
Returns listener's count registered for the event type.
Parameter | Type | Default | Description |
---|---|---|---|
eventType
|
String | an event type | |
hanlder
opt
|
function | null | listener function |
context
opt
|
Object | null | the context of the handler |
Mixes From:
Returns:
Number:(mixin) copyEventListeners(target) [source]
Copy all the event listener to the target object
Parameter | Type | Description |
---|---|---|
target
|
Object | target object to copy to. |
Mixes From:
Returns:
: this(mixin) fire(eventType, param) [source]
Fire an event, causing all handlers for that event name to run.
Parameter | Type | Description |
---|---|---|
eventType
|
String | an event type to fire |
param
|
Object | parameters for the listener function. |
Mixes From:
Returns:
: this(mixin) setMenu(options) [source]
Set a context menu
foo.setMenu({
'width' : 160,
'custom' : false,
'items' : [
//return false to prevent event propagation
{'item': 'Query', 'click': function() {alert('Query Clicked!'); return false;}},
'-',
{'item': 'Edit', 'click': function() {alert('Edit Clicked!')}},
{'item': 'About', 'click': function() {alert('About Clicked!')}}
]
});
Parameter | Type | Description |
---|---|---|
options
|
Object | menu options |
Mixes From:
Returns:
*: this(mixin) openMenu(coordinateopt) [source]
Open the context menu, default on the center of the geometry or map.
Parameter | Type | Default | Description |
---|---|---|---|
coordinate
opt
|
Coordinate | null | coordinate to open the context menu |
Mixes From:
Returns:
*: this(mixin) setMenuItems(items) [source]
Set menu items to the context menu
Parameter | Type | Description |
---|---|---|
items
|
Array.<Object> | menu items |
Mixes From:
Returns:
*: this(mixin) getMenuItems() [source]
Get the context menu items
Mixes From:
Returns:
Array.<Object>:(mixin) closeMenu() [source]
Close the contexnt menu
Mixes From:
Returns:
*: this(mixin) removeMenu() [source]
Remove the context menu
Mixes From:
Returns:
*: this(mixin) registerRenderer(name, clazz) [source]
Register a renderer class with the given name.
Parameter | Type | Description |
---|---|---|
name
|
String | renderer's register key |
clazz
|
function | renderer's class, a function (not necessarily a Class). |
Mixes From:
Returns:
*: this(mixin) getRendererClass(name) [source]
Get the registered renderer class by the given name
Parameter | Type | Description |
---|---|---|
name
|
String | renderer's register key |
Mixes From:
Returns:
function: renderer's class(inherited) callInitHooks() [source]
Visit and call all the init hooks defined on Class and its parents.
Inherited From:
Returns:
Class: this(inherited) setOptions(options) [source]
Merges options with the default options of the object.
Parameter | Type | Description |
---|---|---|
options
|
Object | options to set |
Inherited From:
Returns:
Class: this(inherited) config(conf) [source]
1. Return object's options if no parameter is provided.
2. update an option and enable/disable the handler if a handler with the same name existed.
2. update an option and enable/disable the handler if a handler with the same name existed.
// Get marker's options;
var options = marker.config();
// Set map's option "draggable" to false and disable map's draggable handler.
map.config('draggable', false);
// You can update more than one options like this:
map.config({
'scrollWheelZoom' : false,
'doubleClickZoom' : false
});
Parameter | Type | Description |
---|---|---|
conf
|
Object | config to update |
Inherited From:
Returns:
Class: thisEvents
viewchange [source]
viewchange event, fired when map's view is updated.
Properties:
Name | Type | Description |
---|---|---|
type
|
String | viewchange |
target
|
Map | map |
old
|
Map | the old view |
new
|
Map | the new view changed to |
- Source:
baselayerchangestart [source]
baselayerchangestart event, fired when base layer is changed.
Properties:
Name | Type | Description |
---|---|---|
type
|
String | baselayerchangestart |
target
|
Map | map |
- Source:
baselayerchangeend [source]
baselayerchangeend event, fired when base layer is changed.
Properties:
Name | Type | Description |
---|---|---|
type
|
String | baselayerchangeend |
target
|
Map | map |
- Source:
setbaselayer [source]
setbaselayer event, fired when base layer is set.
Properties:
Name | Type | Description |
---|---|---|
type
|
String | setbaselayer |
target
|
Map | map |
- Source:
baselayerload [source]
baselayerload event, fired when base layer is loaded.
Properties:
Name | Type | Description |
---|---|---|
type
|
String | baselayerload |
target
|
Map | map |
- Source:
baselayerremove [source]
baselayerremove event, fired when base layer is removed.
Properties:
Name | Type | Description |
---|---|---|
type
|
String | baselayerremove |
target
|
Map | map |
- Source:
addlayer [source]
addlayer event, fired when adding layers.
Properties:
Name | Type | Description |
---|---|---|
type
|
String | addlayer |
target
|
Map | map |
layers
|
Array.<Layer> | layers to add |
- Source:
removelayer [source]
removelayer event, fired when removing layers.
Properties:
Name | Type | Description |
---|---|---|
type
|
String | removelayer |
target
|
Map | map |
layers
|
Array.<Layer> | layers to remove |
- Source:
resize [source]
resize event when map container's size changes
Properties:
Name | Type | Description |
---|---|---|
type
|
String | resize |
target
|
Map | map fires the event |
- Source:
movestart [source]
movestart event
Properties:
Name | Type | Description |
---|---|---|
type
|
String | movestart |
target
|
Map | map fires the event |
coordinate
|
Coordinate | coordinate of the event |
containerPoint
|
Point | container point of the event |
viewPoint
|
Point | view point of the event |
domEvent
|
Event | dom event |
- Source:
moving [source]
moving event
Properties:
Name | Type | Description |
---|---|---|
type
|
String | moving |
target
|
Map | map fires the event |
coordinate
|
Coordinate | coordinate of the event |
containerPoint
|
Point | container point of the event |
viewPoint
|
Point | view point of the event |
domEvent
|
Event | dom event |
- Source:
moveend [source]
moveend event
Properties:
Name | Type | Description |
---|---|---|
type
|
String | moveend |
target
|
Map | map fires the event |
coordinate
|
Coordinate | coordinate of the event |
containerPoint
|
Point | container point of the event |
viewPoint
|
Point | view point of the event |
domEvent
|
Event | dom event |
- Source:
load [source]
load event, fired when the map completes loading.
Properties:
Name | Type | Description |
---|---|---|
type
|
String | load |
target
|
Map | map |
- Source:
zoomstart [source]
zoomstart event
Properties:
Name | Type | Description |
---|---|---|
type
|
String | zoomstart |
target
|
Map | the map fires event |
from
|
Number | zoom level zooming from |
to
|
Number | zoom level zooming to |
- Source:
zooming [source]
zooming event
Properties:
Name | Type | Description |
---|---|---|
type
|
String | zooming |
target
|
Map | the map fires event |
from
|
Number | zoom level zooming from |
to
|
Number | zoom level zooming to |
- Source:
zoomend [source]
zoomend event
Properties:
Name | Type | Description |
---|---|---|
type
|
String | zoomend |
target
|
Map | the map fires event |
from
|
Number | zoom level zooming from |
to
|
Number | zoom level zooming to |
- Source:
mousedown [source]
mousedown event
Properties:
Name | Type | Description |
---|---|---|
type
|
String | mousedown |
target
|
Map | the map fires event |
coordinate
|
Coordinate | coordinate of the event |
containerPoint
|
Point | container point of the event |
viewPoint
|
Point | view point of the event |
domEvent
|
Event | dom event |
- Source:
mouseup [source]
mouseup event
Properties:
Name | Type | Description |
---|---|---|
type
|
String | mouseup |
target
|
Map | the map fires event |
coordinate
|
Coordinate | coordinate of the event |
containerPoint
|
Point | container point of the event |
viewPoint
|
Point | view point of the event |
domEvent
|
Event | dom event |
- Source:
mouseover [source]
mouseover event
Properties:
Name | Type | Description |
---|---|---|
type
|
String | mouseover |
target
|
Map | the map fires event |
coordinate
|
Coordinate | coordinate of the event |
containerPoint
|
Point | container point of the event |
viewPoint
|
Point | view point of the event |
domEvent
|
Event | dom event |
- Source:
mouseout [source]
mouseout event
Properties:
Name | Type | Description |
---|---|---|
type
|
String | mouseout |
target
|
Map | the map fires event |
coordinate
|
Coordinate | coordinate of the event |
containerPoint
|
Point | container point of the event |
viewPoint
|
Point | view point of the event |
domEvent
|
Event | dom event |
- Source:
mousemove [source]
mousemove event
Properties:
Name | Type | Description |
---|---|---|
type
|
String | mousemove |
target
|
Map | the map fires event |
coordinate
|
Coordinate | coordinate of the event |
containerPoint
|
Point | container point of the event |
viewPoint
|
Point | view point of the event |
domEvent
|
Event | dom event |
- Source:
click [source]
click event
Properties:
Name | Type | Description |
---|---|---|
type
|
String | click |
target
|
Map | the map fires event |
coordinate
|
Coordinate | coordinate of the event |
containerPoint
|
Point | container point of the event |
viewPoint
|
Point | view point of the event |
domEvent
|
Event | dom event |
- Source:
dblclick [source]
dblclick event
Properties:
Name | Type | Description |
---|---|---|
type
|
String | dblclick |
target
|
Map | the map fires event |
coordinate
|
Coordinate | coordinate of the event |
containerPoint
|
Point | container point of the event |
viewPoint
|
Point | view point of the event |
domEvent
|
Event | dom event |
- Source:
contextmenu [source]
contextmenu event
Properties:
Name | Type | Description |
---|---|---|
type
|
String | contextmenu |
target
|
Map | the map fires event |
coordinate
|
Coordinate | coordinate of the event |
containerPoint
|
Point | container point of the event |
viewPoint
|
Point | view point of the event |
domEvent
|
Event | dom event |
- Source:
keypress [source]
keypress event
Properties:
Name | Type | Description |
---|---|---|
type
|
String | keypress |
target
|
Map | the map fires event |
coordinate
|
Coordinate | coordinate of the event |
containerPoint
|
Point | container point of the event |
viewPoint
|
Point | view point of the event |
domEvent
|
Event | dom event |
- Source:
touchstart [source]
touchstart event
Properties:
Name | Type | Description |
---|---|---|
type
|
String | touchstart |
target
|
Map | the map fires event |
coordinate
|
Coordinate | coordinate of the event |
containerPoint
|
Point | container point of the event |
viewPoint
|
Point | view point of the event |
domEvent
|
Event | dom event |
- Source:
touchmove [source]
touchmove event
Properties:
Name | Type | Description |
---|---|---|
type
|
String | touchmove |
target
|
Map | the map fires event |
coordinate
|
Coordinate | coordinate of the event |
containerPoint
|
Point | container point of the event |
viewPoint
|
Point | view point of the event |
domEvent
|
Event | dom event |
- Source:
touchend [source]
touchend event
Properties:
Name | Type | Description |
---|---|---|
type
|
String | touchend |
target
|
Map | the map fires event |
coordinate
|
Coordinate | coordinate of the event |
containerPoint
|
Point | container point of the event |
viewPoint
|
Point | view point of the event |
domEvent
|
Event | dom event |
- Source:
fullscreenstart [source]
fullscreenstart event
Properties:
Name | Type | Description |
---|---|---|
type
|
String | fullscreenstart |
target
|
Map | the map fires event |
- Source:
fullscreenend [source]
fullscreenend event
Properties:
Name | Type | Description |
---|---|---|
type
|
String | fullscreenend |
target
|
Map | the map fires event |
- Source:
cancelfullscreen [source]
cancelfullscreen event
Properties:
Name | Type | Description |
---|---|---|
type
|
String | cancelfullscreen |
target
|
Map | the map fires event |
- Source:
touchzoomstart [source]
touchzoomstart event
Properties:
Name | Type | Description |
---|---|---|
type
|
String | touchzoomstart |
target
|
Map | the map fires event |
from
|
Number | zoom level zooming from |
- Source:
touchzooming [source]
touchzooming event
Properties:
Name | Type | Description |
---|---|---|
type
|
String | touchzooming |
target
|
Map | the map fires event |
- Source:
touchzoomend [source]
touchzoomend event
Properties:
Name | Type | Description |
---|---|---|
type
|
String | touchzoomend |
target
|
Map | the map fires event |
- Source: