@mappable-world/mappable-types 0.0.16 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/modules/types.d.ts +0 -1
  2. package/package.json +1 -1
  3. package/modules/analytics/index.d.ts +0 -4
  4. package/modules/analytics/src/DataProviders/BaseDataProvider.d.ts +0 -40
  5. package/modules/analytics/src/DataProviders/JSONDataProvider.d.ts +0 -27
  6. package/modules/analytics/src/DataProviders/JSONLinesDataProvider.d.ts +0 -41
  7. package/modules/analytics/src/DataProviders/StaticDataProvider.d.ts +0 -18
  8. package/modules/analytics/src/DataProviders/index.d.ts +0 -4
  9. package/modules/analytics/src/DataProviders/utils/loadByChunk.d.ts +0 -1
  10. package/modules/analytics/src/MMapDataAnalyticsLayer/MMapDataAnalyticsLayer.d.ts +0 -90
  11. package/modules/analytics/src/MMapDefaultVectorLayerImplementation/MMapDefaultVectorLayerImplementation.d.ts +0 -95
  12. package/modules/analytics/src/MMapDefaultVectorLayerImplementation/utils/atlas.d.ts +0 -27
  13. package/modules/analytics/src/MMapDefaultVectorLayerImplementation/utils/calculateNormalsForVertices.d.ts +0 -5
  14. package/modules/analytics/src/MMapDefaultVectorLayerImplementation/utils/frameBuffer.d.ts +0 -29
  15. package/modules/analytics/src/MMapDefaultVectorLayerImplementation/utils/memoryManager.d.ts +0 -49
  16. package/modules/analytics/src/MMapDefaultVectorLayerImplementation/utils/program.d.ts +0 -10
  17. package/modules/analytics/src/MMapDefaultVectorLayerImplementation/utils/scheduleManager.d.ts +0 -44
  18. package/modules/analytics/src/MMapDefaultVectorLayerImplementation/utils/utils.d.ts +0 -35
  19. package/modules/analytics/src/MMapGeoJsonLayer/MMapGeoJsonImplementation.d.ts +0 -3
  20. package/modules/analytics/src/MMapGeoJsonLayer/MMapGeoJsonLayer.d.ts +0 -64
  21. package/modules/analytics/src/MMapGeoJsonLayer/renders/geojson.d.ts +0 -3
  22. package/modules/analytics/src/MMapGeoJsonLayer/utils/constants.d.ts +0 -17
  23. package/modules/analytics/src/MMapGeoJsonLayer/utils/generateGeometryBuffers.d.ts +0 -17
  24. package/modules/analytics/src/MMapGeoJsonLayer/utils/generateLineGeometry.d.ts +0 -6
  25. package/modules/analytics/src/MMapGeoJsonLayer/utils/generatePointGeometry.d.ts +0 -4
  26. package/modules/analytics/src/MMapGeoJsonLayer/utils/generatePolygonGeometry.d.ts +0 -2
  27. package/modules/analytics/src/MMapGeoJsonLayer/utils/utils.d.ts +0 -37
  28. package/modules/analytics/src/MMapHeatmapLayer/MMapHeatmapLayer.d.ts +0 -38
  29. package/modules/analytics/src/MMapHeatmapLayer/MMapHeatmapLayerImplementation.d.ts +0 -3
  30. package/modules/analytics/src/MMapHeatmapLayer/renders/gradient.d.ts +0 -3
  31. package/modules/analytics/src/MMapHeatmapLayer/renders/heatmap.d.ts +0 -3
  32. package/modules/analytics/src/interface.d.ts +0 -42
  33. package/modules/analytics/src/types.d.ts +0 -8
@@ -4,6 +4,5 @@ declare module "../import" {
4
4
  (pkg: "@mappable-world/mappable-controls-extra"): Promise<typeof import("./controls-extra")>;
5
5
  (pkg: "@mappable-world/mappable-reactify"): Promise<typeof import("../reactify")>;
6
6
  (pkg: "@mappable-world/mappable-vuefy"): Promise<typeof import("./vuefy")>;
7
- (pkg: "@mappable-world/mappable-analytics"): Promise<typeof import("./analytics")>;
8
7
  }
9
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mappable-world/mappable-types",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "description": "Types for mappable maps library",
5
5
  "main": "",
6
6
  "types": "index.d.ts",
