@2gis/mapgl
Advanced tools
Comparing version 1.17.0 to 1.18.0
{ | ||
"name": "@2gis/mapgl", | ||
"version": "1.17.0", | ||
"version": "1.18.0", | ||
"description": "MapGL API script loader with typings", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -6,2 +6,3 @@ import { MapOptions, FitBoundsOptions, Padding } from './types'; | ||
import { LngLatBounds, LngLatBoundsClass } from './objects/lngLatBounds'; | ||
import { Layer } from './types/styles'; | ||
/** | ||
@@ -158,6 +159,7 @@ * The main class for map initialization. | ||
/** | ||
* Upload styles object by its id and apply it to the map | ||
* @param styleId uuid of the style | ||
* Upload styles object by its id and apply it to the map. | ||
* Returns a promise that contains param styleId. | ||
* @param styleId uuid of the style. | ||
*/ | ||
setStyleById(styleId: string): Promise<this>; | ||
setStyleById(styleId: string): Promise<string>; | ||
/** | ||
@@ -195,2 +197,20 @@ * Sets the desired map language. | ||
/** | ||
* Add a style layer to the current map style. | ||
* @param layer Style layer object. | ||
* @param beforeId The identifier of an existing layer to insert the new layer before, resulting in the new layer appearing visually beneath the existing layer. If this argument is not specified, the layer will be appended to the end of the layers array and appear visually above all other layers. | ||
* | ||
* Throws an error if: | ||
* - the layer with specified id already exists in the current map style; | ||
* - the layer with specified beforeId doesn't exist in the current map style; | ||
* - one group layer is inserted into another group layer. | ||
*/ | ||
addLayer(layer: Layer, beforeId?: string): this; | ||
/** | ||
* Removes the layer with the given identifier from the current map style. | ||
* @param layerId The identifier of the layer to remove. | ||
* | ||
* Throws an error if layer with specified id does not exist in the current map style. | ||
*/ | ||
removeLayer(layerId: string): this; | ||
/** | ||
* Pans and zooms the map to contain its visible area within the specified geographical bounds. | ||
@@ -197,0 +217,0 @@ * This method also resets the map pitch and rotation to 0. |
@@ -0,1 +1,2 @@ | ||
import { Style } from './styles'; | ||
/** | ||
@@ -130,2 +131,6 @@ * The list of events that can be emitted by the map. | ||
floorlevelchange: FloorLevelChangeEvent; | ||
/** | ||
* Emitted after the style load on the map. | ||
*/ | ||
styleload: StyleLoadEvent; | ||
} | ||
@@ -269,1 +274,10 @@ /** | ||
} | ||
/** | ||
* Contains currently loaded style response | ||
*/ | ||
export interface StyleLoadEvent { | ||
/** | ||
* Style object, ID or URL. Depends on the way the style was set. | ||
*/ | ||
style: string | Style; | ||
} |
@@ -17,2 +17,3 @@ export declare type InterpolateExpression<T extends number | string> = [ | ||
export declare type Layer = any; | ||
export declare type Style = any; | ||
export declare type StyleOrigin = { | ||
@@ -19,0 +20,0 @@ type: 'styleserver'; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
61634
1950