MultiGLTFMarker
MultiGLTFMarker is a subclass of GLTFMarker used to draw a single GLTF model at multiple coordinates, with different translation/scale/rotation settings per instance, and supports interaction.
MultiGLTFMarker can use symbol to set the state of the model, such as scale, opacity, and rotation angle, and provides methods to update the model, update the model state, and start or pause animations.
MultiGLTFMarker uses WebGL instancing for rendering, improving WebGL rendering performance when drawing models in batch.
Note: The 2026 source code confirms the inheritance as
class MultiGLTFMarker extends GLTFMarker(verified against 2026 source code).
Constructor
import { MultiGLTFMarker } from '@maptalks/gl-layers';
const multiGLTFMarker = new MultiGLTFMarker([
{
coordinates: [0, 0],
translation: [0, 0, 0],
rotation: [0, 0, 0],
scale: [1, 1, 1],
color: [1, 0, 0, 1]
},
{
coordinates: [0, 0],
translation: [0, 2, 0],
rotation: [0, 0, 0],
scale: [1, 1, 1],
color: [1, 1, 0, 1]
},
], {
symbol: {
url: 'path/to/gltf1.gltf'
}
});Details
- data* Object[] Marker data, where each data object contains the following properties:
| Property | Type | Description | Default |
|---|---|---|---|
| coordinates* | Number[] | The longitude and latitude | null |
| translation | Number[] | The translation in the model's local coordinate system, a three-element array | [0, 0, 0] |
| rotation | Number[] | The rotation angles in the model's local coordinate system, in degrees, a three-element array | [0, 0, 0] |
| scale | Number[] | The scale factors in the model's local coordinate system, a three-element array | [1, 1, 1] |
| color | Number[] | The base color of the model, a four-element normalized array; the color is multiplied with the model's own color when drawn | [1, 1, 1, 1] |
| visible | Boolean | Whether this instance is visible (supplemented from 2026 source code) | true |
| outline | Boolean | Whether this instance is outlined (supplemented from 2026 source code) | false |
| bloom | Boolean | Whether bloom is enabled for this instance (supplemented from 2026 source code) | false |
| highlightColor | Number[] | The highlight color of this instance, a four-element normalized array (supplemented from 2026 source code) | [1, 1, 1, 1] |
| modelHeight | Number | Adaptive scaling of this instance by model height (meters) (supplemented from 2026 source code) | — |
| markerPixelHeight | Number | A fixed pixel height for this instance (supplemented from 2026 source code) | — |
- options* Object Configuration options, available options are as follows:
| Option | Type | Description | Default |
|---|---|---|---|
| symbol | Object | Style configuration; see "Symbol Description" below for the symbol fields | null |
Note (verified against 2026 source code): the legacy
fitSizeoption has been removed in the 2026 source code; the model size is now controlled bysymbol.modelHeight/symbol.markerPixelHeight.
|id | Object | Style configuration | null | |visible | Boolean | Whether the geometry is visible | true | |interactive | Boolean | Whether the geometry is interactive | true | |editable | Boolean | Whether editing is allowed | true | |cursor | String | The mouse cursor style | null | |draggable | Boolean | Whether dragging is allowed | false | |dragOnAxis | String | Whether to drag along the x or y axis; possible values are "x" or "y" | null | |zIndex | Number | The initial zIndex, which determines the drawing order | null |
Additional data fields (verified against 2026 source code)
In the 2026 source code, each data item also supports: visible (visibility), outline (outline), bloom (bloom), highlightColor (highlight color), modelHeight (adaptive scaling by model height), markerPixelHeight (fixed pixel height)
Symbol Description
Like GLTFMarker, the options.symbol of MultiGLTFMarker contains the following settings and properties.
| Option | Type | Description | Default |
|---|---|---|---|
| url | String | The model url; when unset, the built-in pyramid model is used | 'pyramid' |
| visible | Boolean | Whether the model is visible | true |
| translation | Number[] | The translation of the model along the xyz axes of its local coordinate system | [0, 0, 0] |
| translationX / Y / Z | Number | The translation of the model along a single axis of its local coordinate system (supplemented from 2026 source code) | 0 |
| rotation | Number[] | The rotation angles of the model around the xyz axes of its local coordinate system, in degrees | [0, 0, 0] |
| rotationX / Y / Z | Number | The rotation angle of the model around a single axis of its local coordinate system (supplemented from 2026 source code) | 0 |
| scale | Number[] | The scale factors of the model along the xyz axes of its local coordinate system | [1, 1, 1] |
| scaleX / Y / Z | Number | The scale factor of the model along a single axis of its local coordinate system (supplemented from 2026 source code) | 1 |
| modelHeight | Number | Adaptive scaling by model height (meters) (supplemented from 2026 source code) | — |
| markerPixelHeight | Number | A fixed pixel height for the model; once set, it no longer changes with map zoom (supplemented from 2026 source code) | — |
| animation | Boolean | Whether to enable the animation (requires the model to contain animation data) | false |
| animationName | String/Number | The animation sequence name | 0 |
| loop | Boolean | Whether to enable the animation loop | false |
| speed | Number | The animation speed multiplier | 1 |
| anchorZ | String | The anchor or alignment point of the model on the z axis; possible values: center, top, bottom | center |
| shadow | Boolean | Whether shadow is enabled | true |
| bloom | Boolean | Whether bloom is enabled | false |
| doubleSided | Boolean | Whether to render double-sided (supplemented from 2026 source code) | false |
| animationNodes | Number[] | An array of node indices to which the animation is restricted (supplemented from 2026 source code) | null |
| shader | String | The shader used to draw the model; possible values: pbr, pbr-lite, phong, wireframe | pbr |
| uniforms | Object | Material parameters of the selected shader; refer to the documentation for details. | null |
Note (verified against 2026 source code):
symbolhas no default value object in the source code;animation/looptake effect only when explicitly set. Model opacity is controlled viauniforms.polygonOpacity(pbr/phong) oruniforms.lineOpacity(wireframe). The legacyfixSizeOnZoomoption has been removed; usemodelHeight/markerPixelHeightinstead.
Note: The symbol fields are the same as GLTFMarker; see that page for the field verification against the 2026 source code (verified against 2026 source code).
Methods
addData(data)
Adds a data item, with the following properties:
| Property | Type | Description | Default |
|---|---|---|---|
| coordinates* | Number[] | The longitude and latitude | null |
| translation | Number[] | The translation in the model's local coordinate system, a three-element array | [0, 0, 0] |
| rotation | Number[] | The rotation angles in the model's local coordinate system, in degrees, a three-element array | [0, 0, 0] |
| scale | Number[] | The scale factors in the model's local coordinate system, a three-element array | [1, 1, 1] |
| color | Number[] | The base color of the model, a four-element normalized array; the color is multiplied with the model's own color when drawn | [1, 1, 1, 1] |
| visible | Boolean | Whether this instance is visible (supplemented from 2026 source code) | true |
| outline | Boolean | Whether this instance is outlined (supplemented from 2026 source code) | false |
| bloom | Boolean | Whether bloom is enabled for this instance (supplemented from 2026 source code) | false |
| highlightColor | Number[] | The highlight color of this instance, a four-element normalized array (supplemented from 2026 source code) | [1, 1, 1, 1] |
| modelHeight | Number | Adaptive scaling of this instance by model height (meters) (supplemented from 2026 source code) | — |
| markerPixelHeight | Number | A fixed pixel height for this instance (supplemented from 2026 source code) | — |
Parameters:
- data Object The data item
Returns:
- this
removeData(idx)
Removes a data item.
Parameters:
- idx Number The index of the data item
Returns:
- this
getData(idx)
Gets a data item.
Parameters:
- idx Number The index of the data item
Returns:
- Object
updateData(idx, name, value)
Updates a data item.
const multiGLTFMarker = new MultiGLTFMarker([
{
coordinates: [0, 0],
translation: [0, 0, 0],
rotation: [0, 0, 0],
scale: [1, 1, 1],
color: [1, 0, 0, 1]
},
{
coordinates: [0, 0],
translation: [0, 2, 0],
rotation: [0, 0, 0],
scale: [1, 1, 1],
color: [1, 1, 0, 1]
},
], {
symbol: {
url: 'path/to/gltf1.gltf'
}
});
multiGLTFMarker.updateData(0, 'color', [0, 1, 0, 1]);Parameters:
- idx Number The index of the data item
- name String The property to update
- value Object The new value of the property
Returns:
- this
updateAllData(name, value)
Updates the property value of all data items.
value is an array, and value[i] is the new value of the i-th data item (verified against 2026 source code: updateAllData internally reads value[i] by the data item index).
const multiGLTFMarker = new MultiGLTFMarker([
{
coordinates: [0, 0],
translation: [0, 0, 0],
rotation: [0, 0, 0],
scale: [1, 1, 1],
color: [1, 0, 0, 1]
},
{
coordinates: [0, 0],
translation: [0, 2, 0],
rotation: [0, 0, 0],
scale: [1, 1, 1],
color: [1, 1, 0, 1]
},
], {
symbol: {
url: 'path/to/gltf1.gltf'
}
});
multiGLTFMarker.updateAllData('color', [[0, 1, 0, 1], [0, 1, 0, 1]]);Parameters:
- name String The property to update
- value Array An array of values corresponding to each data item;
value[i]is the new value of the i-th data item
Returns:
- this
getCount()
Gets the number of data items.
Returns:
- Number
getIndexByPickingId(pickingId)
Gets the index of a data item by pickingId.
pickingId is an internal id that identifies a data item among the data picked by the identify or identifyAtPoint methods.
Returns:
- Number
Additional methods (verified against 2026 source code)
getAllData(): read all instance dataremoveAllData(): clear all instance dataopenInfoWindow(index?): open the info window (centered by default; an instance index can be specified)outline(idx?)/cancelOutline(idx?)/isOutline(): outline / cancel outline / query the outline state of a specified instancehighlight(index, {color, opacity, bloom})/highlightNodes(index, [{nodeIndex, ...}])/cancelHighlight(index, nodes?): highlight a specified instance / highlight nodes of a specified instance / cancel highlightzoomAt(index, options={animation: true, zoomOffset: 0}, step?): zoom to the coordinates of a specified instancesetCoordinates(coords)/getCoordinates(): set/get coordinates (setCoordinates supports an overall translation or a coordinates array)getCenter(): the average center of all instance coordinatestoJSON()/static fromJSON(json): JSON serialization / deserialization
Methods Inherited from GLTFMarker
setUrl(url)
Updates the model url.
Returns:
- this
getUrl()
Gets the model url.
Returns:
- String
setBloom(isBloom)
Sets whether bloom is enabled for the model.
Parameters:
- isBloom Boolean Whether to enable bloom
Returns:
- this
isBloom()
Whether bloom is enabled for the model.
Returns:
- Boolean
setCastShadow(isCastShadow)
Sets whether shadow casting is enabled for the model.
Parameters:
- isCastShadow Boolean Whether to enable shadow casting
Returns:
- this
isCastShadow()
Whether shadow casting is enabled for the model.
Returns:
- Boolean
outline()
Outlines the model.
Because the outline effect is implemented with post-processing, the layer needs to be added to a GroupGLLayer, and the outline post-processing effect must be enabled.
gltfMarker.outline();Returns:
- this
cancelOutline()
Cancels the outline.
Returns:
- this
isOutline()
Whether the model is outlined.
Returns:
- Boolean
setShader(shader)
Sets the shader used to draw the model.
Parameters:
- shader String The shader to use, one of: pbr, phong, wireframe; default is pbr
Returns:
- this
getShader()
Returns the shader used to draw the model.
Returns:
- String
setUniforms(uniforms)
Sets the symbol.uniforms of the model.
Parameters:
- uniforms Object The symbol.uniforms value
Returns:
- this
getUniform(key)
Returns the value of a property in the model's symbol.uniforms.
Parameters:
- key String The uniform property name
Returns:
- any
setUniform(key, value, nodeIndex)
Sets a single property value in the model's symbol.uniforms; nodeIndex can be specified to apply the uniform only to the given node (supplemented from 2026 source code).
Parameters:
- key String The uniform property name
- value any The property value
- nodeIndex Number Optional node index
Returns:
- this
getUniforms()
Returns the symbol.uniforms object of the model (supplemented from 2026 source code).
Returns:
- Object
setAnimation(isAnimated)
Sets whether the model animation is enabled, enabled by default.
Parameters:
- isAnimated Boolean Whether to enable the animation.
Returns:
- this
isAnimated()
Whether the model animation is enabled.
Returns:
- Boolean
isDashAnimated()
Whether dash animation is enabled when the model is drawn with the wireframe shader.
Returns:
- Boolean
setAnimationLoop(looped)
Sets whether the model animation loops, enabled by default.
Parameters:
- looped Boolean Whether to enable looped animation.
Returns:
- this
isAnimationLooped()
Whether the model animation loop is enabled.
Returns:
- Boolean
setAnimationSpeed(speed)
Sets the animation speed of the model.
Parameters:
- speed Number The animation speed, as a multiple of the original speed, default 1.
Returns:
- this
getAnimationSpeed()
Returns the animation speed of the model.
Returns:
- Number
getAnimations()
Gets the names of all animation sequences in the model.
Returns:
- String|Number[]
getCurrentAnimation()
Gets the name of the current animation sequence of the model.
Returns:
- String|Number
setCurrentAnimation(animationName)
Sets the name of the current animation sequence of the model.
Parameters:
- animationName String|Number The animation sequence name
Returns:
- this
setAnimationTimeframe(timestamp)
Sets the current animation timeframe.
Parameters:
- timestamp Number The animation timeframe, in ms
Returns:
- this
setTranslation(translationX, translationY, translationZ)
Sets the translation of the model in its local coordinate system.
Parameters:
- translationX Number The translation along the x axis of the local coordinate system
- translationY Number The translation along the y axis of the local coordinate system
- translationZ Number The translation along the z axis of the local coordinate system
Returns:
- this
getTranslation()
Gets the translation of the model.
Returns:
- Number[] A three-element array
setRotation(rotationX, rotationY, rotationZ)
rotationX, rotationY, and rotationZ are the rotation angles of the model around the x, y, and z axes of its local coordinate system.
Parameters:
- rotationX Number The rotation angle of the model around the x axis of the local coordinate system
- rotationY Number The rotation angle of the model around the y axis of the local coordinate system
- rotationZ Number The rotation angle of the model around the z axis of the local coordinate system
Returns:
- this
getRotation()
Gets the rotation of the model.
Returns:
- Number[] A three-element array
setScale(scaleX, scaleY, scaleZ)
scaleX, scaleY, and scaleZ are the scale factors of the model along the x, y, and z axes of its local coordinate system.
Parameters:
- scaleX Number The scale factor of the model along the x axis of the local coordinate system
- scaleY Number The scale factor of the model along the y axis of the local coordinate system
- scaleZ Number The scale factor of the model along the z axis of the local coordinate system
Returns:
- this
getScale()
Gets the scale of the model.
Returns:
- Number[] A three-element array
setTRS(translation, rotation, scale)
Sets the translation, rotation, and scale of the model.
translation is a three-element array of offsets in the model's local coordinates. rotation is a three-element array of rotation angles around the x, y, and z axes of the local coordinate system. scale is a three-element array of scale factors along the x, y, and z axes of the local coordinate system.
Parameters:
- translation Number[] A three-element array of offsets in the local coordinate system.
- rotation Number[] A three-element array of rotation angles around the x, y, and z axes of the local coordinate system.
- scale Number[] A three-element array of scale factors along the x, y, and z axes of the local coordinate system.
Returns:
- this
setModelMatrix(modelMatrix)
Sets the local transform matrix of the model; the matrix is decomposed into translation, rotation, and scale.
Parameters:
- modelMatrix Number[] A 16-element transform matrix
Returns:
- this
getModelMatrix()
Gets the 16-element transform matrix of the model in local coordinates.
Returns:
- Number[]
setAnchorZ(anchorZ)
Sets the anchor or alignment point of the model on the z axis, i.e. whether to align to the top or the bottom.
Parameters:
- anchorZ String The z-axis anchor; possible values are center, top, or bottom (verified against 2026 source code; when unset, the model center is aligned with the coordinate)
Returns:
- this
getAnchorZ()
Gets the z-axis anchor of the model.
Returns:
- String
Methods Inherited from Marker
getCoordinates()
Gets the coordinates.
Returns:
- Coordinate
setCoordinates(coordinates)
Sets the coordinates.
Parameters:
- coordinates Number[] | Coordinate The new coordinates
Returns:
- this
getFirstCoordinate()
Gets the first coordinate.
Returns:
- Coordinate
getLastCoordinate()
Gets the last coordinate.
Returns:
- Coordinate
addTo(layer)
Adds the geometry to a layer.
Parameters:
- layer Layer The layer
Returns:
- this
getLayer()
Gets the layer the geometry was added to.
Returns:
- Layer
getMap()
Gets the map the geometry was added to.
Returns:
- Map
getId()
Gets the id of the Geometry.
Returns:
- String | Number
setId(id)
Sets a new id.
Parameters:
- id Number | String The new id
Returns:
- this
getProperties()
Gets the properties data of the Geometry.
Returns:
- Object
setProperties(properties)
Sets the properties data of the Geometry.
Parameters:
- properties Object The new properties data
Returns:
- this
getType()
Gets the type of the Geometry.
Returns:
- String
getSymbol()
Gets the symbol style of the Geometry.
Returns:
- Object
setSymbol(symbol)
Sets a new symbol style for the Geometry.
Parameters:
- symbol Object The new style object
Returns:
- Object
updateSymbol(symbol)
Updates the symbol style of the Geometry.
Parameters:
- symbol Object The symbol properties to update
Returns:
- Object
getCenter()
Gets the geographic center of the Geometry.
Returns:
- Coordinate
getExtent()
Gets the geographic extent of the Geometry.
Returns:
- Extent
show()
Shows the Geometry.
Returns:
- this
hide()
Hides the Geometry.
Returns:
- this
isVisible()
Whether the Geometry is visible.
Returns:
- Boolean
getZIndex()
Returns the zIndex of the Geometry.
Returns:
- Number
setZIndex(zIndex)
Sets the zIndex of the Geometry.
Parameters:
- zIndex Number The zIndex of the Geometry
Returns:
- this
setZIndexSilently(zIndex)
Sets the zIndex of the Geometry without triggering a redraw of the layer. If the zIndex of many geometries needs to be updated, call setZIndexSilently to update them and call setZIndex on the last Geometry to trigger the layer redraw, which improves performance.
Parameters:
- zIndex Number The zIndex of the Geometry
Returns:
- this
translate(x, y)
Moves the Geometry by the given x and y offsets.
Parameters:
- x Number The offset along the x axis
- y Number The offset along the y axis
Returns:
- this
flash(interval, count, cb, context)
Flashes the Geometry by hiding and showing it at the given interval.
Parameters:
- interval Number The interval
- count Number The number of times
- cb Function The callback invoked after flashing ends
- context Object The this value used when the callback runs
Returns:
- this
copy()
Copies a Geometry.
Returns:
- Geometry
remove()
Removes the Geometry from its layer.
Returns:
- this
toGeoJSONGeometry()
Converts the Geometry to a GeoJSON geometry object.
Returns:
- Object
toGeoJSON(options)
Converts the Geometry to a GeoJSON object.
Parameters:
- options Object Export options
- options.geometry Boolean Whether to export geometry, default is true
- options.properties Boolean Whether to export properties, default is true
Returns:
- Object
toJSON(options)
Converts the Geometry to a JSON object.
The object can be used with Geometry.fromJSON(json) to create a Geometry object.
Parameters:
- options Object Export options
- options.geometry Boolean Whether to export geometry, default is true
- options.properties Boolean Whether to export properties, default is true
- options.options Boolean Whether to export the constructor options, default is true
- options.symbol Boolean Whether to export the symbol, default is true
- options.infoWindow Boolean Whether to export the InfoWindow settings, default is true
Returns:
- Object
getLength()
Returns the geographic length of the Geometry.
Returns:
- Number
getArea()
Returns the geographic area of the Geometry.
Returns:
- Number
rotate(angle, pivot)
Rotates the Geometry by angle degrees around the pivot coordinate.
Parameters:
- angle* Number The rotation angle, in degrees
- pivot Coordinate The center point of rotation
Returns:
- this
startEdit(options)
Starts editing the geometry.
Parameters:
- options Object Edit options
- options.symbol Object The geometry style in the editing state
- options.fixAspectRatio Boolean Whether to fix the aspect ratio of the geometry if it has a width and height
- options.centerHandleSymbol Object The style of the center drag handle (if any)
- options.vertexHandleSymbol Object The style of the vertex drag handle (if any)
- options.newVertexHandleSymbol Object The style of the new vertex handle (if any)
- options.centerHandleSymbol Object The style of the center drag handle (if any)
Returns:
- this
endEdit()
Stops editing.
Returns:
- this
redoEdit()
Redoes the last edit operation.
Returns:
- this
undoEdit()
Undoes the last edit operation.
Returns:
- this
cancelEdit()
Cancels editing and restores the geometry to its initial state.
Returns:
- this
isEditing()
Whether the geometry is in the editing state.
Returns:
- this
isDragging()
Whether the geometry is in the dragging state.
Returns:
- this
animate(styles, options, step)
Runs an animation on the geometry with the given parameters.
Parameters:
- styles* Object The properties to animate, e.g. symbol or translate
- options Object Animation settings
- options.duration Number Duration in ms, default 1000
- options.startTime Number The time to start the animation
- options.easing String The animation easing type; see animation-easings for details.
- options.repeat Boolean Whether to repeat after the animation ends
Returns:
- this
setInfoWindow(options)
Sets an info window for the geometry.
Parameters:
- options Object Info window settings
- options.title String The info window title
- options.content String The info window content
For other settings, see the InfoWindow documentation and examples
Returns:
- this
getInfoWindow()
Returns the InfoWindow instance of the Geometry.
Returns:
- InfoWindow
openInfoWindow(coordinates)
Opens the info window of the geometry.
Parameters:
- coordinates Coordiante | Number[] Optional coordinates of the info window.
Returns:
- this
closeInfoWindow()
Closes the InfoWindow.
Returns:
- this
removeInfoWindow()
Removes the InfoWindow of the geometry.
Returns:
- this
setMenu(options)
Sets a context menu for the geometry.
Parameters:
- options Object Menu settings
- options.width Number The menu width
- options.items Object[] The menu items
- options.items.item String The menu item title
- options.items.click Function The click handler
For other settings, see the Menu documentation and examples
Returns:
- this
openMenu(coordinates)
Opens the context menu of the geometry.
Parameters:
- coordinates Coordiante | Number[] Optional coordinates of the menu.
Returns:
- this
setMenuItems(items)
Sets the menu items of the geometry's context menu.
Parameters:
- items Object[] The menu items
- items.item String The menu item title
- items.click Function The click handler
Returns:
- this
getMenuItems()
Returns the menu items of the geometry's context menu.
Returns:
- Object[]
closeMenu()
Closes the context menu.
Returns:
- this
removeMenu()
Removes the context menu.
Returns:
- this
on(events, handler, context)
Registers event listeners on the geometry.
Returns:
- this
addEventListener(events, handler, context)
Same as the on method.
Returns:
- this
once(events, handler, context)
Registers an event listener on the geometry that is removed after it responds once.
Returns:
- this
off(events, handler, context)
Removes the registered event listeners of the geometry.
Returns:
- this
removeEventListener(events, handler, context)
Same as the off method.
Returns:
- this
listens(events, handler, context)
Whether the geometry listens to the given events.
Returns:
- Boolean
fire(event, params)
Fires an event manually; params are the event parameters.
Returns:
- this
setOptions(options)
Sets the geometry options.
Returns:
- this
config(key, value)
Updates a geometry option.
Returns:
- this
getJSONType()
Returns the JSON type registered by the geometry class.
Returns:
- String
Static Methods
registerJSONType(type)
Registers a Geometry JSON type.
Parameters:
- type String The Geometry type
getJSONClass(type)
Returns the geometry class corresponding to the given JSON type.
Parameters:
- type String The Geometry type
Returns:
- A subclass of Geometry
Events
Example code for listening to layer events:
// 监听workerready事件
layer.once('workerready', e => {
// e为事件参数
console.log('worker is ready');
});
// 监听tileload事件
layer.on('tileload', e => {
// e为事件参数
console.log('loaded a tile', e.tile);
});Events Inherited from GLTFMarker
add
Fired when the GLTFMarker is added to a layer.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "add" |
| target | GLTFMarker | this |
| layer | GLTFLayer | The GLTF layer |
load
Fired when the model of the GLTFMarker is loaded.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "load" |
| target | GLTFMarker | this |
| data | Object | The GLTF model |
Events Inherited from Geometry
mousedown
The mousedown event.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "mousedown" |
| target | Geoemtry | this |
| coordinate | Coordinate | The event coordinate |
| containerPoint | Point | The event container point |
| viewPoint | Point | The event point relative to the container |
| domEvent | event | The DOM event |
mouseup
The mouseup event.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "mouseup" |
| target | Geoemtry | this |
| coordinate | Coordinate | The event coordinate |
| containerPoint | Point | The event container point |
| viewPoint | Point | The event point relative to the container |
| domEvent | event | The DOM event |
mousemove
The mousemove event.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "mousemove" |
| target | Geoemtry | this |
| coordinate | Coordinate | The event coordinate |
| containerPoint | Point | The event container point |
| viewPoint | Point | The event point relative to the container |
| domEvent | event | The DOM event |
click
The click event.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "click" |
| target | Geoemtry | this |
| coordinate | Coordinate | The event coordinate |
| containerPoint | Point | The event container point |
| viewPoint | Point | The event point relative to the container |
| domEvent | event | The DOM event |
dblclick
The dblclick event.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "dblclick" |
| target | Geoemtry | this |
| coordinate | Coordinate | The event coordinate |
| containerPoint | Point | The event container point |
| viewPoint | Point | The event point relative to the container |
| domEvent | event | The DOM event |
contextmenu
The contextmenu event.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "contextmenu" |
| target | Geoemtry | this |
| coordinate | Coordinate | The event coordinate |
| containerPoint | Point | The event container point |
| viewPoint | Point | The event point relative to the container |
| domEvent | event | The DOM event |
touchstart
The touchstart event.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "touchstart" |
| target | Geoemtry | this |
| coordinate | Coordinate | The event coordinate |
| containerPoint | Point | The event container point |
| viewPoint | Point | The event point relative to the container |
| domEvent | event | The DOM event |
touchmove
The touchmove event.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "touchmove" |
| target | Geoemtry | this |
| coordinate | Coordinate | The event coordinate |
| containerPoint | Point | The event container point |
| viewPoint | Point | The event point relative to the container |
| domEvent | event | The DOM event |
touchend
The touchend event.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "touchend" |
| target | Geoemtry | this |
| coordinate | Coordinate | The event coordinate |
| containerPoint | Point | The event container point |
| viewPoint | Point | The event point relative to the container |
| domEvent | event | The DOM event |
mouseenter
The mouseenter event.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "mouseenter" |
| target | Geoemtry | this |
| coordinate | Coordinate | The event coordinate |
| containerPoint | Point | The event container point |
| viewPoint | Point | The event point relative to the container |
| domEvent | event | The DOM event |
mouseover
The mouseover event.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "mouseover" |
| target | Geoemtry | this |
| coordinate | Coordinate | The event coordinate |
| containerPoint | Point | The event container point |
| viewPoint | Point | The event point relative to the container |
| domEvent | event | The DOM event |
mouseout
The mouseout event.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "mouseout" |
| target | Geoemtry | this |
| coordinate | Coordinate | The event coordinate |
| containerPoint | Point | The event container point |
| viewPoint | Point | The event point relative to the container |
| domEvent | event | The DOM event |
idchange
Fired when the geometry id changes.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "idchange" |
| target | Geometry | this |
| old | String | The old id |
| new | String | The new id |
propertieschange
Fired when the geometry properties data changes.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "propertieschange" |
| target | Geometry | this |
| old | String | The old id |
| new | String | The new id |
show
Fired when the geometry is shown.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "show" |
| target | Geometry | this |
hide
Fired when the geometry is hidden.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "hide" |
| target | Geometry | this |
zindexchange
Fired when the geometry zIndex changes.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "zindexchange" |
| target | Geometry | this |
| old | String | The old zIndex |
| new | String | The new zIndex |
removestart
Fired when the geometry starts to be removed.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "removestart" |
| target | Geometry | this |
removeend
Fired when the removal of the geometry ends.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "removeend" |
| target | Geometry | this |
remove
Fired when the geometry is removed; it is thrown after removeend.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "remove" |
| target | Geometry | this |
shapechange
Fired when the geometry shape changes, e.g. when adding or removing a vertex or modifying the position of a vertex.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "shapechange" |
| target | Geometry | this |
positionchange
Fired when the geometry position changes, i.e. when it is moved as a whole without a change in shape.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "positionchange" |
| target | Geometry | this |
symbolchange
Fired when the symbol of the geometry changes.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "symbolchange" |
| target | Geometry | this |
| properties | Object | The symbol properties |
editstart
Fired when editing starts.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "editstart" |
| target | Geometry | this |
editend
Fired when editing ends.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "editend" |
| target | Geometry | this |
canceledit
Fired when editing is cancelled.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "canceledit" |
| target | Geometry | this |
redoedit
Fired when an edit is redone.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "redoedit" |
| target | Geometry | this |
undoedit
Fired when an edit is undone.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "undoedit" |
| target | Geometry | this |
dragstart
Fired when dragging starts.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "dragstart" |
| target | Geometry | this |
| coordinate | Coordinate | The event coordinate |
| containerPoint | Point | The event container point |
| viewPoint | Point | The event point relative to the container |
| domEvent | event | The DOM event |
dragging
Fired while dragging.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "dragging" |
| target | Geometry | this |
| coordinate | Coordinate | The event coordinate |
| containerPoint | Point | The event container point |
| viewPoint | Point | The event point relative to the container |
| domEvent | event | The DOM event |
dragend
Fired when dragging ends.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "dragend" |
| target | Geometry | this |
| coordinate | Coordinate | The event coordinate |
| containerPoint | Point | The event container point |
| viewPoint | Point | The event point relative to the container |
| domEvent | event | The DOM event |
animatestart
Fired when an animation starts.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "animatestart" |
| target | Geometry | this |
animating
Fired while an animation is running.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "animating" |
| target | Geometry | this |
animateend
Fired when an animation ends.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "animateend" |
| target | Geometry | this |
handledragstart
Fired when dragging an edit handle starts.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "handledragstart" |
| target | Geometry | this |
handledragging
Fired while dragging an edit handle.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "handledragging" |
| target | Geometry | this |
handledragend
Fired when dragging an edit handle ends.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "handledragend" |
| target | Geometry | this |
editrecord
Fired when an edit is made and recorded in the edit history.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "editrecord" |
| target | Geometry | this |
add
Fired when the geometry is added to a layer.
Event properties:
| Property | Type | Value |
|---|---|---|
| type | String | "add" |
| target | Geometry | this |
This document has been verified against the 2026 source code of @maptalks/gl-layers (api-notes-others.md)