@@ -1,4 +0,0 @@
1
- export * from "./src/MMapDataAnalyticsLayer/MMapDataAnalyticsLayer";
2
- export * from "./src/MMapHeatmapLayer/MMapHeatmapLayer";
3
- export * from "./src/MMapGeoJsonLayer/MMapGeoJsonLayer";
4
- export * from "./src/DataProviders";
@@ -1,40 +0,0 @@
1
- import Flatbush from "flatbush";
2
- import type { LngLat, Projection, WorldCoordinates } from "../../../../common/types";
3
- import type { GeoJSONFeature } from "../interface";
4
- export interface BaseDataProviderOptions<Feature extends GeoJSONFeature> {
5
- filter(item: Feature, tx: number, ty: number, tz: number): boolean;
6
- getFeatures: (json: unknown) => Feature[];
7
- convert: (item: unknown) => Feature;
8
- getBound(item: Feature): [
9
- LngLat,
10
- LngLat
11
- ];
12
- }
13
- export declare abstract class BaseDataProvider<Feature extends GeoJSONFeature, Options extends BaseDataProviderOptions<Feature> = BaseDataProviderOptions<Feature>> {
14
- protected __version: number;
15
- protected __flatbush: Flatbush[];
16
- protected __options: Options;
17
- protected readonly __projection: Projection;
18
- constructor(projection: Projection, options?: Partial<BaseDataProviderOptions<Feature>>);
19
- protected __waitFirstChunk: Promise<void>;
20
- protected __data: GeoJSONFeature[][];
21
- fetchTile(tx: number, ty: number, tz: number, signal: AbortSignal): Promise<{
22
- data: GeoJSONFeature[];
23
- total: number;
24
- version: number;
25
- }>;
26
- on(event: "update", handler: () => void): void;
27
- off(event: "update", handler: () => void): void;
28
- private readonly __eventHandlers;
29
- protected _emit(event: "update"): void;
30
- protected __isLoading: boolean;
31
- protected _clusterize(part: GeoJSONFeature[]): Promise<void>;
32
- }
33
- /**
34
- * Convert tile coordinates to special world coordinates.
35
- * It's not a real some standard, but it's used in mappable.
36
- */
37
- export declare function tileToWorld(tx: number, ty: number, tz: number): [
38
- WorldCoordinates,
39
- WorldCoordinates
40
- ];
@@ -1,27 +0,0 @@
1
- import type { Projection } from "../../../../common/types";
2
- import type { GeoJSONFeature } from "../interface";
3
- import { BaseDataProvider } from "./BaseDataProvider";
4
- /**
5
- * Loads GeoJSON data from a URL. The data is expected to be in the GeoJSON format.
6
- * But you can specify the `convert` option to convert the data to the GeoJSON format.
7
- * ```javascript
8
- * const {JSONDataProvider} = await mappable.import('@mappable-world/mappable-analytics');
9
- * const dataProvider = new JSONDataProvider('https://example.com/data.json', map.projection, {
10
- * convert: (item) => item as GeoJSONFeature,
11
- * });
12
- * dataProvider.load();
13
- * const layer = new MMapGeoJsonLayer({
14
- * dataProvider,
15
- * });
16
- * ```
17
- * @param url - URL to load the data from.
18
- */
19
- export declare class JSONDataProvider<Feature extends GeoJSONFeature = GeoJSONFeature> extends BaseDataProvider<Feature> {
20
- readonly url: string;
21
- constructor(url: string, projection: Projection, options?: {});
22
- /**
23
- * Starts loading the data from the URL.
24
- */
25
- load(): Promise<void> | undefined;
26
- private __loadGeoJSON;
27
- }
@@ -1,41 +0,0 @@
1
- import type { Projection } from "../../../../common/types";
2
- import type { GeoJSONFeature } from "../interface";
3
- import { BaseDataProvider, type BaseDataProviderOptions } from "./BaseDataProvider";
4
- interface JSONLinesDataProviderDataProviderOptions<Feature extends GeoJSONFeature = GeoJSONFeature> extends BaseDataProviderOptions<Feature> {
5
- chunkSize: number;
6
- total: number;
7
- progress: (progress: number) => void;
8
- tickTimeout: number;
9
- convert: (item: unknown) => Feature;
10
- }
11
- /**
12
- * Loads GeoJSON lines data from a URL. The data is expected to be in the JSON lines format.
13
- * Each line should be a valid JSON object.
14
- * But you can specify the `convert` option to convert the data to the GeoJSON format.
15
- * ```javascript
16
- * const {JSONLinesDataProvider} = await mappable.import('@mappable-world/mappable-analytics');
17
- * const dataProvider = new JSONLinesDataProvider('https://example.com/data.json', map.projection, {
18
- * chunkSize: 10000,
19
- * total: 1500000,
20
- * progress: (progress) => {
21
- * console.log(progress);
22
- * },
23
- * convert: (item) => item as GeoJSONFeature,
24
- * });
25
- * dataProvider.load();
26
- * const layer = new MMapGeoJsonLayer({
27
- * dataProvider,
28
- * });
29
- * ```
30
- */
31
- export declare class JSONLinesDataProvider<Feature extends GeoJSONFeature = GeoJSONFeature> extends BaseDataProvider<Feature, JSONLinesDataProviderDataProviderOptions<Feature>> {
32
- readonly url: string;
33
- constructor(url: string, projection: Projection, options?: Partial<JSONLinesDataProviderDataProviderOptions<Feature>>);
34
- /**
35
- * Starts loading the data from the URL.
36
- */
37
- load(): Promise<number> | undefined;
38
- private __loadByChunks;
39
- private __parseJSONLines;
40
- }
41
- export {};
@@ -1,18 +0,0 @@
1
- import type { Projection } from "../../../../common/types";
2
- import type { GeoJSONFeature } from "../interface";
3
- import { BaseDataProvider } from "./BaseDataProvider";
4
- /**
5
- * Static data provider. The data for the provider is set in the constructor and can be changed using the `setData` method.
6
- * ```javascript
7
- * const {StaticDataProvider} = await mappable.import('@mappable-world/mappable-analytics');
8
- * const dataProvider = new StaticDataProvider(data, map.projection);
9
- * const layer = new MMapGeoJsonLayer({
10
- * dataProvider,
11
- * });
12
- * dataProvider.setData(newData);
13
- * ```
14
- */
15
- export declare class StaticDataProvider<Feature extends GeoJSONFeature = GeoJSONFeature> extends BaseDataProvider<Feature> {
16
- constructor(data: unknown, projection: Projection);
17
- setData(data: unknown): void;
18
- }
@@ -1,4 +0,0 @@
1
- export * from "./BaseDataProvider";
2
- export * from "./JSONDataProvider";
3
- export * from "./JSONLinesDataProvider";
4
- export * from "./StaticDataProvider";
@@ -1 +0,0 @@
1
- export declare function loadNewChunk(url: string, size?: number): AsyncGenerator<string[], void, unknown>;
@@ -1,90 +0,0 @@
1
- import type { LngLat, VectorLayerImplementationConstructor, Projection, TileCoordinates } from "../../../../common/types";
2
- import type { DomEventHandler, MMapLayerProps } from "../../../../imperative";
3
- import type { GlTile } from "../MMapDefaultVectorLayerImplementation/MMapDefaultVectorLayerImplementation";
4
- interface MMapDataAnalyticsLayerProps<ItemType> extends Omit<MMapLayerProps, "type" | "implementation" | "source"> {
5
- tileSize?: number;
6
- hitTestTimeout?: number;
7
- tileReconciliationTimeout?: number;
8
- tileRemoveTimeout?: number;
9
- /**
10
- * @param itemId - result of getUniqueId
11
- */
12
- onMouseEnterItem?: (itemId: unknown, coordinates: LngLat) => void;
13
- onMouseLeaveItem?: (itemId: unknown, coordinates: LngLat) => void;
14
- onClickItem?: (itemId: unknown, coordinates: LngLat) => void;
15
- dataProvider?: {
16
- off?(event: "update", clb: Function): void;
17
- on?(event: "update", clb: Function): void;
18
- fetchTile(tx: number, ty: number, tz: number, signal: AbortSignal): Promise<{
19
- data: ItemType[];
20
- total?: number;
21
- version?: number | string;
22
- }>;
23
- };
24
- /**
25
- * Unique data for identify item. it can be id, or object
26
- * @param item
27
- */
28
- getUniqueId(item: ItemType): string | number | object;
29
- }
30
- export interface AnalyticsImplProxy<OutputData, Props> {
31
- props: () => Props;
32
- projection: () => Projection;
33
- requestRender: () => void;
34
- getIdByScreen?: (coordinates: {
35
- x: number;
36
- y: number;
37
- }) => unknown | undefined;
38
- getUniqueId: (item: OutputData) => string | number | object;
39
- getTiles: () => GlTile[];
40
- convertData: (tileCoordinates: TileCoordinates, zoom: number, data: unknown, signal: AbortSignal) => Promise<unknown>;
41
- implReady: {
42
- promise: Promise<void>;
43
- resolve: () => void;
44
- };
45
- }
46
- declare const defaultLayerProps: {
47
- tileSize: number;
48
- hitTestTimeout: number;
49
- tileReconciliationTimeout: number;
50
- tileRemoveTimeout: number;
51
- };
52
- export type DefaultProps = typeof defaultLayerProps;
53
- export declare abstract class MMapDataAnalyticsLayer<ItemType, Props, Default extends DefaultProps> extends mappable.MMapComplexEntity<MMapDataAnalyticsLayerProps<ItemType> & Props, Default> {
54
- PROPS: MMapDataAnalyticsLayerProps<ItemType> & Props;
55
- static defaultProps: {
56
- tileSize: number;
57
- hitTestTimeout: number;
58
- tileReconciliationTimeout: number;
59
- tileRemoveTimeout: number;
60
- };
61
- private __virtualTileDataSource;
62
- private readonly __virtualTileLayer;
63
- private readonly __vectorLayer;
64
- private readonly __listener;
65
- private __dataCache;
66
- private __tileCache;
67
- private __tiles;
68
- PROXY: AnalyticsImplProxy<ItemType, MMapDataAnalyticsLayerProps<ItemType> & Props>;
69
- protected __proxy: this["PROXY"];
70
- private __mapInAction;
71
- constructor(props: MMapDataAnalyticsLayerProps<ItemType> & Props);
72
- protected abstract _getImplementation(): VectorLayerImplementationConstructor;
73
- protected _onAttach(): void;
74
- protected _onUpdate(props: Partial<this["PROPS"]>, oldProps: Partial<this["PROPS"]>): void;
75
- protected _onDetach(): void;
76
- protected _stateVersion: number;
77
- protected _requestTileRecalculation(): void;
78
- private _requestTileRecalculationImd;
79
- private __previousSelected;
80
- protected _onMouseMoveHitTest: DomEventHandler;
81
- private __removedTiles;
82
- private __requestRemoveTiles;
83
- private __requestRemoveTilesImd;
84
- /**
85
- * TODO The concept of virtual layers is now used. It's redundant, MAPSAPI-17151
86
- * @private
87
- */
88
- private _getRasterOptions;
89
- }
90
- export {};
@@ -1,95 +0,0 @@
1
- import type { TileCoordinates, VectorLayerImplementation, VectorLayerImplementationRenderProps, WorldCoordinates } from "../../../../common/types";
2
- import type { DefaultProps, MMapDataAnalyticsLayer } from "../MMapDataAnalyticsLayer/MMapDataAnalyticsLayer";
3
- import { MemoryManager } from "./utils/memoryManager";
4
- import { Atlas } from "./utils/atlas";
5
- import { FrameBuffer } from "./utils/frameBuffer";
6
- export interface Program {
7
- program: WebGLProgram;
8
- uniforms: Record<string, WebGLUniformLocation>;
9
- locations: Record<string, number>;
10
- shaders: {
11
- vertex: WebGLShader;
12
- fragment: WebGLShader;
13
- };
14
- }
15
- type RenderWorldsProps = VectorLayerImplementationRenderProps;
16
- export type RenderWorldProps = Omit<RenderWorldsProps, "worlds"> & {
17
- world: RenderWorldsProps["worlds"][0];
18
- };
19
- export interface AnalyticsRenderUnit {
20
- program: Program;
21
- setup?: (this: MMapDefaultVectorLayerImplementation, props: RenderWorldProps) => void;
22
- beforeRender?: (this: MMapDefaultVectorLayerImplementation, props: RenderWorldProps) => void;
23
- render: (this: MMapDefaultVectorLayerImplementation, props: RenderWorldProps) => void;
24
- afterRender?: (this: MMapDefaultVectorLayerImplementation, props: RenderWorldProps) => void;
25
- textures?: Record<string, WebGLTexture>;
26
- }
27
- export interface BufferStore {
28
- bufferType: number;
29
- bufferLength: number;
30
- buffer: WebGLBuffer;
31
- drawType: number;
32
- valueType: number;
33
- size: number;
34
- attribute: number;
35
- data: Float32Array | Uint32Array | null;
36
- }
37
- export interface GlTile {
38
- readonly coordinates: TileCoordinates;
39
- readonly tileBound: [
40
- WorldCoordinates,
41
- WorldCoordinates
42
- ];
43
- readonly zoom: number;
44
- setup?(): void;
45
- render(): void;
46
- destroy(): void;
47
- getObjectByIndex(id: number): unknown;
48
- }
49
- /**
50
- * Size of hit test texture
51
- */
52
- export declare const HIT_SIZE = 256;
53
- export declare abstract class MMapDefaultVectorLayerImplementation implements VectorLayerImplementation {
54
- readonly _proxy: MMapDataAnalyticsLayer<unknown, unknown, DefaultProps>["PROXY"];
55
- readonly gl: WebGLRenderingContext;
56
- readonly options: {
57
- requestRender: () => void;
58
- };
59
- protected readonly _atlas: Atlas;
60
- protected readonly _memoryManager: MemoryManager;
61
- protected _frameBuffers: Record<"main" | "hit" | string, FrameBuffer>;
62
- protected _renderUnits: Record<"main" | string, AnalyticsRenderUnit>;
63
- protected _extVertexArrayObject: OES_vertex_array_object;
64
- protected _angleExt: ANGLE_instanced_arrays;
65
- protected _indexUnitExt: OES_element_index_uint;
66
- protected _isReadyForRender: boolean;
67
- protected abstract _createRenderUnits(): Record<"main" | string, AnalyticsRenderUnit>;
68
- protected abstract _renderWorld(props: RenderWorldProps): void;
69
- constructor(_proxy: MMapDataAnalyticsLayer<unknown, unknown, DefaultProps>["PROXY"], gl: WebGLRenderingContext, options: {
70
- requestRender: () => void;
71
- });
72
- private __selectedId;
73
- protected set _selectedId(value: number);
74
- protected get _selectedId(): number;
75
- /**
76
- * Read pixel from hit test frame buffer and find object by id
77
- */
78
- private __getIdByScreen;
79
- destroy(): void;
80
- protected _createBuffer(location: number, data: number[] | Float32Array | Uint32Array, size?: number): BufferStore;
81
- protected _enableAttributeBuffer(attr: BufferStore): void;
82
- private __bindBufferData;
83
- private _renderRequested;
84
- protected _requestLayerRender(): void;
85
- render(props: RenderWorldsProps): {
86
- color: WebGLTexture;
87
- depth: WebGLTexture;
88
- };
89
- protected _renderUnit(unit: AnalyticsRenderUnit, props: RenderWorldProps): void;
90
- private __renderWorlds;
91
- protected _renderTiles(tiles: GlTile[], cb?: (tile: GlTile) => void): void;
92
- protected __clearGlobalState(): void;
93
- protected _convertData(tileCoordinates: TileCoordinates, zoom: number, data: unknown, _: AbortSignal): Promise<unknown>;
94
- }
95
- export * from "./utils/utils";
@@ -1,27 +0,0 @@
1
- import type { PixelCoordinates } from "../../../../../common/types";
2
- export interface IconResource {
3
- url: string;
4
- size: PixelCoordinates;
5
- offset: PixelCoordinates;
6
- }
7
- /**
8
- * Texture atlas for storing icons.
9
- * ```js
10
- * const atlas = new Atlas(gl, 1024, 64);
11
- * const icon = atlas.loadAndGetOffset('icon.png');
12
- * console.log(icon); // {url: 'icon.png', size: {x: 0.5, y: 0.5}, offset: {x: 0, y: 0}}
13
- * ```
14
- */
15
- export declare class Atlas {
16
- private readonly gl;
17
- private readonly size;
18
- private readonly iconSize;
19
- readonly texture: WebGLTexture;
20
- private readonly __cells;
21
- constructor(gl: WebGLRenderingContext, size: number, iconSize: number);
22
- private __isDestroyed;
23
- destroy(): void;
24
- private __cache;
25
- loadAndGetOffset(urlOrImage: string): IconResource;
26
- private __putImage;
27
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * Calculates normals for vertices. Used for calculating normals for every triangle.
3
- * Normals are used for lighting.
4
- */
5
- export declare function calculateNormalsForVertices(vertices: Float32Array, size: number, normals: Float32Array, featureVertexOffset: number, vertexCount: number): void;
@@ -1,29 +0,0 @@
1
- /**
2
- * Encapsulate work with WebGL frame buffer object
3
- */
4
- export declare class FrameBuffer {
5
- private gl;
6
- private options;
7
- readonly color: WebGLTexture;
8
- readonly depth: WebGLTexture;
9
- private readonly __buffer;
10
- private readonly __size;
11
- constructor(gl: WebGLRenderingContext, options?: {
12
- w?: number;
13
- h?: number;
14
- depth?: boolean;
15
- });
16
- destroy(): void;
17
- clear(): this;
18
- private static __current;
19
- static bind(frameBuffer: FrameBuffer): void;
20
- static unbind(frameBuffer: FrameBuffer): void;
21
- static unbindCurrent(gl: WebGLRenderingContext): void;
22
- private __needReadPixel;
23
- private __pixelStore;
24
- /**
25
- * FIXME Optimize read pixel MAPSAPI-17272
26
- */
27
- readPixel(rx: number, ry: number): Uint8Array;
28
- resize(w: number, h?: number): this;
29
- }
@@ -1,49 +0,0 @@
1
- type ArrayType = {
2
- length: number;
3
- type: typeof Float32Array | typeof Uint32Array;
4
- };
5
- /**
6
- * Memory manager for managing memory allocation for typed arrays.
7
- * ```js
8
- * const memoryManager = new MemoryManager(1024, 10); // 1024 bytes per buffer, 10 buffers max
9
- * const [array] = await memoryManager.allocates([{length: 2, type: Float32Array}]); // 2 elements, 4 bytes each
10
- * array[0] = 1;
11
- * const newArray = memoryManager.resize(array, 1);
12
- * memoryManager.free(newArray);
13
- * ```
14
- */
15
- export declare class MemoryManager {
16
- private readonly allocateBufferSize;
17
- private readonly maxBuffersCount;
18
- private __buffers;
19
- private __allocatedArrays;
20
- private __waitFreeMemory;
21
- constructor(allocateBufferSize: number, maxBuffersCount: number);
22
- destroy(): void;
23
- /**
24
- * Asynchronously allocates memory for an arrays of the specified length and type.
25
- * Allocate memory only if there is enough free memory for all requested arrays.
26
- */
27
- allocateArrays<T extends ArrayType[]>(requestedArrays: [
28
- ...T
29
- ], signal?: AbortSignal): Promise<{
30
- [K in keyof T]: InstanceType<T[K]["type"]>;
31
- }>;
32
- private __canAllocate;
33
- /**
34
- * Synchronously allocates memory for an array of the specified length and type.
35
- */
36
- private __allocate;
37
- /**
38
- * Synchronously resizes the memory allocated for the array. Allow only shrinking the array.
39
- */
40
- resize<T extends Float32Array | Uint32Array>(array: T, newSize: number): T;
41
- /**
42
- * Synchronously frees the memory allocated for the array.
43
- */
44
- free(array: Float32Array | Uint32Array): void;
45
- private __createNewBigBuffer;
46
- private __makeTypedArray;
47
- private __findHole;
48
- }
49
- export {};
@@ -1,10 +0,0 @@
1
- import type { Program } from "../MMapDefaultVectorLayerImplementation";
2
- interface ProgramOptions {
3
- vertexShader: string;
4
- fragmentShader: string;
5
- uniforms: string[];
6
- attributes: string[];
7
- setupBeforeRender?: (program: Program) => void;
8
- }
9
- export declare function createProgram(gl: WebGLRenderingContext, options: ProgramOptions): Program;
10
- export {};
@@ -1,44 +0,0 @@
1
- interface AsyncRunnerOptions {
2
- timeout: number;
3
- minCountPerFrame: number;
4
- }
5
- interface AsyncRunnerEvent {
6
- timeRemaining(): DOMHighResTimeStamp;
7
- }
8
- interface AsyncRunner<Opt extends Partial<AsyncRunnerOptions>> {
9
- (callback: (e: AsyncRunnerEvent) => unknown, options?: Opt): void;
10
- }
11
- /**
12
- * The class is designed to schedule tasks for execution in the browser's event loop.
13
- * When `asyncRunner` fires, it launches `__runner`, which executes tasks from the queue.
14
- * Tasks can be added to the queue using the add method.
15
- * Tasks will be completed until all tasks are completed or until the time allotted for the chunk is completed.
16
- * There is also a limit on the number of tasks that can be completed at one time.
17
- */
18
- declare class ScheduleTaskManager {
19
- private readonly asyncRunner;
20
- private readonly __options;
21
- private readonly __taskIterator;
22
- private readonly __tasks;
23
- private __runnerRequested;
24
- constructor(asyncRunner?: AsyncRunner<AsyncScheduleOptions>, options?: Partial<AsyncScheduleOptions>);
25
- /**
26
- * Add a task to the queue.
27
- * ```javascript
28
- * const manager = new ScheduleTaskManager();
29
- * const result = await manager.add([1, 2, 3], (item) => item * 2, new AbortController().signal);
30
- * console.log(result); // [2, 4, 6]
31
- * ```
32
- */
33
- add<I, O>(part: I[], processor: (item: I, index: number) => O, signal?: AbortSignal): Promise<O[]>;
34
- private __runner;
35
- private __getNewTask;
36
- private __hasNewTask;
37
- private __requestRunner;
38
- }
39
- interface AsyncScheduleOptions extends AsyncRunnerOptions {
40
- remainingTime: number;
41
- asyncStarter: (cb: Function) => unknown;
42
- }
43
- export declare const scheduleManager: ScheduleTaskManager;
44
- export {};
@@ -1,35 +0,0 @@
1
- /**
2
- * We use only rgb since alpha does not fit into highp float
3
- */
4
- export declare function getColorId(colorComponents: [
5
- number,
6
- number,
7
- number,
8
- number
9
- ] | Uint8Array): number;
10
- export declare function isPowerOf2(value: number): boolean;
11
- export declare function checkRequiredExtensions(supportedExtensions: string[]): void;
12
- /**
13
- * Generates a new ID for baking to color in a hit test
14
- */
15
- export declare function getIncrementalId(): number;
16
- /**
17
- * Parse color from string to [r, g, b, a]
18
- * Allow formats #RRGGBB, #RRGGBBAA, rgb(r, g, b), rgba(r, g, b, a)
19
- * @returns [r, g, b, a] - a is in range [0, 1], r, g, b in range [0, 255]
20
- */
21
- export declare function parseColor(input: string | [
22
- number,
23
- number,
24
- number
25
- ] | [
26
- number,
27
- number,
28
- number,
29
- number
30
- ]): [
31
- number,
32
- number,
33
- number,
34
- number
35
- ];
@@ -1,3 +0,0 @@
1
- import type { VectorLayerImplementationConstructor } from "../../../../common/types";
2
- import type { MMapGeoJsonLayer } from "../MMapGeoJsonLayer/MMapGeoJsonLayer";
3
- export declare function getImpl(proxy: MMapGeoJsonLayer["PROXY"]): VectorLayerImplementationConstructor;
@@ -1,64 +0,0 @@
1
- import type { LngLat, VectorLayerImplementationConstructor } from "../../../..";
2
- import { type DefaultProps, MMapDataAnalyticsLayer } from "../MMapDataAnalyticsLayer/MMapDataAnalyticsLayer";
3
- import type { GeoJSONFeature, GeoJsonLineStringFeature, GeoJsonPointFeature, GeoJsonPolygonFeature, LineStringDrawingStyle, PointDrawingStyle, PolygonDrawingStyle } from "../interface";
4
- interface MMapGeoJsonLayerProps {
5
- opacity?: number;
6
- extruded?: boolean;
7
- extrudeMultiplier?: number;
8
- wireframe?: boolean | {
9
- /**
10
- * Width of the wireframe. In pixels.
11
- */
12
- width: number;
13
- /**
14
- * Color of the wireframe
15
- * @default #808080
16
- */
17
- color: string;
18
- };
19
- lightPosition?: LngLat;
20
- getDrawingStyle(f: GeoJsonPolygonFeature): PolygonDrawingStyle;
21
- getDrawingStyle(f: GeoJsonLineStringFeature): LineStringDrawingStyle;
22
- getDrawingStyle(f: GeoJsonPointFeature): PointDrawingStyle;
23
- getDrawingStyle(f: GeoJSONFeature): PolygonDrawingStyle | LineStringDrawingStyle | PointDrawingStyle;
24
- }
25
- declare const defaultProps: {
26
- opacity: number;
27
- extruded: boolean;
28
- extrudeMultiplier: number;
29
- wireframe: boolean;
30
- lightPosition: number[];
31
- getDrawingStyle: (_: GeoJSONFeature) => {
32
- fill: string;
33
- elevation: number;
34
- dash: number;
35
- zOffset: number;
36
- opacity: number;
37
- width: number;
38
- iconSize: number;
39
- simplificationRate: number;
40
- };
41
- };
42
- type DefaultPropsGeo = typeof defaultProps;
43
- export declare class MMapGeoJsonLayer extends MMapDataAnalyticsLayer<GeoJSONFeature, MMapGeoJsonLayerProps, DefaultPropsGeo & DefaultProps> {
44
- static defaultPropsJson: {
45
- opacity: number;
46
- extruded: boolean;
47
- extrudeMultiplier: number;
48
- wireframe: boolean;
49
- lightPosition: number[];
50
- getDrawingStyle: (_: GeoJSONFeature) => {
51
- fill: string;
52
- elevation: number;
53
- dash: number;
54
- zOffset: number;
55
- opacity: number;
56
- width: number;
57
- iconSize: number;
58
- simplificationRate: number;
59
- };
60
- };
61
- protected _getImplementation(): VectorLayerImplementationConstructor;
62
- protected _onUpdate(props: Partial<this["PROPS"]>, oldProps: Partial<this["PROPS"]>): void;
63
- }
64
- export {};
@@ -1,3 +0,0 @@
1
- import { type MMapDefaultVectorLayerImplementation, type AnalyticsRenderUnit } from "../../MMapDefaultVectorLayerImplementation/MMapDefaultVectorLayerImplementation";
2
- import type { MMapGeoJsonLayer } from "../MMapGeoJsonLayer";
3
- export declare function createGeoJsonRenderUnit(this: MMapDefaultVectorLayerImplementation, proxy: MMapGeoJsonLayer["PROXY"]): AnalyticsRenderUnit;
@@ -1,17 +0,0 @@
1
- /**
2
- * Value to compare floating point numbers with zero
3
- */
4
- export declare const EPSILON = 1e-16;
5
- /**
6
- * Maximum number of features to process tile clip geometry
7
- */
8
- export declare const CLIP_GEOMETRY_BY_COUNT = 1000;
9
- /**
10
- * Number of components per vertex (x,y,z)
11
- */
12
- export declare const COMPONENT_PER_VERTEX = 3;
13
- /**
14
- * Number of vertices per edge. 2 triangles with 3 vertices each. 2 vertices are shared
15
- * [p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, p2.x, p2.y, p3.x, p3.y, p4.x, p4.y]
16
- */
17
- export declare const VERTEX_PER_EDGE = 6;
@@ -1,17 +0,0 @@
1
- import type { WorldCoordinates } from "../../../../../common/types";
2
- import type { GeoJSONFeature } from "../../interface";
3
- import type { MemoryManager } from "../../MMapDefaultVectorLayerImplementation/utils/memoryManager";
4
- import type { Atlas } from "../../MMapDefaultVectorLayerImplementation/utils/atlas";
5
- import { MMapGeoJsonLayer } from "../MMapGeoJsonLayer";
6
- export interface ConversionResult {
7
- vertices: Float32Array;
8
- barycentric: Float32Array;
9
- normals: Float32Array;
10
- colors: Float32Array;
11
- ids: Float32Array;
12
- texCoord: Float32Array;
13
- }
14
- export declare function generateGeometryBuffers(features: GeoJSONFeature[], proxy: MMapGeoJsonLayer["PROXY"], memoryManager: MemoryManager, atlas: Atlas, signal: AbortSignal, tileBounds: [
15
- WorldCoordinates,
16
- WorldCoordinates
17
- ], mapId: Map<number, unknown>, mapIid: Map<unknown, number>, zoom: number): Promise<ConversionResult>;
@@ -1,6 +0,0 @@
1
- import type { GenericLineStringGeometry, GenericProjection, LngLat, WorldCoordinates } from "../../../../../common/types";
2
- import type { LineStringDrawingStyle } from "../../interface";
3
- export declare function generateLineGeometry(geometry: GenericLineStringGeometry<LngLat>, projection: GenericProjection<LngLat>, style: Required<LineStringDrawingStyle>, needClipGeometry: boolean, tileBounds: [
4
- WorldCoordinates,
5
- WorldCoordinates
6
- ], extruded: undefined | boolean, vertexCount: number, elevation: number, featureVertexOffset: number, texCoord: Float32Array, vertices: Float32Array, minZ: number, worldSimplificationRate: number): number;
@@ -1,4 +0,0 @@
1
- import type { GenericPointGeometry, GenericProjection, LngLat } from "../../../../../common/types";
2
- import type { PointDrawingStyle } from "../../interface";
3
- import type { Atlas } from "../../MMapDefaultVectorLayerImplementation/utils/atlas";
4
- export declare function generatePointGeometry(projection: GenericProjection<LngLat>, geometry: GenericPointGeometry<LngLat>, style: PointDrawingStyle, vertices: Float32Array, featureVertexOffset: number, elevation: number, normals: Float32Array, atlas: Atlas, texCoord: Float32Array): number;
@@ -1,2 +0,0 @@
1
- import type { GenericPolygonGeometry, GenericProjection, LngLat } from "../../../../../common/types";
2
- export declare function generatePolygonGeometry(geometry: GenericPolygonGeometry<LngLat>, projection: GenericProjection<LngLat>, vertexCount: number, extruded: undefined | boolean, featureVertexOffset: number, vertices: Float32Array, elevation: number, minZ: number, worldSimplificationRate: number): number;
@@ -1,37 +0,0 @@
1
- import type { LngLat, Projection, Vec2, WorldCoordinates } from "../../../../../common/types";
2
- import type { GeoJSONFeature } from "../../interface";
3
- export type Rectangle = [
4
- WorldCoordinates,
5
- WorldCoordinates,
6
- WorldCoordinates,
7
- WorldCoordinates
8
- ];
9
- /**
10
- * Check if the given points form a ring
11
- */
12
- export declare function isRing(points: WorldCoordinates[] | LngLat[]): boolean;
13
- /**
14
- * Fill vertices for rectangle in the buffer by CW order
15
- */
16
- export declare function fillVerticesForRectangle(vertices: Float32Array, offset: number, rect: Rectangle): void;
17
- /**
18
- * Extrude the given ring to the given height
19
- */
20
- export declare function extrudeSides(ring: WorldCoordinates[], vertices: Float32Array, offset: number, height: number, z: number): void;
21
- interface OffsetDescription {
22
- offset: Vec2;
23
- size: Vec2;
24
- }
25
- /**
26
- * Set texture coordinates for the rectangle
27
- */
28
- export declare function setTextureCoords(texCoord: Float32Array, offset: number, description: OffsetDescription): void;
29
- /**
30
- * Calculate barycentric coordinates for triangles
31
- */
32
- export declare function calculateBarycentric(barycentric: Float32Array, size: number, start: number, length: number): void;
33
- /**
34
- * Convert meters to world coordinates
35
- */
36
- export declare function meterToWorld(feature: GeoJSONFeature, projection: Projection): number;
37
- export {};
@@ -1,38 +0,0 @@
1
- import type { VectorLayerImplementationConstructor } from "../../../../common/types";
2
- import { type DefaultProps, MMapDataAnalyticsLayer } from "../MMapDataAnalyticsLayer/MMapDataAnalyticsLayer";
3
- import type { GeoJSONFeature, Gradient } from "../interface";
4
- interface MMapHeatmapLayerProps {
5
- /** Function to get the weight of the feature. By default, the weight is 0.5. */
6
- getWeight?: (f: GeoJSONFeature) => number;
7
- /** Gradient for heat map display. By default, the standard gradient is used. */
8
- gradient?: Gradient[];
9
- zOffset?: number;
10
- opacity?: number;
11
- density?: number;
12
- pointSize?: number;
13
- blur?: number;
14
- max?: number;
15
- }
16
- declare const defaultProps: {
17
- getWeight: () => number;
18
- density: number;
19
- max: number;
20
- pointSize: number;
21
- blur: number;
22
- zOffset: number;
23
- opacity: number;
24
- };
25
- type DefaultPropsHeatmap = typeof defaultProps;
26
- export declare class MMapHeatmapLayer extends MMapDataAnalyticsLayer<GeoJSONFeature, MMapHeatmapLayerProps, DefaultPropsHeatmap & DefaultProps> {
27
- static defaultPropsJson: {
28
- getWeight: () => number;
29
- density: number;
30
- max: number;
31
- pointSize: number;
32
- blur: number;
33
- zOffset: number;
34
- opacity: number;
35
- };
36
- protected _getImplementation(): VectorLayerImplementationConstructor;
37
- }
38
- export {};
@@ -1,3 +0,0 @@
1
- import type { VectorLayerImplementationConstructor } from "../../../../common/types";
2
- import type { MMapHeatmapLayer } from "../MMapHeatmapLayer/MMapHeatmapLayer";
3
- export declare function getHeatmapImpl(proxy: MMapHeatmapLayer["PROXY"]): VectorLayerImplementationConstructor;
@@ -1,3 +0,0 @@
1
- import type { MMapDefaultVectorLayerImplementation, AnalyticsRenderUnit } from "../../MMapDefaultVectorLayerImplementation/MMapDefaultVectorLayerImplementation";
2
- import type { MMapHeatmapLayer } from "../MMapHeatmapLayer";
3
- export declare function createGradientRenderUnit(this: MMapDefaultVectorLayerImplementation, proxy: MMapHeatmapLayer["PROXY"]): AnalyticsRenderUnit;
@@ -1,3 +0,0 @@
1
- import { type MMapDefaultVectorLayerImplementation, type AnalyticsRenderUnit } from "../../MMapDefaultVectorLayerImplementation/MMapDefaultVectorLayerImplementation";
2
- import type { MMapHeatmapLayer } from "../MMapHeatmapLayer";
3
- export declare function createHeatmapRenderUnit(this: MMapDefaultVectorLayerImplementation, proxy: MMapHeatmapLayer["PROXY"]): AnalyticsRenderUnit;
@@ -1,42 +0,0 @@
1
- import type { GenericFeature, GenericLineStringGeometry, GenericPointGeometry, GenericPolygonGeometry, LngLat } from "../../../common/types";
2
- type Color = string;
3
- interface GeoJsonLineStringFeature extends GenericFeature<LngLat> {
4
- geometry: GenericLineStringGeometry<LngLat>;
5
- }
6
- interface GeoJsonPolygonFeature extends GenericFeature<LngLat> {
7
- geometry: GenericPolygonGeometry<LngLat>;
8
- }
9
- interface GeoJsonPointFeature extends GenericFeature<LngLat> {
10
- geometry: GenericPointGeometry<LngLat>;
11
- }
12
- interface PolygonDrawingStyle {
13
- fill?: Color;
14
- elevation?: number;
15
- zOffset?: number;
16
- simplificationRate?: number;
17
- }
18
- interface LineStringDrawingStyle {
19
- fill?: Color;
20
- width?: number;
21
- elevation?: number;
22
- dash?: number | [
23
- number,
24
- number
25
- ];
26
- zOffset?: number;
27
- simplificationRate?: number;
28
- }
29
- interface PointDrawingStyle {
30
- icon?: string;
31
- iconSize?: number;
32
- elevation?: number;
33
- zOffset?: number;
34
- fill?: string;
35
- }
36
- type GeoJSONFeature = GeoJsonLineStringFeature | GeoJsonPolygonFeature | GeoJsonPointFeature;
37
- type FeatureDrawingStyle = PolygonDrawingStyle | LineStringDrawingStyle | PointDrawingStyle;
38
- interface Gradient {
39
- color: Color;
40
- offset: number;
41
- }
42
- export type { GeoJSONFeature, GeoJsonLineStringFeature, GeoJsonPolygonFeature, GeoJsonPointFeature, FeatureDrawingStyle, PolygonDrawingStyle, LineStringDrawingStyle, PointDrawingStyle, Gradient };
@@ -1,8 +0,0 @@
1
- declare module '*.frag' {
2
- const content: string;
3
- export default content;
4
- }
5
- declare module '*.vert' {
6
- const content: string;
7
- export default content;
8
- }