- LngLatBounds
LngLatBounds
- addGeocoderICGC([options], [position]) ⇒
Object
Add geocoder with customizable options.
- getConfigStyles() ⇒
Array
Retrieves the available base styles from default options.
- getConfigWMSLayers() ⇒
Array
Retrieves the available WMS image layers from default options.
- getConfigOrtoLayers() ⇒
Array
Retrieves the available orto image layers from default options.
- getConfigVectorLayers() ⇒
Array
Retrieves the available vector layers from default options.
- getConfigVectorAdminLayers() ⇒
Array
Retrieves the available vector layers from default options.
- getConfigFGBAdminLayers() ⇒
Array
Retrieves the available fgb layers from default options.
- fetchData(url, idLayer, options)
Fetches GeoJSON data from a URL and adds a corresponding layer to the map based on the specified geometry type.
- fetchDataAndMenu(url, idLayer, filterField, options)
Fetches GeoJSON data from a URL and adds a corresponding layer to the map based on the specified geometry type and adds to the Menu as a checkbox item.
- on(type, func)
Adds an event listener to the map.
- setStyle(style, [options])
Sets the style of the map.
- addControl(control, [position])
Adds a control to the map with the specified position.
- setSky(options)
Sets the sky properties of the map.
- addMouseCoordControl([position])
Adds a mouse coordinate control to the map.
- addGeolocateControl(options, [position])
Adds a geolocate control to the map.
- addFullscreenControl(options, [position])
Adds a fullscreen control to the map.
- addLayer(layer, layerIdOrder)
Adds a layer to the map.
- addImage(id, image, options) ⇒
this
Adds an image to the map.
- addSource(id, source) ⇒
this
Adds a source to the map.
- addSprite(id, url, options) ⇒
this
Adds a sprite to the map.
- areTilesLoaded() ⇒
boolean
Checks if all tiles in the viewport are loaded.
- cameraForBounds(bounds, options) ⇒
CenterZoomBearing
|undefined
Calculates the camera position for given bounds.
- easeTo(options, eventData) ⇒
this
Eases the camera to a new position.
- fitBounds(bounds, options, eventData) ⇒
this
Fits the map to the given geographical bounds.
- fitScreenCoordinates(p0, p1, bearing, options, eventData) ⇒
this
Fits the map to the given screen coordinates.
- flyTo(options, eventData) ⇒
this
Flies the camera to a new position.
- getBearing() ⇒
number
Gets the current bearing of the map.
- getBounds() ⇒
LngLatBounds
Gets the current geographical bounds of the map.
- getCameraTargetElevation() ⇒
number
Gets the elevation for the point where the camera is looking.
- getCanvas() ⇒
HTMLCanvasElement
Gets the map's element.
- getCanvasContainer() ⇒
HTMLElement
Gets the HTML element containing the map's element.
- getCenter() ⇒
LngLat
Returns the map's geographical centerpoint.
- getContainer() ⇒
HTMLElement
Returns the map's containing HTML element.
- getFeatureState(feature) ⇒
any
Gets the state of a feature.
- getFilter(layerId) ⇒
void
|FilterSpecification
Returns the filter applied to the specified style layer.
- getGlyphs() ⇒
string
Returns the value of the style's glyphs URL.
- getImage(id) ⇒
StyleImage
Returns an image currently available in the map.
- getLayer(id) ⇒
StyleLayer
Returns the layer with the specified ID in the map's style.
- getLayersOrder() ⇒
Array.<string>
Return the ids of all layers currently in the style, including custom layers, in order.
- getLayoutProperty(layerId, name) ⇒
any
Returns the value of a layout property in the specified style layer.
- getLight() ⇒
LightSpecification
Returns the value of the light object.
- getMaxBounds() ⇒
LngLatBounds
Returns the maximum geographical bounds the map is constrained to.
- getMaxPitch() ⇒
number
Returns the map's maximum allowable pitch.
- getMaxZoom() ⇒
number
Returns the map's maximum allowable zoom level.
- getMinPitch() ⇒
number
Returns the map's minimum allowable pitch.
- getMinZoom() ⇒
number
Returns the map's minimum allowable zoom level.
- getPadding() ⇒
PaddingOptions
Returns the current padding applied around the map viewport.
- getPaintProperty(layerId, name) ⇒
unknown
Returns the value of a paint property in the specified style layer.
- getPitch() ⇒
number
Returns the map's current pitch (tilt).
- getPixelRatio() ⇒
number
Returns the map's pixel ratio.
- getRenderWorldCopies() ⇒
boolean
Returns the state of renderWorldCopies.
- getSource(id) ⇒
Source
Returns the source with the specified ID in the map's style.
- getSprite() ⇒
Array.<object>
Returns the as-is value of the style's sprite.
- getStyle() ⇒
StyleSpecification
Returns the map's MapLibre style object.
- getTerrain() ⇒
TerrainSpecification
Get the terrain-options if terrain is loaded.
- getZoom() ⇒
number
Returns the map's current zoom level.
- hasControl(control) ⇒
boolean
Checks if a control exists on the map.
- hasImage(id) ⇒
boolean
Check whether or not an image with a specific ID exists in the style.
- isMoving() ⇒
boolean
Returns true if the map is panning, zooming, rotating, or pitching due to a camera animation or user gesture.
- isRotating() ⇒
boolean
Returns true if the map is rotating due to a camera animation or user gesture.
- isSourceLoaded(id) ⇒
boolean
Returns a Boolean indicating whether the source is loaded.
- isStyleLoaded() ⇒
boolean
|void
Returns a Boolean indicating whether the map's style is fully loaded.
- isZooming() ⇒
boolean
Returns true if the map is zooming due to a camera animation or user gesture.
- jumpTo(options, [eventData]) ⇒
this
Changes any combination of center, zoom, bearing, and pitch, without an animated transition.
- listImages() ⇒
Array.<string>
Returns an Array of strings containing the IDs of all images currently available in the map.
- listens(type) ⇒
boolean
Returns a true if this instance of Evented or any forwardeed instances of Evented have a listener for the specified type.
- loadImage(url) ⇒
Promise.<GetResourceResponse.<(ImageBitmap|HTMLImageElement)>>
Load an image from an external URL to be used with Map#addImage.
- loaded() ⇒
boolean
Returns a Boolean indicating whether the map is fully loaded.
- addProtocol(customProtocol, loadFn) ⇒
void
Adds a custom load resource function that will be called when using a URL that starts with a custom URL schema.
- moveLayer(id, [beforeId]) ⇒
this
Moves a layer to a different z-position.
- panBy(offset, [options], [eventData]) ⇒
this
Pans the map by the specified offset.
- panTo(lnglat, [options], [eventData]) ⇒
this
Pans the map to the specified location with an animated transition.
- project(lnglat) ⇒
Point
Returns a Point representing pixel coordinates, relative to the map's container, that correspond to the specified geographical location.
- queryRenderedFeatures([geometryOrOptions], [options]) ⇒
Array
Queries rendered features within a specified geometry or bounding box.
- querySourceFeatures(sourceId, parameters) ⇒
Array
Queries source features within a specified source.
- queryTerrainElevation(lngLatLike) ⇒
number
Queries the terrain elevation at a specified geographical location.
- redraw() ⇒
this
Redraws the map.
- remove() ⇒
this
Removes the map from the DOM.
- removeControl(control) ⇒
this
Removes a control from the map.
- removeFeatureState(target, [key]) ⇒
this
Removes the state of a feature.
- removeImage(id) ⇒
this
Removes an image from the style's sprite.
- removeLayer(idLayer)
Removes a layer from the map.
- removeSource(idLayer)
Removes a source from the map.
- removeSprite(id) ⇒
this
Removes a sprite from the style.
- resetNorth([options], [eventData]) ⇒
this
Resets the map orientation so that north is up.
- resetNorthPitch([options], [eventData]) ⇒
this
Resets the map orientation so that north is up and pitch is set to 0┬░.
- resize([eventData]) ⇒
this
Resizes the map to fit its container.
- rotateTo(bearing, [options], [eventData]) ⇒
this
Rotates the map to the specified bearing with an animated transition.
- setBearing(bearing, [eventData]) ⇒
this
Sets the map's bearing with an optional animated transition.
- setCenter(center, [eventData]) ⇒
this
Sets the map's center coordinates with an optional animated transition.
- setEventedParent([parent], [data]) ⇒
this
Sets the parent of the map's event emitter.
- setFeatureState(feature, state) ⇒
this
Sets the state of a feature.
- setFilter(layerId, [filter], [options]) ⇒
this
Sets the filter for a specified layer.
- setGlyphs(glyphsUrl, [options]) ⇒
this
Sets the glyphs for the map's style.
- setLayerZoomRange(layerId, minzoom, maxzoom) ⇒
this
Sets the zoom range for a specified layer.
- setLayoutProperty(layerId, name, value, [options]) ⇒
this
Sets a layout property for a specified layer.
- setLight(light, [options]) ⇒
this
Sets the light for the map's style.
- setMaxBounds(bounds) ⇒
this
Sets the maximum bounds for the map.
- setMaxPitch(maxPitch) ⇒
this
Sets the maximum pitch for the map.
- setMaxZoom(maxZoom) ⇒
this
Sets the maximum zoom level for the map.
- setMinPitch(minPitch) ⇒
this
Sets the minimum pitch for the map.
- setMinZoom(minZoom) ⇒
this
Sets the minimum zoom level for the map.
- setPadding(padding, [eventData]) ⇒
this
Sets padding for the map's container.
- setPaintProperty(layerId, name, value, [options]) ⇒
this
Sets a paint property for a specified layer.
- setPitch(pitch, [eventData]) ⇒
this
Sets the map's pitch angle with an optional animated transition.
- setPixelRatio(pixelRatio) ⇒
this
Sets the pixel ratio for the map.
- setRenderWorldCopies(renderWorldCopies) ⇒
this
Sets whether the map should render world copies when the center longitude is greater than or less than ┬▒180 degrees.
- setSprite(spriteUrl, [options]) ⇒
this
Sets the sprite for the map's style.
- setTerrain(options) ⇒
this
Loads a 3D terrain mesh based on a "raster-dem" source.
- setTransformRequest(transformRequest) ⇒
this
Updates the requestManager's transform request with a new function.
- setZoom(zoom, [eventData]) ⇒
this
Sets the map's zoom level.
- snapToNorth([options], [eventData]) ⇒
this
Snaps the map so that north is up (0┬░ bearing), if the current bearing is close enough to it.
- stop() ⇒
this
Stops any animated transition underway.
- triggerRepaint() ⇒
void
Triggers the rendering of a single frame.
- unproject(point) ⇒
LngLat
Returns geographical coordinates corresponding to the specified pixel coordinates.
- updateImage(id, image) ⇒
this
Updates an existing image in the style's sprite.
- zoomIn([options], [eventData]) ⇒
this
Increases the map's zoom level by 1.
- zoomOut([options], [eventData]) ⇒
this
Decreases the map's zoom level by 1.
- zoomTo(zoom, [options], [eventData]) ⇒
this
Zooms the map to the specified zoom level with an animated transition.
- addLayerGeoJSON(layer, layerPosition)
Adds a GeoJSON layer to the map.
- addLayerWMS(tiles, idLayer, options)
Adds a WMS layer to the map.
- addLogo(options)
Adds a logo to the map.
- addBasemapsICGC(basesArray)
Adds base layers to the map.
- addBasemaps(baseLayers)
Adds base layers to the map.
- addFeatureQuery(idLayer, queryFields, popupStyle)
Adds feature query function to a layer.
- addScaleControl(options, position)
Adds a scale control to the map.
- @function addScaleControl
- addExportControl(options, [position])
Adds an export control to the map with the provided options and position.
- addMarker(options) ⇒
Object
Adds a marker to the map.
- addPopup(options, coord, text, popupStyle) ⇒
Object
Adds a popup to the map.
- addFullScreen([position])
Adds a fullscreen control to the map.
- addMenuItem(name)
Adds a menu item with a checkbox for controlling the visibility of a layer on the map.
- addLayerTree(options)
Adds a layer tree to the map.
- createNavigationControl(options, [position]) ⇒
Object
Creates a navigation control with the provided options.
- addNavigationControl(options, [position])
Adds a navigation control to the map with the provided options.
- addAttributionControl(options, [position])
Adds an attribution control to the map with the provided options.
- addImageLayerICGC(url, idLayer, options)
Adds an ICGC image layer to the map based on the specified name and year.
- addVectorLayerICGC(url, idLayer, options)
Adds an ICGC vector layer to the map based on the specified name and year.
- addFGBLayerICGC(url, idLayer, options)
Adds an ICGC FGB layer to the map based on the specified name and year.
- addTerrainICGC(url, controlPosition)
Adds 3D terrain to the map using hillshade.
- addLegend(url, idLayer)
Add image legend.
- _findImageType(url, var1, var2, var3, var4) ⇒
string
|null
Finds the type of image based on the provided URL and specified vectors.
- _getKeyByUrlFGB(url) ⇒
string
|null
Gets the key by URL from the FGBAdmin layers.
- _getLegendByName(name) ⇒
string
|null
Gets the legend by name from the default vector layers.
- _getKeyByUrlVector(url) ⇒
string
|null
Gets the key by URL from the Vector layers.
- _raiseText3DStyle() ⇒
Promise.<void>
Raises text 3D style on the map.
- _dealStyleMaps(name) ⇒
Object
|string
|null
Deals with map styles based on the name.
- _dealOrto3dStyle(name) ⇒
void
|null
Deals with the 3D ortho style based on the name.
- _dealOrderLayer(order) ⇒
string
Deals with the order of the layer.
- _firstSymbolLayer() ⇒
string
|undefined
Retrieves the id of the first symbol layer.
- _firstLineLayer() ⇒
string
|undefined
Retrieves the id of the first line layer.
- _createCitiesMapboxLayer() ⇒
MapboxLayer
|null
Creates a Mapbox layer for displaying cities in 3D.
LngLatBounds
Constructs a new LngLatBounds object representing a geographical bounding box.
Param | Type | Description |
---|---|---|
[sw] | LngLatLike |
The southwest corner of the bounding box. Can be specified as an array of 4 numbers in the order of west, south, east, north, or an array of 2 LngLatLike representing [sw,ne]. |
[ne] | LngLatLike |
The northeast corner of the bounding box. |
Add geocoder with customizable options.
Kind: global function
Returns: Object
- - The merged configuration options for the geocoder, including the position.
Param | Type | Default | Description |
---|---|---|---|
[options] | Object |
{} |
Optional configuration options for the geocoder. Defaults to an empty object. |
[position] | string |
"'top-right'" |
Position to add the geocoder control on the map. Defaults to 'top-right'. |
Retrieves the available base styles from default options.
Kind: global function
Returns: Array
- - Array containing the names of available base styles.
Retrieves the available WMS image layers from default options.
Kind: global function
Returns: Array
- - Array containing the keys of available WMS image layers.
Retrieves the available orto image layers from default options.
Kind: global function
Returns: Array
- - Array containing the keys of available image layers.
Retrieves the available vector layers from default options.
Kind: global function
Returns: Array
- - Array containing the keys of available vector layers.
Retrieves the available vector layers from default options.
Kind: global function
Returns: Array
- - Array containing the keys of available vectorAdmin layers.
Retrieves the available fgb layers from default options.
Kind: global function
Returns: Array
- - Array containing the keys of available fgbadmin layers.
Fetches GeoJSON data from a URL and adds a corresponding layer to the map based on the specified geometry type.
Kind: global function
Param | Type | Description |
---|---|---|
url | string |
The URL to fetch GeoJSON data from. |
idLayer | string |
The id for the layer. |
options | Object |
Additional options for configuring the layer. |
Fetches GeoJSON data from a URL and adds a corresponding layer to the map based on the specified geometry type and adds to the Menu as a checkbox item.
Kind: global function
Param | Type | Description |
---|---|---|
url | string |
The URL to fetch GeoJSON data from. |
idLayer | string |
The geometry name (e.g., 'buildings'). |
filterField | string |
Import all features as unique or group based on a field ('all', 'field'). |
options | Object |
Additional options for configuring the layer. |
Adds an event listener to the map.
Kind: global function
Param | Type | Description |
---|---|---|
type | string |
The type of the event. |
func | function |
The callback function to be executed when the event occurs. |
Sets the style of the map.
Kind: global function
Param | Type | Description |
---|---|---|
style | string |
Name of the map style. |
[options] | Object |
Options for setting the style. |
Adds a control to the map with the specified position.
Kind: global function
Param | Type | Default | Description |
---|---|---|---|
control | Object |
The control to add. | |
[position] | string |
"'top-right'" |
Position to add the control on the map. |
Sets the sky properties of the map.
Kind: global function
Param | Type | Default | Description |
---|---|---|---|
options | Object |
Options to set the sky properties. | |
[options.skyType] | string |
"'gradient'" |
Type of sky to set (e.g., 'gradient', 'atmosphere'). |
[options.color] | string |
"'lightblue'" |
Color of the sky. |
[options.horizonBlend] | Number |
0.03 |
Blend horizon value. |
[options.starIntensity] | Number |
0.5 |
Intensity of stars in the sky. |
[options.sunIntensity] | Number |
0.1 |
Intensity of the sun in the sky. |
[options.sunPosition] | Array.<Number> |
[0, 0] |
Position of the sun in the sky. |
Adds a mouse coordinate control to the map.
Kind: global function
Param | Type | Default | Description |
---|---|---|---|
options.width | Number |
Width control i. | |
options.utm | Boolean |
Boolean to show coordinates in UTM. | |
options.lonlat | Boolean |
Boolean to show coordinates in Lon Lat. | |
[position] | string |
"'bottom-left'" |
Position to add the control on the map. |
Adds a geolocate control to the map.
Kind: global function
Param | Type | Default | Description |
---|---|---|---|
options | Object |
Options for the geolocate control. | |
[position] | string |
"'top-right'" |
Position to add the control on the map. |
Adds a fullscreen control to the map.
Kind: global function
Param | Type | Default | Description |
---|---|---|---|
options | Object |
Options for the geolocate control. | |
[position] | string |
"'top-right'" |
Position to add the control on the map. |
Adds a layer to the map.
Kind: global function
Param | Type | Description |
---|---|---|
layer | Object |
Options for the layer to add. |
layerIdOrder | string |
Optional layer Id draw position. |
Adds an image to the map.
Kind: global function
Param | Type | Description |
---|---|---|
id | string |
The ID of the image. |
image | ImageBitmap | HTMLImageElement | ImageData | StyleImageInterface | object |
The image object to add. |
options | Partial.<StyleImageMetadata> |
Optional metadata for the image. |
Adds a source to the map.
Kind: global function
Param | Type | Description |
---|---|---|
id | string |
The ID of the source. |
source | SourceSpecification |
The source object to add. |
Adds a sprite to the map.
Kind: global function
Param | Type | Description |
---|---|---|
id | string |
The ID of the sprite. |
url | string |
The URL to load the sprite from. |
options | StyleSetterOptions |
Options object. |
Checks if all tiles in the viewport are loaded.
Calculates the camera position for given bounds.
Kind: global function
Param | Type | Description |
---|---|---|
bounds | LngLatBoundsLike |
The geographical bounds to fit. |
options | CameraForBoundsOptions |
Options object. |
Eases the camera to a new position.
Kind: global function
Param | Type | Description |
---|---|---|
options | object |
Options describing the animation. |
eventData | any |
Additional properties for event objects. |
Fits the map to the given geographical bounds.
Kind: global function
Param | Type | Description |
---|---|---|
bounds | LngLatBoundsLike |
The geographical bounds to fit. |
options | FitBoundsOptions |
Options object. |
eventData | any |
Additional properties for event objects. |
Fits the map to the given screen coordinates.
Kind: global function
Param | Type | Description |
---|---|---|
p0 | PointLike |
First point on screen, in pixel coordinates. |
p1 | PointLike |
Second point on screen, in pixel coordinates. |
bearing | number |
Desired map bearing at end of animation, in degrees. |
options | FitBoundsOptions |
Options object. |
eventData | any |
Additional properties for event objects. |
Flies the camera to a new position.
Kind: global function
Param | Type | Description |
---|---|---|
options | FlyToOptions |
Options describing the flight. |
eventData | any |
Additional properties for event objects. |
Gets the current bearing of the map.
getBounds() ⇒ LngLatBounds
Gets the current geographical bounds of the map.
Gets the elevation for the point where the camera is looking.
Gets the map's element.
Gets the HTML element containing the map's element.
Returns the map's geographical centerpoint.
Kind: global function
Returns: LngLat
- The map's geographical centerpoint.
Returns the map's containing HTML element.
Kind: global function
Returns: HTMLElement
- The map's container.
Gets the state of a feature.
Kind: global function
Returns: any
- The state of the feature.
Param | Type | Description |
---|---|---|
feature | FeatureIdentifier |
Feature identifier. |
Returns the filter applied to the specified style layer.
Kind: global function
Returns: void
| FilterSpecification
- The layer's filter.
Param | Type | Description |
---|---|---|
layerId | string |
The ID of the style layer. |
Returns the value of the style's glyphs URL.
Kind: global function
Returns: string
- The glyphs Style's glyphs URL.
Returns an image currently available in the map.
Kind: global function
Returns: StyleImage
- An image in the map with the specified ID.
Param | Type | Description |
---|---|---|
id | string |
The ID of the image. |
Returns the layer with the specified ID in the map's style.
Kind: global function
Returns: StyleLayer
- The layer with the specified ID.
Param | Type | Description |
---|---|---|
id | string |
The ID of the layer to get. |
Return the ids of all layers currently in the style, including custom layers, in order.
Kind: global function
Returns: Array.<string>
- Ids of layers, in order.
Returns the value of a layout property in the specified style layer.
Kind: global function
Returns: any
- The value of the specified layout property.
Param | Type | Description |
---|---|---|
layerId | string |
The ID of the layer. |
name | string |
The name of the layout property. |
Returns the value of the light object.
Kind: global function
Returns: LightSpecification
- Light properties of the style.
getMaxBounds() ⇒ LngLatBounds
Returns the maximum geographical bounds the map is constrained to.
Kind: global function
Returns: LngLatBounds
- The map's maximum geographical bounds.
Returns the map's maximum allowable pitch.
Kind: global function
Returns: number
- The maxPitch.
Returns the map's maximum allowable zoom level.
Kind: global function
Returns: number
- The maxZoom.
Returns the map's minimum allowable pitch.
Kind: global function
Returns: number
- The minPitch.
Returns the map's minimum allowable zoom level.
Kind: global function
Returns: number
- The minZoom.
Returns the current padding applied around the map viewport.
Kind: global function
Returns: PaddingOptions
- The current padding around the map viewport.
Returns the value of a paint property in the specified style layer.
Kind: global function
Returns: unknown
- The value of the specified paint property.
Param | Type | Description |
---|---|---|
layerId | string |
The ID of the layer. |
name | string |
The name of a paint property. |
Returns the map's current pitch (tilt).
Kind: global function
Returns: number
- The map's current pitch, measured in degrees away from the plane of the screen.
Returns the map's pixel ratio.
Kind: global function
Returns: number
- The pixel ratio.
Returns the state of renderWorldCopies.
Kind: global function
Returns: boolean
- The renderWorldCopies.
Returns the source with the specified ID in the map's style.
Kind: global function
Returns: Source
- The style source with the specified ID.
Param | Type | Description |
---|---|---|
id | string |
The ID of the source to get. |
Returns the as-is value of the style's sprite.
Kind: global function
Returns: Array.<object>
- Style's sprite list of id-url pairs.
Returns the map's MapLibre style object.
Kind: global function
Returns: StyleSpecification
- The map's style JSON object.
Get the terrain-options if terrain is loaded.
Kind: global function
Returns: TerrainSpecification
- The TerrainSpecification passed to setTerrain.
Returns the map's current zoom level.
Kind: global function
Returns: number
- The map's current zoom level.
Checks if a control exists on the map.
Kind: global function
Returns: boolean
- true if map contains control.
Param | Type | Description |
---|---|---|
control | IControl |
The IControl to check. |
Check whether or not an image with a specific ID exists in the style.
Kind: global function
Returns: boolean
- A Boolean indicating whether the image exists.
Param | Type | Description |
---|---|---|
id | string |
The ID of the image. |
Returns true if the map is panning, zooming, rotating, or pitching due to a camera animation or user gesture.
Kind: global function
Returns: boolean
- true if the map is moving.
Returns true if the map is rotating due to a camera animation or user gesture.
Kind: global function
Returns: boolean
- true if the map is rotating.
Returns a Boolean indicating whether the source is loaded.
Kind: global function
Returns: boolean
- A Boolean indicating whether the source is loaded.
Param | Type | Description |
---|---|---|
id | string |
The ID of the source to be checked. |
Returns a Boolean indicating whether the map's style is fully loaded.
Kind: global function
Returns: boolean
| void
- A Boolean indicating whether the style is fully loaded.
Returns true if the map is zooming due to a camera animation or user gesture.
Kind: global function
Returns: boolean
- true if the map is zooming.
Changes any combination of center, zoom, bearing, and pitch, without an animated transition.
Kind: global function
Param | Type | Description |
---|---|---|
options | JumpToOptions |
Options object |
[eventData] | any |
Additional properties to be added to event objects of events triggered by this method. |
Returns an Array of strings containing the IDs of all images currently available in the map.
Kind: global function
Returns: Array.<string>
- An Array of strings containing the names of all sprites/images currently available in the map.
Returns a true if this instance of Evented or any forwardeed instances of Evented have a listener for the specified type.
Kind: global function
Returns: boolean
- true if there is at least one registered listener for specified event type, false otherwise.
Param | Type | Description |
---|---|---|
type | string |
The event type. |
Load an image from an external URL to be used with Map#addImage.
Kind: global function
Returns: Promise.<GetResourceResponse.<(ImageBitmap|HTMLImageElement)>>
- A promise that is resolved when the image is loaded.
Param | Type | Description |
---|---|---|
url | string |
The URL of the image file. Image file must be in png, webp, or jpg format. |
Returns a Boolean indicating whether the map is fully loaded.
Kind: global function
Returns: boolean
- A Boolean indicating whether the map is fully loaded.
Adds a custom load resource function that will be called when using a URL that starts with a custom URL schema.
Kind: global function
Param | Type | Description |
---|---|---|
customProtocol | string |
The protocol to hook, for example 'custom'. |
loadFn | AddProtocolAction |
The function to use when trying to fetch a resource specified by the customProtocol. |
Moves a layer to a different z-position.
Kind: global function
Param | Type | Description |
---|---|---|
id | string |
The ID of the layer to move. |
[beforeId] | string |
The ID of an existing layer to insert the new layer before. |
Pans the map by the specified offset.
Kind: global function
Param | Type | Description |
---|---|---|
offset | PointLike |
x and y coordinates by which to pan the map. |
[options] | AnimationOptions |
Options object. |
[eventData] | any |
Additional properties to be added to event objects of events triggered by this method. |
Pans the map to the specified location with an animated transition.
Kind: global function
Param | Type | Description |
---|---|---|
lnglat | LngLatLike |
The location to pan the map to. |
[options] | AnimationOptions |
Options describing the destination and animation of the transition. |
[eventData] | any |
Additional properties to be added to event objects of events triggered by this method. |
Returns a Point representing pixel coordinates, relative to the map's container, that correspond to the specified geographical location.
Kind: global function
Returns: Point
- The Point corresponding to lnglat, relative to the map's container.
Param | Type | Description |
---|---|---|
lnglat | LngLatLike |
The geographical location to project. |
Queries rendered features within a specified geometry or bounding box.
Kind: global function
Returns: Array
- An array of GeoJSON Feature objects representing the features that intersect the query geometry.
Param | Type | Description |
---|---|---|
[geometryOrOptions] | GeometryLike | Array | Object |
The geometry or options for the query. |
[options] | Object |
Options for the query. |
Queries source features within a specified source.
Kind: global function
Returns: Array
- An array of GeoJSON Feature objects representing the features in the source that satisfy the query parameters.
Param | Type | Description |
---|---|---|
sourceId | string |
The ID of the source to query. |
parameters | Object |
Parameters for the query. |
Queries the terrain elevation at a specified geographical location.
Kind: global function
Returns: number
- The elevation (in meters) at the specified location.
Param | Type | Description |
---|---|---|
lngLatLike | LngLatLike |
The geographical location to query. |
Redraws the map.
Removes the map from the DOM.
Removes a control from the map.
Kind: global function
Param | Type | Description |
---|---|---|
control | Object |
The control to remove. |
Removes the state of a feature.
Kind: global function
Param | Type | Description |
---|---|---|
target | Object |
The target feature. |
[key] | string |
The key of the state to remove. |
Removes an image from the style's sprite.
Kind: global function
Param | Type | Description |
---|---|---|
id | string |
The ID of the image to remove. |
Removes a layer from the map.
Kind: global function
Param | Type | Description |
---|---|---|
idLayer | string |
Identifier of the layer to remove. |
Removes a source from the map.
Kind: global function
Param | Type | Description |
---|---|---|
idLayer | string |
Identifier of the source to remove. |
Removes a sprite from the style.
Kind: global function
Param | Type | Description |
---|---|---|
id | string |
The ID of the sprite to remove. |
Resets the map orientation so that north is up.
Kind: global function
Param | Type | Description |
---|---|---|
[options] | Object |
Options for the reset. |
[eventData] | any |
Additional properties to be added to event objects of events triggered by this method. |
Resets the map orientation so that north is up and pitch is set to 0┬░.
Kind: global function
Param | Type | Description |
---|---|---|
[options] | Object |
Options for the reset. |
[eventData] | any |
Additional properties to be added to event objects of events triggered by this method. |
Resizes the map to fit its container.
Kind: global function
Param | Type | Description |
---|---|---|
[eventData] | any |
Additional properties to be added to event objects of events triggered by this method. |
Rotates the map to the specified bearing with an animated transition.
Kind: global function
Param | Type | Description |
---|---|---|
bearing | number |
The desired bearing (in degrees) to rotate the map to. |
[options] | Object |
Options for the rotation. |
[eventData] | any |
Additional properties to be added to event objects of events triggered by this method. |
Sets the map's bearing with an optional animated transition.
Kind: global function
Param | Type | Description |
---|---|---|
bearing | number |
The desired bearing (in degrees) to set for the map. |
[eventData] | any |
Additional properties to be added to event objects of events triggered by this method. |
Sets the map's center coordinates with an optional animated transition.
Kind: global function
Param | Type | Description |
---|---|---|
center | LngLatLike |
The desired center coordinates to set for the map. |
[eventData] | any |
Additional properties to be added to event objects of events triggered by this method. |
Sets the parent of the map's event emitter.
Kind: global function
Param | Type | Description |
---|---|---|
[parent] | any |
The parent object to set for the event emitter. |
[data] | any |
Additional data to pass to the parent. |
Sets the state of a feature.
Kind: global function
Param | Type | Description |
---|---|---|
feature | Object |
The feature to set the state for. |
state | Object |
The state object to set for the feature. |
Sets the filter for a specified layer.
Kind: global function
Param | Type | Description |
---|---|---|
layerId | string |
The ID of the layer to set the filter for. |
[filter] | Array |
The filter array to apply to the layer. |
[options] | Object |
Options for the filter. |
Sets the glyphs for the map's style.
Kind: global function
Param | Type | Description |
---|---|---|
glyphsUrl | string |
The URL to the glyphs. |
[options] | Object |
Options for setting the glyphs. |
Sets the zoom range for a specified layer.
Kind: global function
Param | Type | Description |
---|---|---|
layerId | string |
The ID of the layer to set the zoom range for. |
minzoom | number |
The minimum zoom level for the layer. |
maxzoom | number |
The maximum zoom level for the layer. |
Sets a layout property for a specified layer.
Kind: global function
Param | Type | Description |
---|---|---|
layerId | string |
The ID of the layer to set the layout property for. |
name | string |
The name of the layout property to set. |
value | any |
The value to set for the layout property. |
[options] | Object |
Options for setting the layout property. |
Sets the light for the map's style.
Kind: global function
Param | Type | Description |
---|---|---|
light | Object |
The light object to set for the map. |
[options] | Object |
Options for setting the light. |
Sets the maximum bounds for the map.
Kind: global function
Param | Type | Description |
---|---|---|
bounds | Array |
The maximum bounds for the map. |
Sets the maximum pitch for the map.
Kind: global function
Param | Type | Description |
---|---|---|
maxPitch | number |
The maximum pitch (in degrees) for the map. |
Sets the maximum zoom level for the map.
Kind: global function
Param | Type | Description |
---|---|---|
maxZoom | number |
The maximum zoom level for the map. |
Sets the minimum pitch for the map.
Kind: global function
Param | Type | Description |
---|---|---|
minPitch | number |
The minimum pitch (in degrees) for the map. |
Sets the minimum zoom level for the map.
Kind: global function
Param | Type | Description |
---|---|---|
minZoom | number |
The minimum zoom level for the map. |
Sets padding for the map's container.
Kind: global function
Param | Type | Description |
---|---|---|
padding | Object |
The padding object to set for the map's container. |
[eventData] | any |
Additional properties to be added to event objects of events triggered by this method. |
Sets a paint property for a specified layer.
Kind: global function
Param | Type | Description |
---|---|---|
layerId | string |
The ID of the layer to set the paint property for. |
name | string |
The name of the paint property to set. |
value | any |
The value to set for the paint property. |
[options] | Object |
Options for setting the paint property. |
Sets the map's pitch angle with an optional animated transition.
Kind: global function
Param | Type | Description |
---|---|---|
pitch | number |
The desired pitch angle (in degrees) to set for the map. |
[eventData] | any |
Additional properties to be added to event objects of events triggered by this method. |
Sets the pixel ratio for the map.
Kind: global function
Param | Type | Description |
---|---|---|
pixelRatio | number |
The desired pixel ratio for the map. |
Sets whether the map should render world copies when the center longitude is greater than or less than ┬▒180 degrees.
Kind: global function
Param | Type | Description |
---|---|---|
renderWorldCopies | boolean |
A boolean indicating whether to render world copies. |
Sets the sprite for the map's style.
Kind: global function
Param | Type | Description |
---|---|---|
spriteUrl | string |
The URL to the sprite. |
[options] | Object |
Options for setting the sprite. |
Loads a 3D terrain mesh based on a "raster-dem" source.
Kind: global function
Param | Type | Description |
---|---|---|
options | TerrainSpecification |
Options object specifying the terrain source. |
Updates the requestManager's transform request with a new function.
Kind: global function
Param | Type | Description |
---|---|---|
transformRequest | RequestTransformFunction |
The callback function to update the transform request. |
Sets the map's zoom level.
Kind: global function
Param | Type | Description |
---|---|---|
zoom | number |
The zoom level to set (0-20). |
[eventData] | any |
Additional properties to be added to event objects of events triggered by this method. |
Snaps the map so that north is up (0┬░ bearing), if the current bearing is close enough to it.
Kind: global function
Param | Type | Description |
---|---|---|
[options] | Object |
Options for snapping to north. |
[eventData] | any |
Additional properties to be added to event objects of events triggered by this method. |
Stops any animated transition underway.
Triggers the rendering of a single frame.
Returns geographical coordinates corresponding to the specified pixel coordinates.
Kind: global function
Returns: LngLat
- The geographical coordinates corresponding to the specified pixel coordinates.
Param | Type | Description |
---|---|---|
point | PointLike |
The pixel coordinates to unproject. |
Updates an existing image in the style's sprite.
Kind: global function
Param | Type | Description |
---|---|---|
id | string |
The ID of the image to update. |
image | ImageBitmap | HTMLImageElement | ImageData | StyleImageInterface | object |
The new image data. |
Increases the map's zoom level by 1.
Kind: global function
Param | Type | Description |
---|---|---|
[options] | Object |
Options for zooming in. |
[eventData] | any |
Additional properties to be added to event objects of events triggered by this method. |
Decreases the map's zoom level by 1.
Kind: global function
Param | Type | Description |
---|---|---|
[options] | Object |
Options for zooming out. |
[eventData] | any |
Additional properties to be added to event objects of events triggered by this method. |
Zooms the map to the specified zoom level with an animated transition.
Kind: global function
Param | Type | Description |
---|---|---|
zoom | number |
The zoom level to transition to. |
[options] | Object |
Options for zooming to. |
[eventData] | any |
Additional properties to be added to event objects of events triggered by this method. |
Adds a GeoJSON layer to the map.
Kind: global function
Param | Type | Description |
---|---|---|
layer | Object |
Options for the GeoJSON layer to add. |
layer.id | string |
Unique identifier for the layer. |
layer.data | Object |
GeoJSON data for the layer. |
layer.type | string |
Map layer type (e.g., 'symbol', 'circle', 'fill'). * |
layer.layout | Object |
Layer layout configuration. |
layer.paint | Object |
Layer paint configuration. |
layerPosition | string |
Position of the layer: 'top', below 'labels' or below 'lines'. |
Adds a WMS layer to the map.
Kind: global function
Param | Type | Description |
---|---|---|
tiles | Array.<string> |
Tiles for the raster layer. |
idLayer | string |
Unique identifier for the layer. |
options | Object |
Options of the layer: layout, paint and layerPosition. |
Adds a logo to the map.
Kind: global function
Param | Type | Description |
---|---|---|
options | Object |
Options for the logo to add. |
options.id | string |
Unique identifier for the logo. |
options.url | string |
URL of the logo image. |
options.href | string |
URL to navigate to when the logo is clicked. |
options.height | string |
Height of the logo. |
Adds base layers to the map.
Kind: global function
Param | Type | Description |
---|---|---|
basesArray | Array.<Object> |
Array of base layer objects. |
Adds base layers to the map.
Kind: global function
Param | Type | Description |
---|---|---|
baseLayers | Array.<Object> |
Array of base layer objects. |
baseLayers.label | string |
Label for the base layer. |
baseLayers.image | string |
URL of the image representing the base layer. |
baseLayers.url | string |
URL of the base layer style. |
Adds feature query function to a layer.
Kind: global function
Param | Type | Description |
---|---|---|
idLayer | string |
name of the layer |
queryFields | objetc |
optional indications for the popup |
popupStyle | objetc |
optional indications for the popup style |
Adds a scale control to the map.
- @function addScaleControl
Kind: global function
Param | Type | Description |
---|---|---|
options | Object |
Options for configuring the scale control. |
position | string |
The position on the map to place the scale control (e.g., 'top-left', 'bottom-right'). |
Adds an export control to the map with the provided options and position.
Kind: global function
Param | Type | Description |
---|---|---|
options | Object | string |
Options for the export control or position if provided as a string. |
[position] | string |
Position to place the export control (e.g., 'top-right'). |
Adds a marker to the map.
Kind: global function
Returns: Object
- - Instance of the added marker.
Param | Type | Description |
---|---|---|
options | Object |
Options for the marker to add. |
options.text | string |
Text content for the marker popup. |
options.options | Object |
Marker options. |
options.coord | LngLatLike |
Coordinates for placing the marker. |
options.textOffset | Object |
Text offset for the marker popup. |
Adds a popup to the map.
Kind: global function
Returns: Object
- - Instance of the added popup.
Param | Type | Description |
---|---|---|
options | Object |
Options for the popup to add. |
coord | LngLatLike |
Coordinates for placing the popup. |
text | string |
HTML content for the popup. |
popupStyle | string |
css content for the popup style. |
Adds a fullscreen control to the map.
Kind: global function
Param | Type | Default | Description |
---|---|---|---|
[position] | string |
"'top-right'" |
Position to add the control on the map. |
Adds a menu item with a checkbox for controlling the visibility of a layer on the map.
Kind: global function
Param | Type | Description |
---|---|---|
name | string |
The name of the layer corresponding to the menu item. |
Adds a layer tree to the map.
Kind: global function
Param | Type | Description |
---|---|---|
options | Object |
Options for the layer tree to add. |
options.features | Object |
Features for the layer tree. |
options.id | string |
Unique identifier for the layer tree. |
options.type | string |
Type of layer tree ('geojson', 'raster', etc.). |
Creates a navigation control with the provided options.
Kind: global function
Returns: Object
- - Instance of the created navigation control.
Param | Type | Default | Description |
---|---|---|---|
options | Object |
Options for the navigation control. | |
[position] | string |
"'top-right'" |
Position to add the control on the map. |
Adds a navigation control to the map with the provided options.
Kind: global function
Param | Type | Default | Description |
---|---|---|---|
options | Object |
Options for the navigation control. | |
[position] | string |
"'top-right'" |
Position to add the control on the map. |
Adds an attribution control to the map with the provided options.
Kind: global function
Param | Type | Default | Description |
---|---|---|---|
options | Object |
Options for the attribution control. | |
[position] | string |
"'bottom-right'" |
Position to add the control on the map. |
Adds an ICGC image layer to the map based on the specified name and year.
Kind: global function
Param | Type | Description |
---|---|---|
url | string |
The url of the layer. |
idLayer | string |
The user id for the layer. |
options | object |
Type, position,layout and paint options for the layer |
Adds an ICGC vector layer to the map based on the specified name and year.
Kind: global function
Param | Type | Description |
---|---|---|
url | string |
The url of the vector layer. |
idLayer | string |
The user id for the vector layer. |
options | object |
Type, position,layout and paint options for the layer |
Adds an ICGC FGB layer to the map based on the specified name and year.
Kind: global function
Param | Type | Description |
---|---|---|
url | string |
The url of the FGB layer. |
idLayer | string |
Id for the layer. |
options | object |
Paint option for the layer |
Adds 3D terrain to the map using hillshade.
Kind: global function
Param | Type | Description |
---|---|---|
url | string |
dataset url of the terrain |
controlPosition | string |
Position to add the control on the map. |
Add image legend.
Kind: global function
Param | Type | Description |
---|---|---|
url | string |
image legend url. |
idLayer | string |
layer's name. |
Finds the type of image based on the provided URL and specified vectors.
Kind: global function
Returns: string
| null
- - The type of image if found, otherwise null.
Param | Type | Description |
---|---|---|
url | string |
The URL of the image to find the type for. |
var1 | Object |
The first vector object containing key-value pairs. |
var2 | Object |
The second vector object containing key-value pairs. |
var3 | Object |
The third vector object containing key-value pairs. |
var4 | Object |
The fourth vector object containing key-value pairs. |
Gets the key by URL from the FGBAdmin layers.
Kind: global function
Returns: string
| null
- - The key if found, otherwise null.
Param | Type | Description |
---|---|---|
url | string |
The URL to find the key for in the FGBAdmin layers. |
Gets the legend by name from the default vector layers.
Kind: global function
Returns: string
| null
- - The legend if found, otherwise null.
Param | Type | Description |
---|---|---|
name | string |
The name of the vector layer to get the legend for. |
Gets the key by URL from the Vector layers.
Kind: global function
Returns: string
| null
- - The key if found, otherwise null.
Param | Type | Description |
---|---|---|
url | string |
The URL to find the key for in the Vector layers. |
Raises text 3D style on the map.
Kind: global function
Returns: Promise.<void>
- - A promise that resolves after updating the text 3D style on the map.
Deals with map styles based on the name.
Kind: global function
Returns: Object
| string
| null
- - The map style object if found, or the input name if not found, or null if an error occurs.
Param | Type | Description |
---|---|---|
name | string |
The name of the map style. |
Deals with the 3D ortho style based on the name.
Kind: global function
Returns: void
| null
- - Returns null if an error occurs.
Param | Type | Description |
---|---|---|
name | string |
The name of the orto3D style. |
Deals with the order of the layer.
Kind: global function
Returns: string
- - The id of the first symbol layer if the order is 'symbol', the id of the first line layer if the order is 'line', otherwise an empty string.
Param | Type | Description |
---|---|---|
order | string |
The order of the layer. |
Retrieves the id of the first symbol layer.
Kind: global function
Returns: string
| undefined
- - The id of the first symbol layer if found, otherwise undefined.
Retrieves the id of the first line layer.
Kind: global function
Returns: string
| undefined
- - The id of the first line layer if found, otherwise undefined.
Creates a Mapbox layer for displaying cities in 3D.
Kind: global function
Returns: MapboxLayer
| null
- - The Mapbox layer for displaying cities in 3D if created successfully, otherwise null.