Functions
-
addGeocoderICGC() ⇒
Object
-
Add geocoder.
-
getStyle() ⇒
Object
-
Retrieves the current style of the map.
-
loadImage(urlImage) ⇒
image
-
Load image to layer symbol as icon-image.
-
addImage(imageName, imageData) ⇒
image
-
Add image to mapstyle.
-
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, name, options)
-
Fetches GeoJSON data from a URL and adds a corresponding layer to the map based on the specified geometry type.
- fetchDataAndMenu(url, name, featureTree, 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.
- getSource(source)
-
Retrieves the specified source from the map.
- addSource(source, options)
-
Adds a source to the map.
- setStyle(style, [options])
-
Sets the style of the map.
- getLayer(layerId)
-
Retrieves the layer with the specified ID from the map.
- setFilter(layerId, filter, options)
-
Set filter for specified style layer.
- jumpTo(options)
-
Jumps to the specified coordinates and zoom on the map.
- setLayoutProperty(object, property, value)
-
Sets layout property for a layer on the map.
- setPaintProperty(object, property, value)
-
Sets layout property for a layer on the map.
- addControl(control, [position])
-
Adds a control to the map with the specified position.
-
getZoom() ⇒
number
-
Retrieves the current zoom level 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.
- getBounds()
-
Retrieves the bounds of the map.
-
getCenter() ⇒
LngLat
-
Retrieves the center coordinates of the map.
-
setTerrain(options) ⇒
Object
-
Sets terrain options for the map.
- setLayerZoomRange(layerId, minZoom, maxZoom)
-
Sets the zoom range for a specific layer on the map.
- getCanvas()
-
Retrieves the canvas of the map.
- setCenter(coordinates)
-
Sets the center of the map to the provided coordinates.
- addLayer(layer, layerIdOrder)
-
Adds a layer to the map.
- addLayerGeoJSON(layer, position)
-
Adds a GeoJSON layer to the map.
- addLayerWMS(layer, position, exportOptions)
-
Adds a WMS layer to the map.
- removeControl(control)
-
Removes a control from the map.
- removeLayer(layerId)
-
Removes a layer from the map.
- removeSource(layerId)
-
Removes a source from the map.
- addLogo(options, position)
-
Adds a logo to the map.
- addBasemapsICGC(basesArray)
-
Adds base layers to the map.
- addBasemaps(baseLayers)
-
Adds base layers to the map.
- addFeatureQuery(layerName, options, 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.
- addPopup(coordinates, text)
-
Adds a popup to the map.
-
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.
-
_dealStyleMaps(name) ⇒
string
-
Internal method to handle map styles.
- addImageLayerICGC(name)
-
Adds an ICGC image layer to the map based on the specified name and year.
- addVectorLayerICGC(idLayer, layerUrl, options)
-
Adds an ICGC vector layer to the map based on the specified name and year.
- addFGBLayerICGC(url, visibleLabel, paintOption)
-
Adds an ICGC FGB layer to the map based on the specified name and year.
- addTerrainICGC(resolution, [positionButton])
-
Adds 3D terrain to the map using hillshade.
- addLegend(name)
-
Adds 3D terrain to the map using hillshade.
LngLatBounds
LngLatBounds
new LngLatBounds([sw], [ne])
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. |
addGeocoderICGC([ΓçÆposition]) →Object
Add geocoder.
getStyle() ⇒ Object
Retrieves the current style of the map.
Kind: global function
Returns: Object
- - The current style of the map.
loadImage(urlImage) ⇒ image
Load image to layer symbol as icon-image.
Kind: global function
Returns: image
- - The image.
Param | Type | Description |
---|---|---|
urlImage | string | The url image png or jpep. |
Param | Type | Default | Description |
---|---|---|---|
[position] | string | "'top-right'" | Position to add the control on the map. |
addImage(imageName, imageData) ⇒ image
Add image to mapstyle.
Kind: global function
Returns: image
- - The image.
Param | Type | Description |
---|---|---|
imageName | string | The url image png or jpep. |
imageData | image | The image.data from return of loadImage function. |
getConfigStyles() →ΓçÆ Array
Retrieves the available base styles from default options.
Kind: global function
Returns: Array
- - Array containing the names of available base styles.
getConfigWMSLayers() →ΓçÆ Array
Retrieves the available WMS image layers from default options.
Kind: global function
Returns: Array
- - Array containing the keys of available WMS image layers.
getConfigOrtoLayers() →ΓçÆ Array
Retrieves the available orto image layers from default options.
Kind: global function
Returns: Array
- - Array containing the keys of available image layers.
getConfigVectorLayers() →ΓçÆ Array
Retrieves the available vector layers from default options.
Kind: global function
Returns: Array
- - Array containing the keys of available vector layers.
getConfigVectorAdminLayers() →ΓçÆ Array
Retrieves the available vector layers from default options.
Kind: global function
Returns: Array
- - Array containing the keys of available vectorAdmin layers.
getConfigFGBAdminLayers() →ΓçÆ Array
Retrieves the available fgb layers from default options.
Kind: global function
Returns: Array
- - Array containing the keys of available fgbadmin layers.
fetchData(url, nameidLayer, options)
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. |
name | string | The geometry name (e.g., 'buildings'). |
options | Object | Additional options for configuring the layer. |
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. |
fetchDataAndMenu(url, nameidLayer, featureTreefilterField, 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.
Kind: global function
Param | Type | Description |
---|---|---|
url | string | The URL to fetch GeoJSON data from. |
name | string | The geometry name (e.g., 'buildings'). |
featureTree | string | Import all features as unique or group based on a field ('all', 'field'). |
options | Object | Additional options for configuring the layer. |
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. |
Kind: global function
getSource(source)
Retrieves the specified source from the map.
Kind: global function
Param | Type | Description |
---|---|---|
source | string | The ID of the source to retrieve. |
addSourcesetStyle(sourcestyle, [options])
Adds a source to the map.
Kind: global function
Param | Type | Description |
---|---|---|
source | string | The ID of the source to add. |
options | object | The source options. |
setStyle(style, [options])
Sets the style of the map.
Kind: global function
getLayer(layerId)
Retrieves the layer with the specified ID from the map.
Kind: global function
Param | Type | Description |
---|---|---|
layerId | string | The ID of the layer to retrieve. |
setFilter(layerId, filter, options)
Set filter for specified style layer.
Kind: global function
Param | Type | Description |
---|---|---|
layerId | string | The ID of the layer to retrieve. |
filter | array | The filter. |
options | string | Options object. |
jumpTo(options)
Jumps to the specified coordinates and zoom on the map.
Kind: global function
Param | Type | Description |
---|---|---|
options | Object | Coordinates and options to jump to: { center: [coordx, coordy], zoom: zoom, essential: true }. |
setLayoutProperty(object, property, value)
Sets layout property for a layer on the map.
Kind: global function
Param | Type | Description |
---|---|---|
object | Object | Object containing layer ID. |
property | Object | Object containing property to set. |
value | Object | Object containing value. |
setPaintProperty(object, property, value)
Sets layout property for a layer on the map.
Kind: global function
Param | Type | Description |
---|---|---|
object | Object | Object containing layer ID. |
property | Object | Object containing property to set. |
value | Object | Object containing value. |
addControl(control, [position])
Adds a control to the map with the specified position.
Kind: global function
getZoom() ⇒ number
Retrieves the current zoom level of the map.
Kind: global function
Returns: number
- - The current zoom level.
addMouseCoordControl([position])
Adds a mouse coordinate control to the map.
Kind: global function
getBounds()
addLayer(layer, layerIdOrder)
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. |
addImage(id, image, options) →this
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. |
addSource(id, source) →this
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. |
addSprite(id, url, options) →this
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. |
areTilesLoaded() →boolean
Checks if all tiles in the viewport are loaded.
cameraForBounds(bounds, options) →CenterZoomBearing
| undefined
Calculates the camera position for given bounds.
Kind: global function
Param | Type | Description |
---|---|---|
bounds | LngLatBoundsLike | The geographical bounds to fit. |
options | CameraForBoundsOptions | Options object. |
easeTo(options, eventData) →this
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. |
fitBounds(bounds, options, eventData) →this
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. |
fitScreenCoordinates(p0, p1, bearing, options, eventData) →this
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. |
flyTo(options, eventData) →this
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. |
getBearing() →number
Retrieves the boundsGets 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
Retrieves the center coordinates of the map.
Returns the map's geographical centerpoint.
Kind: global function
Returns: LngLat
- - The center coordinates of the map. The map's geographical centerpoint.
setTerrain(options) ⇒ Object
getContainer() →HTMLElement
Returns the map's containing HTML element.
Kind: global function
Returns: HTMLElement
- The map's container.
getFeatureState(feature) →any
Gets the state of a feature.
Kind: global function
Returns: any
- The state of the feature.
Param | Type | Description |
---|---|---|
feature | FeatureIdentifier | Feature identifier. |
getFilter(layerId) →void
| FilterSpecification
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. |
getGlyphs() →string
Returns the value of the style's glyphs URL.
Kind: global function
Returns: string
- The glyphs Style's glyphs URL.
getImage(id) →StyleImage
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. |
getLayer(id) →StyleLayer
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. |
getLayersOrder() →Array.<string>
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.
getLayoutProperty(layerId, name) →any
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. |
getLight() →LightSpecification
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.
getMaxPitch() →number
Returns the map's maximum allowable pitch.
Kind: global function
Returns: number
- The maxPitch.
getMaxZoom() →number
Returns the map's maximum allowable zoom level.
Kind: global function
Returns: number
- The maxZoom.
getMinPitch() →number
Returns the map's minimum allowable pitch.
Kind: global function
Returns: number
- The minPitch.
getMinZoom() →number
Returns the map's minimum allowable zoom level.
Kind: global function
Returns: number
- The minZoom.
getPadding() →PaddingOptions
Returns the current padding applied around the map viewport.
Kind: global function
Returns: PaddingOptions
- The current padding around the map viewport.
getPaintProperty(layerId, name) →unknown
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. |
getPitch() →number
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.
getPixelRatio() →number
Returns the map's pixel ratio.
Kind: global function
Returns: number
- The pixel ratio.
getRenderWorldCopies() →boolean
Returns the state of renderWorldCopies.
Kind: global function
Returns: boolean
- The renderWorldCopies.
getSource(id) →Source
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. |
getSprite() →Array.<object>
Returns the as-is value of the style's sprite.
Kind: global function
Returns: Array.<object>
- Style's sprite list of id-url pairs.
getStyle() →StyleSpecification
Returns the map's MapLibre style object.
Kind: global function
Returns: StyleSpecification
- The map's style JSON object.
getTerrain() →TerrainSpecification
Sets terrain options for the mapGet the terrain-options if terrain is loaded.
Kind: global function
Returns: TerrainSpecification
- The TerrainSpecification passed to setTerrain.
getZoom() →number
Returns the map's current zoom level.
Kind: global function
Returns: Object
- - Result of setting the terrain options.number
- The map's current zoom level.
Param | Type | Description |
---|---|---|
options | Object | Options for the terrain. |
hasControl(control) →boolean
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. |
setLayerZoomRange(layerId, minZoom, maxZoom)
Sets the zoom range for a specific layer on the map.
hasImage(id) →boolean
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. |
isMoving() →boolean
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.
isRotating() →boolean
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.
isSourceLoaded(id) →boolean
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. |
isStyleLoaded() →boolean
| void
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.
isZooming() →boolean
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.
jumpTo(options, [eventData]) →this
Changes any combination of center, zoom, bearing, and pitch, without an animated transition.
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. |
maxZoom | number | The maximum zoom level. |
Param | Type | Description |
---|---|---|
options | JumpToOptions | Options object |
[eventData] | any | Additional properties to be added to event objects of events triggered by this method. |
getCanvas()
Retrieves the canvas of the map.
listImages() →Array.<string>
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.
listens(type) →boolean
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. |
loadImage(url) →Promise.<GetResourceResponse.<(ImageBitmap|HTMLImageElement)>>
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. |
loaded() →boolean
Returns a Boolean indicating whether the map is fully loaded.
Kind: global function
Returns: boolean
- 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.
setCenter(coordinates)
Sets the center of the map to the provided coordinates.
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. |
moveLayer(id, [beforeId]) →this
Moves a layer to a different z-position.
Kind: global function
Param | Type | Description |
---|---|---|
coordinates | Array | Coordinates to center the map: [1.3119, 41.489] |
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. |
addLayer(layer, layerIdOrder)
Adds a layer to the map.
panBy(offset, [options], [eventData]) →this
Pans the map by the specified offset.
Kind: global function
Param | Type | Description |
---|---|---|
layer | Object | Options for the layer to add. |
layerIdOrder | string | Optional layer Id draw position. |
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. |
addLayerGeoJSON(layer, position)
Adds a GeoJSON layer to the map.
panTo(lnglat, [options], [eventData]) →this
Pans the map to the specified location with an animated transition.
Kind: global function
Param | Type | Description |
---|---|---|
layer | Object | Options for the GeoJSON layer to add. |
layer.id | string | Unique identifier for the layer. |
layer.type | string | Type of layer ('geojson'). |
layer.data | Object | GeoJSON data for the layer. |
layer.layerType | string | Map layer type (e.g., 'symbol', 'circle', 'fill'). |
layer.layout | Object | Layer layout configuration. |
layer.paint | Object | Layer paint configuration. |
position | string | Position of the layer: 'top', below 'labels' or below 'lines'. |
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. |
addLayerWMS(layer, position, exportOptions)
Adds a WMS layer to the map.
project(lnglat) →Point
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. |
queryRenderedFeatures([geometryOrOptions], [options]) →Array
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. |
querySourceFeatures(sourceId, parameters) →Array
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. |
queryTerrainElevation(lngLatLike) →number
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. |
redraw() →this
Redraws the map.
Param | Type | Description |
---|---|---|
layer | Object | Options for the WMS layer to add. |
layer.id | string | Unique identifier for the layer. |
layer.type | string | Type of layer ('raster'). |
layer.tiles | Array.<string> | Tiles for the raster layer. |
position | string | Position of the layer: 'top', below 'labels' or below 'lines'. |
exportOptions | Object | Options of the layer: type, layout, paint. |
remove() →this
Removes the map from the DOM.
removeControl(control) →this
Removes a control from the map.
Kind: global function
removeFeatureState(target, [key]) →this
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. |
removeImage(id) →this
Removes an image from the style's sprite.
Kind: global function
Param | Type | Description |
---|---|---|
id | string | The ID of the image to remove. |
removeLayer(layerIdidLayer)
Removes a layer from the map.
Kind: global function
Param | Type | Description |
---|---|---|
layerId | string | Identifier of the layer to remove. |
Param | Type | Description |
---|---|---|
idLayer | string | Identifier of the layer to remove. |
removeSource(layerIdidLayer)
Removes a source from the map.
Kind: global function
Param | Type | Description |
---|---|---|
layerId | string | Identifier of the source to remove. |
Param | Type | Description |
---|---|---|
idLayer | string | Identifier of the source to remove. |
removeSprite(id) →this
Removes a sprite from the style.
Kind: global function
Param | Type | Description |
---|---|---|
id | string | The ID of the sprite to remove. |
resetNorth([options], [eventData]) →this
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. |
resetNorthPitch([options], [eventData]) →this
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. |
resize([eventData]) →this
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. |
rotateTo(bearing, [options], [eventData]) →this
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. |
setBearing(bearing, [eventData]) →this
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. |
setCenter(center, [eventData]) →this
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. |
setEventedParent([parent], [data]) →this
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. |
setFeatureState(feature, state) →this
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. |
setFilter(layerId, [filter], [options]) →this
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. |
setGlyphs(glyphsUrl, [options]) →this
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. |
setLayerZoomRange(layerId, minzoom, maxzoom) →this
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. |
setLayoutProperty(layerId, name, value, [options]) →this
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. |
setLight(light, [options]) →this
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. |
setMaxBounds(bounds) →this
Sets the maximum bounds for the map.
Kind: global function
Param | Type | Description |
---|---|---|
bounds | Array | The maximum bounds for the map. |
setMaxPitch(maxPitch) →this
Sets the maximum pitch for the map.
Kind: global function
Param | Type | Description |
---|---|---|
maxPitch | number | The maximum pitch (in degrees) for the map. |
setMaxZoom(maxZoom) →this
Sets the maximum zoom level for the map.
Kind: global function
Param | Type | Description |
---|---|---|
maxZoom | number | The maximum zoom level for the map. |
setMinPitch(minPitch) →this
Sets the minimum pitch for the map.
Kind: global function
Param | Type | Description |
---|---|---|
minPitch | number | The minimum pitch (in degrees) for the map. |
setMinZoom(minZoom) →this
Sets the minimum zoom level for the map.
Kind: global function
Param | Type | Description |
---|---|---|
minZoom | number | The minimum zoom level for the map. |
setPadding(padding, [eventData]) →this
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. |
setPaintProperty(layerId, name, value, [options]) →this
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. |
setPitch(pitch, [eventData]) →this
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. |
setPixelRatio(pixelRatio) →this
Sets the pixel ratio for the map.
Kind: global function
Param | Type | Description |
---|---|---|
pixelRatio | number | The desired 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.
Kind: global function
Param | Type | Description |
---|---|---|
renderWorldCopies | boolean | A boolean indicating whether to render world copies. |
setSprite(spriteUrl, [options]) →this
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. |
setTerrain(options) →this
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. |
setTransformRequest(transformRequest) →this
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. |
setZoom(zoom, [eventData]) →this
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. |
snapToNorth([options], [eventData]) →this
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. |
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.
Kind: global function
Returns: LngLat
- The geographical coordinates corresponding to the specified pixel coordinates.
Param | Type | Description |
---|---|---|
point | PointLike | The pixel coordinates to unproject. |
updateImage(id, image) →this
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. |
zoomIn([options], [eventData]) →this
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. |
zoomOut([options], [eventData]) →this
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. |
zoomTo(zoom, [options], [eventData]) →this
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. |
addLayerGeoJSON(layer, layerPosition)
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'. |
addLayerWMS(tiles, idLayer, options)
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. |
addLogo(options)position)
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. |
position | string | Position of the logo. |
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. |
addFeatureQuery(layerNameidLayer, optionsqueryFields, popupStyle)
Adds feature query function to a layer.
Kind: global function
Param | Type | Description |
---|---|---|
layerName | string | name of the layer |
options | objetc | optional indications for the popup |
popupStyle | objetc | optional indications for the popup style |
Param | Type | Description |
---|---|---|
idLayer | string | name of the layer |
queryFields | objetc | optional indications for the popup |
popupStyle | objetc | optional indications for the popup style |
Kind: global function
addPopup(coordinates, text)
Adds a popup to the map.
Kind: global function
Param | Type | Description |
---|---|---|
coordinates | array | Coordinates of the popup . |
text | string | Text content for the popup. |
addMarker(options) →ΓçÆ Object
Adds a marker to the map.
addPopup(options, coord, text, popupStyle) →ΓçÆ Object
Adds a popup to the map.
createNavigationControl(options, [position]) →ΓçÆ Object
Creates a navigation control with the provided options.
Kind: global function
_dealStyleMaps(name) ⇒ string
Internal method to handle map styles.
Kind: global function
Returns: string
- - URL of the map style.
Param | Type | Description |
---|---|---|
name | string | Name of the map style. |
addImageLayerICGC(nameurl, idLayer, options)
Adds an ICGC image layer to the map based on the specified name and year.
Kind: global function
Param | Type | Description |
---|---|---|
name | string | The url of the layer. |
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 |
addVectorLayerICGC(url, idLayer, layerUrl, options)
Adds an ICGC vector layer to the map based on the specified name and year.
Kind: global function
Param | Type | Description |
---|---|---|
idLayer | string | The user id for the vector layer. |
layerUrl | string | The url of the vector layer. |
options | object | Type, position,layout and paint options for the layer |
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 |
addFGBLayerICGC(url, visibleLabelidLayer, paintOptionoptions)
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. |
visibleLabel | string | Visibility of the label ("visible" / "none"). |
paintOption | object | Paint option for the layer |
Param | Type | Description |
---|---|---|
url | string | The url of the FGB layer. |
idLayer | string | Id for the layer. |
options | object | Paint option for the layer |
addTerrainICGC(resolutionurl, positionButtoncontrolPosition)
Adds 3D terrain to the map using hillshade.
Kind: global function
Param | Type | Default | Description |
---|---|---|---|
resolution | string | resolution of the terrain data: 2m or 5m. | |
[positionButton] | string | "'top-right'" | Position to add the button on the map. |
Param | Type | Description |
---|---|---|
url | string | dataset url of the terrain |
controlPosition | string | Position to add the control on the map. |
addLegend(nameurl, idLayer)
Adds 3D terrain to the map using hillshade.
Add image legend.
Kind: global function
Param | Type | Description |
---|---|---|
name | string | name of the layer legend to add. |
Param | Type | Description |
---|---|---|
url | string | image legend url. |
idLayer | string | layer's name. |
_findImageType(url, var1, var2, var3, var4) →string
| null
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. |
_getKeyByUrlFGB(url) →string
| null
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. |
_getLegendByName(name) →string
| null
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. |
_getKeyByUrlVector(url) →string
| null
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. |
_raiseText3DStyle() →Promise.<void>
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.
_dealStyleMaps(name) →Object
| string
| null
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. |
_dealOrto3dStyle(name) →void
| null
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. |
_dealOrderLayer(order) →string
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. |
_firstSymbolLayer() →string
| undefined
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.
_firstLineLayer() →string
| 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.
_createCitiesMapboxLayer() →MapboxLayer
| null
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.