Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@2gis/mapgl

Package Overview
Dependencies
Maintainers
9
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@2gis/mapgl - npm Package Compare versions

Comparing version
1.72.0
to
1.72.3
+1
-1
package.json
{
"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",

@@ -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';

@@ -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 {};