Skip to content

GLTFMarker

GLTFMarker is a subclass of Marker used to add GLTF models at specified geographic coordinates and interact with them.

GLTFMarker 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.

Note: The 2026 source code confirms the inheritance as class GLTFMarker extends Marker (maptalks.Marker, which provides events, infoWindow, and other capabilities) (verified against 2026 source code).

Constructor

js
import { GLTFMarker } from '@maptalks/gl-layers';

const gltfMarker = new GLTFMarker([0, 0], {
  symbol: {
    url: 'path/to/gltf.gltf'
  }
});
Details
Parameters:
  • coordinates* Number[] The coordinates
  • options* Object Configuration options, available options are as follows:
OptionTypeDescriptionDefault
symbolObjectStyle configuration; see "Symbol Description" below for the symbol fieldsnull

Note (verified against 2026 source code): the legacy fitSize option has been removed in the 2026 source code; the model size is now controlled by symbol.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 |

Symbol Description

The options.symbol of GLTFMarker contains the following settings and properties.

OptionTypeDescriptionDefault
urlStringThe model url; when unset, the built-in pyramid model is used'pyramid'
visibleBooleanWhether the model is visibletrue
translationNumber[]The translation of the model along the xyz axes of its local coordinate system[0, 0, 0]
translationX / Y / ZNumberThe translation of the model along a single axis of its local coordinate system (supplemented from 2026 source code)0
rotationNumber[]The rotation angles of the model around the xyz axes of its local coordinate system, in degrees[0, 0, 0]
rotationX / Y / ZNumberThe rotation angle of the model around a single axis of its local coordinate system (supplemented from 2026 source code)0
scaleNumber[]The scale factors of the model along the xyz axes of its local coordinate system[1, 1, 1]
scaleX / Y / ZNumberThe scale factor of the model along a single axis of its local coordinate system (supplemented from 2026 source code)1
modelHeightNumberAdaptive scaling by model height (meters) (supplemented from 2026 source code)
markerPixelHeightNumberA fixed pixel height for the model; once set, it no longer changes with map zoom (supplemented from 2026 source code)
animationBooleanWhether to enable the animation (requires the model to contain animation data)false
animationNameString/NumberThe animation sequence name0
loopBooleanWhether to enable the animation loopfalse
speedNumberThe animation speed multiplier1
anchorZStringThe anchor or alignment point of the model on the z axis; possible values: center, top, bottomcenter
shadowBooleanWhether shadow is enabledtrue
bloomBooleanWhether bloom is enabledfalse
doubleSidedBooleanWhether to render double-sided (supplemented from 2026 source code)false
animationNodesNumber[]An array of node indices to which the animation is restricted (supplemented from 2026 source code)null
shaderStringThe shader used to draw the model; possible values: pbr, pbr-lite, phong, wireframepbr
uniformsObjectMaterial parameters of the selected shader; refer to the documentation for details.null

Note (verified against 2026 source code): symbol has no default value object in the source code; animation/loop take effect only when explicitly set. Model opacity is controlled via uniforms.polygonOpacity (pbr/phong) or uniforms.lineOpacity (wireframe). The legacy fixSizeOnZoom option has been removed; use modelHeight / markerPixelHeight instead.

Symbol field verification (2026 source code)

  • All the fields in the table above are valid; the default value of url is 'pyramid' (a built-in model)
  • The 2026 source code also supports: modelHeight (adaptive scaling by model height, in meters), markerPixelHeight (fixed pixel height), translationX/Y/Z, rotationX/Y/Z, scaleX/Y/Z (per-axis settings), anchorZ with the extended value set 'center' | 'bottom' | 'top', doubleSided (double-sided rendering), animationNodes (restricting animation nodes)
  • Model opacity is controlled via uniforms.polygonOpacity (pbr/phong) or uniforms.lineOpacity (wireframe); symbol.opacity does not exist in the 2026 source code (verified against 2026 source code)

Methods

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.

js
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

Method verification (2026 source code)

Methods not documented in older docs but provided in the 2026 source code:

  • setUniform(key, value, nodeIndex?) / getUniforms(): set / batch read material uniforms by key
  • setModelHeight(h) / getModelHeight(): adaptive scaling by model height (meters)
  • cancelMarkerPixelHeight(): cancel the fixed pixel height and restore on-demand scaling
  • getCurrentPixelHeight(): the model's current pixel height
  • rotateAround(coordinate, degree): rotate around the given coordinate
  • highlight({color, opacity, bloom}) / highlightNodes([{nodeIndex, ...}]) / cancelHighlight(nodes?): highlight the whole model / highlight specified nodes / cancel highlight
  • outlineNodes(nodes) / cancelOutline(nodes?): outline specified nodes / cancel outline
  • getBoundingBox() / getBoundingBoxCenter() / getBoundingBoxWidth(axis): model bounding box related (note the YZ axis flip conversion)
  • getGLTFJSON() / getGLTFBBox() / getAllMeshes(): get the raw gltf JSON / the model bounding box / all meshes
  • showBoundingBox(options?) / hideBoundingBox(): show / hide the model bounding box helper
  • setNodeTRS(nodeIndex, trs={translation, rotation, scale}): set the translation/rotation/scale of a specified gltf node
  • zoomTo(options={animation: true}, step?): zoom to the model bounding box (zoomAt(index, ...) is a MultiGLTFMarker method, see MultiGLTFMarker)
  • getCenter(): the geometric center coordinates of the model (including the translation offset)
  • isLoaded(): whether the model has finished loading
  • copy() / remove(): deep copy / remove and release model resources (mesh, textures, jointTexture)

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

