@2gis/mapgl
Advanced tools
Comparing version 1.50.1 to 1.51.0
{ | ||
"name": "@2gis/mapgl", | ||
"version": "1.50.1", | ||
"version": "1.51.0", | ||
"description": "MapGL API script loader with typings", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -7,2 +7,3 @@ export declare const MAPGL_SCRIPT_URL: string; | ||
export declare const defaultMapGLTileServer: string; | ||
export declare const defaultTileGenUrl: string; | ||
/** | ||
@@ -9,0 +10,0 @@ * Боевой url до BSS-приемника. |
@@ -26,4 +26,5 @@ import { Map } from './map'; | ||
export { isSupported, notSupportedReason } from './isSuported'; | ||
export { ZenithSource } from './sources/zenithSource'; | ||
import './callback'; | ||
import './plugins'; | ||
export declare const API_VERSION: string | undefined; |
@@ -1,1 +0,62 @@ | ||
export {}; | ||
import { Map } from '../map'; | ||
import { SourceAttributes, ZenithSourceOptions, FeatureStateMap } from '../types'; | ||
/** | ||
* Class representing Zenith data source. | ||
*/ | ||
export declare class ZenithSource { | ||
private options; | ||
static tileTemplateUrl: string; | ||
static metatileTemplateUrl: string; | ||
/** | ||
* Example: | ||
* ```js | ||
* const customZenithSource = new mapgl._J.ZenithSource(map, { | ||
* tileTemplateUrl: `${mapgl._J.ZenithSource.tileTemplateUrl}&user_layer_id=${id}` | ||
* metatileTemplateUrl: `mapgl._J.ZenithSource.metatileTemplateUrl` | ||
* appId: map.state.appId, | ||
* tileServer: map.state.tileServer, | ||
* tileSet: map.state.tileSet, | ||
* tileProtocol: map.state.tileProtocol, | ||
* tileKey: map.state.tileKey, | ||
* subdomains: map.state.subdomains, | ||
* sourceAttributes: { | ||
* sourceName: 'zenith-custom-source', | ||
* } | ||
* }); | ||
* | ||
* map.setStyle({ | ||
* // ... | ||
* layers: [ | ||
* // ... | ||
* filter: [ | ||
* 'all', | ||
* ['match', ['sourceAttr', 'sourceName'], ['zenith-custom-source'], true, false] | ||
* // ... | ||
* ] | ||
* ] | ||
* }) | ||
* ``` | ||
* @param map The map instance | ||
* @param options Zenith source options | ||
*/ | ||
constructor(map: Map, options: ZenithSourceOptions); | ||
/** | ||
* Destroys the source | ||
*/ | ||
destroy(): void; | ||
/** | ||
* Sets the source attributes | ||
*/ | ||
setAttributes(attributes: SourceAttributes): this; | ||
/** | ||
* Gets the source attributes | ||
*/ | ||
getAttributes(): SourceAttributes; | ||
/** | ||
* Sets the feature state map to the source. | ||
* | ||
* @see {@link DefaultSource#setFeatureStateMap} | ||
*/ | ||
setFeatureStateMap(featureStateMap: FeatureStateMap): void; | ||
private prepareOptions; | ||
} |
@@ -143,2 +143,6 @@ import { Style } from './styles'; | ||
/** | ||
* Emitted after the map style fails to load. | ||
*/ | ||
styleloaderror: StyleLoadErrorEvent; | ||
/** | ||
* Emitted after the map language is changed. | ||
@@ -369,2 +373,11 @@ */ | ||
/** | ||
* Contains currently loaded error style response | ||
*/ | ||
export interface StyleLoadErrorEvent { | ||
/** | ||
* ID or URL. Depends on the way the style was set. | ||
*/ | ||
style: string; | ||
} | ||
/** | ||
* Contains current map language | ||
@@ -371,0 +384,0 @@ */ |
@@ -577,2 +577,8 @@ import { LngLatBounds } from '../objects/lngLatBounds'; | ||
/** | ||
* Defines the polyline rendering mode. Use: | ||
* - '3d' to use the depth buffer. | ||
* - '2d' to add a layer with no depth. | ||
*/ | ||
export type PolylineRenderingMode = '2d' | '3d'; | ||
/** | ||
* Polyline initialization options. | ||
@@ -668,2 +674,16 @@ */ | ||
userData?: any; | ||
/** | ||
* Rendering mode. '2d' is default. | ||
*/ | ||
renderingMode?: PolylineRenderingMode; | ||
/** | ||
* The color of a line section that is hidden by other objects in '3d' rendering mode | ||
* in RGB hexadecimal (`#ff0000`) or RGBA (`#ff0000ff`) format. | ||
*/ | ||
hiddenPartColor?: string; | ||
/** | ||
* The gap color of a line section that is hidden by other objects in '3d' rendering mode | ||
* in RGB hexadecimal (`#ff0000`) or RGBA (`#ff0000ff`) format. | ||
*/ | ||
hiddenPartGapColor?: string; | ||
} | ||
@@ -883,2 +903,43 @@ /** | ||
/** | ||
* Zenith data source initialization options | ||
*/ | ||
export interface ZenithSourceOptions { | ||
/** | ||
* ID of the layer stored on the Tile Server used to fetch tiles and other resources. | ||
* "layerId" overrides the tileTemplateUrl and the metatileTemplateUrl options if they are provided, | ||
*/ | ||
layerId?: string; | ||
/** | ||
* URL template used to fetch tiles. | ||
* If it is provided alongside the "layerId" option, "layerId" is not used. | ||
*/ | ||
tileTemplateUrl?: string; | ||
/** | ||
* URL template used to fetch meta-tiles. | ||
* If it is provided alongside the "layerId" option, "layerId" is not used. | ||
*/ | ||
metatileTemplateUrl?: string; | ||
/** | ||
* Data source attributes. | ||
*/ | ||
sourceAttributes?: SourceAttributes; | ||
/** | ||
* Attributes provided to the data source by every object | ||
*/ | ||
promoteAttributes?: string[]; | ||
/** | ||
* Name of the object attribute to use as id. | ||
*/ | ||
promoteId?: string; | ||
/** | ||
* Put IDs of source features to separate ID-scope. | ||
* If idScope isn't specified, all IDs will be added into the "default" ID-scope. | ||
* Objects that have the same ID inside ID-scope will be processed by map as one object. | ||
* For example, these objects will be selected simultaneously. | ||
* | ||
* Scope of the identifiers is used for objects selection, see method map.setSelectedObjects. | ||
*/ | ||
idScope?: string; | ||
} | ||
/** | ||
* GeoJson data source initialization options. | ||
@@ -885,0 +946,0 @@ */ |
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
94309
2954