@2gis/mapgl
Advanced tools
+1
-1
| { | ||
| "name": "@2gis/mapgl", | ||
| "version": "1.72.0", | ||
| "version": "1.72.3", | ||
| "description": "MapGL API script loader with typings", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
+1
-1
@@ -23,3 +23,3 @@ import { Map } from './map'; | ||
| export { type LngLatBounds, LngLatBoundsClass } from './objects/lngLatBounds'; | ||
| export type { StyleIconConfig, StyleOptions } from './types/styles'; | ||
| export type { StyleIconConfig, StyleSimpleIconConfig, StyleStretchableIconConfig, StyleOptions, } from './types/styles'; | ||
| export type { AnimationOptions, RotationAnimationOptions, Easing } from './types/animations'; | ||
@@ -26,0 +26,0 @@ export type { GltfModelOptions, GltfModelTransformationOptions, CircleMarkerOptions, CircleOptions, ArrowOptions, ControlOptions, ControlPosition, FitBoundsOptions, GeoJsonSourceOptions, GeoJsonViewportSourceOptions, HtmlMarkerOptions, LabelImage, LabelOptions, MapOptions, MapSupportOptions, MarkerIconOptions, MarkerLabelOptions, MarkerOptions, Padding, PolygonOptions, PolylineOptions, RasterTileSourceOptions, SourceAttributes, RasterOptions, RasterSource, FeatureState, FeatureStateMap, } from './types'; |
+5
-0
@@ -290,2 +290,7 @@ import type { MapOptions, FitBoundsOptions, Padding, StyleState, SupportedSimpleOpts, WebGLContext, GraphicsPreset } from './types'; | ||
| /** | ||
| * Returns the URL of the icon with the given name. | ||
| * @param iconName The name of the icon. | ||
| */ | ||
| getIconUrl(iconName: string): string | undefined; | ||
| /** | ||
| * Sets options that affect the map style. | ||
@@ -292,0 +297,0 @@ * @param options The style options. |
@@ -33,3 +33,3 @@ import type { Map } from '../map'; | ||
| * 'all', | ||
| * ['match', ['sourceAttr', 'sourceName'], ['zenith-custom-source'], true, false] | ||
| * ['match', ['source-attr', 'sourceName'], ['zenith-custom-source'], true, false] | ||
| * // ... | ||
@@ -36,0 +36,0 @@ * ] |
@@ -219,2 +219,27 @@ import type { Style } from './styles'; | ||
| /** | ||
| * The PoiIconData event type for map events. | ||
| */ | ||
| export interface PoiIconData { | ||
| /** | ||
| * Base URL of the icon. | ||
| */ | ||
| baseUrl?: string; | ||
| /** Full URL of the icon. */ | ||
| fullUrl?: string; | ||
| /** | ||
| * Full URL of the unhovered icon. | ||
| */ | ||
| fullUrlUnhovered?: string; | ||
| /** Icon width. */ | ||
| width: number; | ||
| /** Icon height. */ | ||
| height: number; | ||
| /** Icon name. */ | ||
| name?: string; | ||
| /** | ||
| * Icon name of the unhovered icon. | ||
| */ | ||
| nameUnhovered?: string; | ||
| } | ||
| /** | ||
| * The basic event type for pointer-related events. | ||
@@ -308,2 +333,6 @@ */ | ||
| layerId?: string; | ||
| /** | ||
| * POI icon data. It's specified when the target object is a POI with an icon. | ||
| */ | ||
| poiIcon?: PoiIconData; | ||
| } | ||
@@ -310,0 +339,0 @@ /** |
@@ -14,8 +14,9 @@ /** | ||
| ]; | ||
| export type TypeExpressionName = 'to-boolean' | 'to-color' | 'literal'; | ||
| export type ExtractorExpressionName = 'get' | 'sourceAttr' | 'featureState' | 'global'; | ||
| export type TypeExpressionName = 'to-boolean' | 'to-color' | 'literal' | 'toBoolean' | 'toColor'; | ||
| export type ExtractorExpressionName = 'get' | 'source-attr' | 'feature-state' | 'global' | 'sourceAttr' | 'featureState'; | ||
| export type LogicalExpressionName = '!' | '==' | '!=' | '>' | '>=' | '<' | '<=' | 'match' | 'all' | 'any' | 'in'; | ||
| export type MathExpressionName = '^' | 'log10'; | ||
| export type InterpolateExpressionName = 'interpolate' | 'step'; | ||
| export type ExpressionName = TypeExpressionName | ExtractorExpressionName | LogicalExpressionName | MathExpressionName | InterpolateExpressionName | 'pattern'; | ||
| export type StringExpressionName = 'concat'; | ||
| export type ExpressionName = TypeExpressionName | ExtractorExpressionName | LogicalExpressionName | MathExpressionName | InterpolateExpressionName | StringExpressionName | 'pattern'; | ||
| /** | ||
@@ -665,3 +666,7 @@ * Type representing the style layer property expressions. | ||
| */ | ||
| export interface StyleIconConfig { | ||
| export type StyleIconConfig = StyleSimpleIconConfig | StyleStretchableIconConfig; | ||
| /** | ||
| * Config of a simple (non-stretchable) user icon. | ||
| */ | ||
| export interface StyleSimpleIconConfig { | ||
| /** | ||
@@ -674,2 +679,30 @@ * URL path to an icon: | ||
| } | ||
| /** | ||
| * Config of a stretchable user icon. The icon stretches to fit its content (e.g. text) | ||
| * while keeping the edges (like rounded corners) fixed. | ||
| */ | ||
| export interface StyleStretchableIconConfig { | ||
| /** | ||
| * URL path to an icon: | ||
| * - absolute: `//external.domain/some_path/some_icon.svg` | ||
| * - template: `//{appHost}/some_path/some_icon.svg` | ||
| */ | ||
| url: string; | ||
| /** Width of the source icon in pixels. */ | ||
| width: number; | ||
| /** Height of the source icon in pixels. */ | ||
| height: number; | ||
| /** | ||
| * Pairs of pixel ranges along the X axis that can be stretched. | ||
| * For example, `[[10, 30]]` means pixels 0–10 and 30–width are fixed, | ||
| * and the region 10–30 stretches. | ||
| */ | ||
| stretchX: Array<[number, number]>; | ||
| /** | ||
| * Pairs of pixel ranges along the Y axis that can be stretched. | ||
| * For example, `[[10, 20]]` means pixels 0–10 and 20–height are fixed, | ||
| * and the region 10–20 stretches. | ||
| */ | ||
| stretchY: Array<[number, number]>; | ||
| } | ||
| export {}; |
133703
1.63%4245
1.6%