Additional static methods (2026 source code)

  • static getGLTFAnchorsAlongLineString(coordinates, bboxWidth, map, options): generate model anchors in batch along a line (options: gapLength / count / rotateAlongLine / snapToEndVertexes / scaleEndModel)
  • static combineGLTFBoundingBox(markers): {min, max}: combine the bounding boxes of multiple markers

Events

Example code for listening to layer events:

js
// 监听workerready事件
layer.once('workerready', e => {
  // e为事件参数
  console.log('worker is ready');
});

// 监听tileload事件
layer.on('tileload', e => {
  // e为事件参数
  console.log('loaded a tile', e.tile);
});

Geometry Events

add

Fired when the GLTFMarker is added to a layer.

Event properties:

PropertyTypeValue
typeString"add"
targetGLTFMarkerthis
layerGLTFLayerThe GLTF layer
load

Fired when the model of the GLTFMarker is loaded.

Event properties:

PropertyTypeValue
typeString"load"
targetGLTFMarkerthis
dataObjectThe GLTF model

Events Inherited from Geometry

mousedown

The mousedown event.

Event properties:

PropertyTypeValue
typeString"mousedown"
targetGeoemtrythis
coordinateCoordinateThe event coordinate
containerPointPointThe event container point
viewPointPointThe event point relative to the container
domEventeventThe DOM event
mouseup

The mouseup event.

Event properties:

PropertyTypeValue
typeString"mouseup"
targetGeoemtrythis
coordinateCoordinateThe event coordinate
containerPointPointThe event container point
viewPointPointThe event point relative to the container
domEventeventThe DOM event
mousemove

The mousemove event.

Event properties:

PropertyTypeValue
typeString"mousemove"
targetGeoemtrythis
coordinateCoordinateThe event coordinate
containerPointPointThe event container point
viewPointPointThe event point relative to the container
domEventeventThe DOM event
click

The click event.

Event properties:

PropertyTypeValue
typeString"click"
targetGeoemtrythis
coordinateCoordinateThe event coordinate
containerPointPointThe event container point
viewPointPointThe event point relative to the container
domEventeventThe DOM event
dblclick

The dblclick event.

Event properties:

PropertyTypeValue
typeString"dblclick"
targetGeoemtrythis
coordinateCoordinateThe event coordinate
containerPointPointThe event container point
viewPointPointThe event point relative to the container
domEventeventThe DOM event
contextmenu

The contextmenu event.

Event properties:

PropertyTypeValue
typeString"contextmenu"
targetGeoemtrythis
coordinateCoordinateThe event coordinate
containerPointPointThe event container point
viewPointPointThe event point relative to the container
domEventeventThe DOM event
touchstart

The touchstart event.

Event properties:

PropertyTypeValue
typeString"touchstart"
targetGeoemtrythis
coordinateCoordinateThe event coordinate
containerPointPointThe event container point
viewPointPointThe event point relative to the container
domEventeventThe DOM event
touchmove

The touchmove event.

Event properties:

PropertyTypeValue
typeString"touchmove"
targetGeoemtrythis
coordinateCoordinateThe event coordinate
containerPointPointThe event container point
viewPointPointThe event point relative to the container
domEventeventThe DOM event
touchend

The touchend event.

Event properties:

PropertyTypeValue
typeString"touchend"
targetGeoemtrythis
coordinateCoordinateThe event coordinate
containerPointPointThe event container point
viewPointPointThe event point relative to the container
domEventeventThe DOM event
mouseenter

The mouseenter event.

Event properties:

PropertyTypeValue
typeString"mouseenter"
targetGeoemtrythis
coordinateCoordinateThe event coordinate
containerPointPointThe event container point
viewPointPointThe event point relative to the container
domEventeventThe DOM event
mouseover

The mouseover event.

Event properties:

PropertyTypeValue
typeString"mouseover"
targetGeoemtrythis
coordinateCoordinateThe event coordinate
containerPointPointThe event container point
viewPointPointThe event point relative to the container
domEventeventThe DOM event
mouseout

The mouseout event.

Event properties:

PropertyTypeValue
typeString"mouseout"
targetGeoemtrythis
coordinateCoordinateThe event coordinate
containerPointPointThe event container point
viewPointPointThe event point relative to the container
domEventeventThe DOM event
idchange

Fired when the geometry id changes.

Event properties:

PropertyTypeValue
typeString"idchange"
targetGeometrythis
oldStringThe old id
newStringThe new id
propertieschange

Fired when the geometry properties data changes.

Event properties:

PropertyTypeValue
typeString"propertieschange"
targetGeometrythis
oldStringThe old id
newStringThe new id
show

Fired when the geometry is shown.

Event properties:

PropertyTypeValue
typeString"show"
targetGeometrythis
hide

Fired when the geometry is hidden.

Event properties:

PropertyTypeValue
typeString"hide"
targetGeometrythis
zindexchange

Fired when the geometry zIndex changes.

Event properties:

PropertyTypeValue
typeString"zindexchange"
targetGeometrythis
oldStringThe old zIndex
newStringThe new zIndex
removestart

Fired when the geometry starts to be removed.

Event properties:

PropertyTypeValue
typeString"removestart"
targetGeometrythis
removeend

Fired when the removal of the geometry ends.

Event properties:

PropertyTypeValue
typeString"removeend"
targetGeometrythis
remove

Fired when the geometry is removed; it is thrown after removeend.

Event properties:

PropertyTypeValue
typeString"remove"
targetGeometrythis
shapechange

Fired when the geometry shape changes, e.g. when adding or removing a vertex or modifying the position of a vertex.

Event properties:

PropertyTypeValue
typeString"shapechange"
targetGeometrythis
positionchange

Fired when the geometry position changes, i.e. when it is moved as a whole without a change in shape.

Event properties:

PropertyTypeValue
typeString"positionchange"
targetGeometrythis
symbolchange

Fired when the symbol of the geometry changes.

Event properties:

PropertyTypeValue
typeString"symbolchange"
targetGeometrythis
propertiesObjectThe symbol properties
editstart

Fired when editing starts.

Event properties:

PropertyTypeValue
typeString"editstart"
targetGeometrythis
editend

Fired when editing ends.

Event properties:

PropertyTypeValue
typeString"editend"
targetGeometrythis
canceledit

Fired when editing is cancelled.

Event properties:

PropertyTypeValue
typeString"canceledit"
targetGeometrythis
redoedit

Fired when an edit is redone.

Event properties:

PropertyTypeValue
typeString"redoedit"
targetGeometrythis
undoedit

Fired when an edit is undone.

Event properties:

PropertyTypeValue
typeString"undoedit"
targetGeometrythis
dragstart

Fired when dragging starts.

Event properties:

PropertyTypeValue
typeString"dragstart"
targetGeometrythis
coordinateCoordinateThe event coordinate
containerPointPointThe event container point
viewPointPointThe event point relative to the container
domEventeventThe DOM event
dragging

Fired while dragging.

Event properties:

PropertyTypeValue
typeString"dragging"
targetGeometrythis
coordinateCoordinateThe event coordinate
containerPointPointThe event container point
viewPointPointThe event point relative to the container
domEventeventThe DOM event
dragend

Fired when dragging ends.

Event properties:

PropertyTypeValue
typeString"dragend"
targetGeometrythis
coordinateCoordinateThe event coordinate
containerPointPointThe event container point
viewPointPointThe event point relative to the container
domEventeventThe DOM event
animatestart

Fired when an animation starts.

Event properties:

PropertyTypeValue
typeString"animatestart"
targetGeometrythis
animating

Fired while an animation is running.

Event properties:

PropertyTypeValue
typeString"animating"
targetGeometrythis
animateend

Fired when an animation ends.

Event properties:

PropertyTypeValue
typeString"animateend"
targetGeometrythis
handledragstart

Fired when dragging an edit handle starts.

Event properties:

PropertyTypeValue
typeString"handledragstart"
targetGeometrythis
handledragging

Fired while dragging an edit handle.

Event properties:

PropertyTypeValue
typeString"handledragging"
targetGeometrythis
handledragend

Fired when dragging an edit handle ends.

Event properties:

PropertyTypeValue
typeString"handledragend"
targetGeometrythis
editrecord

Fired when an edit is made and recorded in the edit history.

Event properties:

PropertyTypeValue
typeString"editrecord"
targetGeometrythis
add

Fired when the geometry is added to a layer.

Event properties:

PropertyTypeValue
typeString"add"
targetGeometrythis

Additional events (verified against 2026 source code)

  • meshcreate: fired when the mesh is created (fired on the marker; the layer receives it synchronously through the geometry event)
  • modelerror: fired when a model fails to load
  • positionchange: fired when the coordinates change

This document has been verified against the 2026 source code of @maptalks/gl-layers (api-notes-others.md)