@besovideo/bvmap-leaflet 0.0.43 → 0.0.45

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.
@@ -91,6 +91,8 @@ export declare function CreateMap<T>(params: {
91
91
  className?: string;
92
92
  divIconOptions?: Pick<L.DivIconOptions, "iconAnchor">;
93
93
  } | undefined;
94
+ getRotate(): number;
95
+ getSpeed(): number;
94
96
  utils: {
95
97
  showTrajektoria(): void;
96
98
  stopTrajektoria(): void;
@@ -125,6 +127,8 @@ export declare function CreateMap<T>(params: {
125
127
  className?: string;
126
128
  divIconOptions?: Pick<L.DivIconOptions, "iconAnchor">;
127
129
  } | undefined;
130
+ getRotate(): number;
131
+ getSpeed(): number;
128
132
  utils: {
129
133
  showTrajektoria(): void;
130
134
  stopTrajektoria(): void;
@@ -159,6 +163,8 @@ export declare function CreateMap<T>(params: {
159
163
  className?: string;
160
164
  divIconOptions?: Pick<L.DivIconOptions, "iconAnchor">;
161
165
  } | undefined;
166
+ getRotate(): number;
167
+ getSpeed(): number;
162
168
  utils: {
163
169
  showTrajektoria(): void;
164
170
  stopTrajektoria(): void;
@@ -195,6 +201,8 @@ export declare function CreateMap<T>(params: {
195
201
  className?: string;
196
202
  divIconOptions?: Pick<L.DivIconOptions, "iconAnchor">;
197
203
  } | undefined;
204
+ getRotate(): number;
205
+ getSpeed(): number;
198
206
  utils: {
199
207
  showTrajektoria(): void;
200
208
  stopTrajektoria(): void;
@@ -0,0 +1,66 @@
1
+ import { default as L } from 'leaflet';
2
+
3
+ export interface ICanvasNoClusterLayerOptions {
4
+ markerSize?: number;
5
+ clickTolerance?: number;
6
+ showTitle?: boolean;
7
+ boundsPadding?: number;
8
+ maxTitleCount?: number;
9
+ shouldIgnoreClick?: (point: L.Point, event: L.LeafletMouseEvent) => boolean;
10
+ }
11
+ export declare class CanvasNoClusterLayer extends L.Layer {
12
+ private layerOptions;
13
+ private map?;
14
+ private canvas;
15
+ private bufferCanvas;
16
+ private snapshotCanvas;
17
+ private markers;
18
+ private markerSet;
19
+ private hiddenMarkers;
20
+ private imageCache;
21
+ private pendingImages;
22
+ private markerImageUrls;
23
+ private markerSprites;
24
+ private redrawFrame;
25
+ private drawToken;
26
+ private markerChangeHandles;
27
+ private titleMetricsCache;
28
+ private titleMeasureCanvas;
29
+ private topLeft;
30
+ private drawTopLeftLatLng?;
31
+ private zooming;
32
+ private drawZoom;
33
+ private currentDrawShowTitle;
34
+ constructor(layerOptions?: ICanvasNoClusterLayerOptions);
35
+ onAdd(map: L.Map): this;
36
+ onRemove(map: L.Map): this;
37
+ setMarkers(markers: Array<L.Marker>): void;
38
+ addMarkers(markers: Array<L.Marker>): void;
39
+ removeMarkers(markers: Array<L.Marker>): void;
40
+ hideMarker(marker: L.Marker): void;
41
+ showMarker(marker: L.Marker): void;
42
+ redraw(): void;
43
+ private bindMarkerChange;
44
+ private reset;
45
+ private handleZoomStart;
46
+ private animateZoom;
47
+ private scheduleRedraw;
48
+ private cancelRedraw;
49
+ private draw;
50
+ private drawMarker;
51
+ private getMarkerSprite;
52
+ private getMarkerIconLayout;
53
+ private shouldShowTitle;
54
+ private drawDefaultMarker;
55
+ private drawRotatedImage;
56
+ private drawSpeedStatus;
57
+ private drawTitle;
58
+ private getTitleRect;
59
+ private getTitleMetrics;
60
+ private roundRect;
61
+ private getStringLength;
62
+ private getImage;
63
+ private handleClick;
64
+ private findMarkerAt;
65
+ private isPointInRect;
66
+ }
@@ -4,10 +4,24 @@ import { createMarkerCustomFromMarker } from './marker';
4
4
 
5
5
  export interface IRenderMarkerCluster<T> {
6
6
  rendeCluster?: (userDatas: Array<T>, map: L.Map, cluster: ReturnType<LeafletMarkerHandle<any>["getCurrentZoomCluster"]>) => L.DivIcon;
7
- onClusterClick?: (userDatas: Array<T>, cluster: L.MarkerCluster, map: L.Map) => void;
7
+ onClusterClick?: (userDatas: Array<T>, cluster: L.MarkerCluster, map: L.Map, utils?: {
8
+ getPos: () => L.Point;
9
+ zoomToBounds: () => void;
10
+ }) => void;
8
11
  clusterType?: "NORMAL" | "NO_CLUSTER";
12
+ renderMode?: "DOM" | "CANVAS" | "WEBGL";
9
13
  clusterRadius?: number;
10
14
  clusterRadiusFn?: (zoom: number) => number;
15
+ chunkSize?: number;
16
+ chunkDelay?: number;
17
+ disableMarkerTitle?: boolean;
18
+ disableMarkerStatus?: boolean;
19
+ noClusterVisibleOnly?: boolean;
20
+ noClusterBoundsPadding?: number;
21
+ canvasMarkerSize?: number;
22
+ canvasClickTolerance?: number;
23
+ canvasShowTitle?: boolean;
24
+ canvasMaxTitleCount?: number;
11
25
  }
12
26
  export type ILeafletCustomMarker = ReturnType<typeof createMarkerCustomFromMarker>;
13
27
  export interface IAddMarkerParams<T> {
@@ -20,6 +34,10 @@ export interface IAddMarkerParams<T> {
20
34
  };
21
35
  userdata: T;
22
36
  options?: L.MarkerOptions;
37
+ performance?: {
38
+ disableTitle?: boolean;
39
+ disableStatus?: boolean;
40
+ };
23
41
  }
24
42
  export declare class IntervalTick {
25
43
  constructor();
@@ -43,6 +61,14 @@ export declare class LeafletMarkerHandle<T = any> {
43
61
  };
44
62
  private gRealtimeTrack;
45
63
  private radius;
64
+ private chunkTimers;
65
+ private removedMarkers;
66
+ private visibleNoClusterMarkers;
67
+ private noClusterSyncTimer;
68
+ private markerSet;
69
+ private canvasNoClusterLayer?;
70
+ private webglNoClusterLayer?;
71
+ private webglGridClusterLayer?;
46
72
  constructor(map: L.Map, renderOptions: IRenderMarkerCluster<T>);
47
73
  private clusterClickHandle;
48
74
  on(eventType: "clusterclick", handle: (userDatas: T[], utils: {
@@ -54,7 +80,19 @@ export declare class LeafletMarkerHandle<T = any> {
54
80
  setMaxClusterRadius(radius: number): void;
55
81
  private szMarkers;
56
82
  private addMarkerWrapper;
83
+ private isCanvasNoCluster;
84
+ private isWebGLNoCluster;
85
+ private isWebGLGridCluster;
86
+ private isNoClusterVisibleOnly;
87
+ private getNoClusterVisibleMarkers;
88
+ private scheduleNoClusterVisibleSync;
89
+ private syncNoClusterVisibleMarkers;
90
+ private clearNoClusterVisibleMarkers;
91
+ private clearChunkTimers;
92
+ private addMarkersToMapByChunk;
57
93
  proxyRemove(marker: L.Marker): void;
94
+ proxyMarkerActive(marker: L.Marker): void;
95
+ proxyMarkerInactive(marker: L.Marker): void;
58
96
  addMarkers(markerInfos: Array<IAddMarkerParams<T>>): {
59
97
  getUserData(): T;
60
98
  emitsClick(): void;
@@ -82,6 +120,8 @@ export declare class LeafletMarkerHandle<T = any> {
82
120
  className?: string;
83
121
  divIconOptions?: Pick<L.DivIconOptions, "iconAnchor">;
84
122
  } | undefined;
123
+ getRotate(): number;
124
+ getSpeed(): number;
85
125
  utils: {
86
126
  showTrajektoria(): void;
87
127
  stopTrajektoria(): void;
@@ -117,6 +157,8 @@ export declare class LeafletMarkerHandle<T = any> {
117
157
  className?: string;
118
158
  divIconOptions?: Pick<L.DivIconOptions, "iconAnchor">;
119
159
  } | undefined;
160
+ getRotate(): number;
161
+ getSpeed(): number;
120
162
  utils: {
121
163
  showTrajektoria(): void;
122
164
  stopTrajektoria(): void;
@@ -152,6 +194,8 @@ export declare class LeafletMarkerHandle<T = any> {
152
194
  className?: string;
153
195
  divIconOptions?: Pick<L.DivIconOptions, "iconAnchor">;
154
196
  } | undefined;
197
+ getRotate(): number;
198
+ getSpeed(): number;
155
199
  utils: {
156
200
  showTrajektoria(): void;
157
201
  stopTrajektoria(): void;
@@ -161,6 +205,7 @@ export declare class LeafletMarkerHandle<T = any> {
161
205
  }>;
162
206
  setFitview(): void;
163
207
  getBounds(): L.LatLngBounds | undefined;
208
+ private getAllMarkerBounds;
164
209
  getAllMarkers(): {
165
210
  getUserData(): unknown;
166
211
  emitsClick(): void;
@@ -188,6 +233,8 @@ export declare class LeafletMarkerHandle<T = any> {
188
233
  className?: string;
189
234
  divIconOptions?: Pick<L.DivIconOptions, "iconAnchor">;
190
235
  } | undefined;
236
+ getRotate(): number;
237
+ getSpeed(): number;
191
238
  utils: {
192
239
  showTrajektoria(): void;
193
240
  stopTrajektoria(): void;
@@ -8,6 +8,8 @@ export declare function createMarkerCustomFromMarker<T>(markerCreated: ReturnTyp
8
8
  map: L.Map;
9
9
  cluster: {
10
10
  proxyRemove(marker: L.Marker): void;
11
+ proxyMarkerActive?(marker: L.Marker): void;
12
+ proxyMarkerInactive?(marker: L.Marker): void;
11
13
  };
12
14
  intervalTick: IntervalTick;
13
15
  realtimeTrackMgr: RealtimeTrackMgr;
@@ -38,6 +40,8 @@ export declare function createMarkerCustomFromMarker<T>(markerCreated: ReturnTyp
38
40
  className?: string;
39
41
  divIconOptions?: Pick<import('leaflet').DivIconOptions, "iconAnchor">;
40
42
  } | undefined;
43
+ getRotate(): number;
44
+ getSpeed(): number;
41
45
  utils: {
42
46
  showTrajektoria(): void;
43
47
  stopTrajektoria(): void;
@@ -0,0 +1,64 @@
1
+ import { default as L } from 'leaflet';
2
+ import { ICanvasNoClusterLayerOptions } from './canvasNoClusterLayer';
3
+
4
+ type GridCluster = {
5
+ x: number;
6
+ y: number;
7
+ worldX: number;
8
+ worldY: number;
9
+ markers: L.Marker[];
10
+ bounds: L.LatLngBounds;
11
+ onlineCount: number;
12
+ };
13
+ export interface IWebGLGridClusterLayerOptions<T> extends ICanvasNoClusterLayerOptions {
14
+ clusterRadius?: number | ((zoom: number) => number);
15
+ onClusterClick?: (userDatas: T[], cluster: GridCluster, utils: {
16
+ getPos: () => L.Point;
17
+ zoomToBounds: () => void;
18
+ }) => void;
19
+ }
20
+ export declare class WebGLGridClusterLayer<T = any> extends L.Layer {
21
+ private layerOptions;
22
+ private map?;
23
+ private clusterCanvas;
24
+ private markerLayer;
25
+ private markers;
26
+ private markerSet;
27
+ private hiddenMarkers;
28
+ private markerChangeHandles;
29
+ private clusters;
30
+ private redrawFrame;
31
+ private topLeft;
32
+ private drawTopLeftLatLng?;
33
+ private drawZoom;
34
+ private zooming;
35
+ private hoverCluster?;
36
+ constructor(layerOptions?: IWebGLGridClusterLayerOptions<T>);
37
+ onAdd(map: L.Map): this;
38
+ onRemove(map: L.Map): this;
39
+ setMarkers(markers: L.Marker[]): void;
40
+ addMarkers(markers: L.Marker[]): void;
41
+ removeMarkers(markers: L.Marker[]): void;
42
+ hideMarker(marker: L.Marker): void;
43
+ showMarker(marker: L.Marker): void;
44
+ redraw(): void;
45
+ private bindMarkerChange;
46
+ private reset;
47
+ private handleZoomStart;
48
+ private animateZoom;
49
+ private scheduleRedraw;
50
+ private cancelRedraw;
51
+ private draw;
52
+ private buildClusters;
53
+ private updateClusterScreenPoint;
54
+ private drawClusters;
55
+ private handleClick;
56
+ private handleMouseMove;
57
+ private clearHover;
58
+ private setHoverCluster;
59
+ private findClusterAt;
60
+ private getClusterFillStyle;
61
+ private getClusterRadius;
62
+ private getClusterDisplayRadius;
63
+ }
64
+ export {};
@@ -0,0 +1,64 @@
1
+ import { default as L } from 'leaflet';
2
+ import { ICanvasNoClusterLayerOptions } from './canvasNoClusterLayer';
3
+
4
+ export declare class WebGLNoClusterLayer extends L.Layer {
5
+ private layerOptions;
6
+ private map?;
7
+ private glCanvas;
8
+ private titleCanvas;
9
+ private gl?;
10
+ private program?;
11
+ private buffers?;
12
+ private locations?;
13
+ private markers;
14
+ private markerSet;
15
+ private hiddenMarkers;
16
+ private markerChangeHandles;
17
+ private markerImageUrls;
18
+ private textures;
19
+ private pendingImages;
20
+ private titleMetricsCache;
21
+ private titleMeasureCanvas;
22
+ private redrawFrame;
23
+ private drawToken;
24
+ private topLeft;
25
+ private drawTopLeftLatLng?;
26
+ private drawZoom;
27
+ private zooming;
28
+ private currentDrawShowTitle;
29
+ constructor(layerOptions?: ICanvasNoClusterLayerOptions);
30
+ onAdd(map: L.Map): this;
31
+ onRemove(map: L.Map): this;
32
+ setMarkers(markers: Array<L.Marker>): void;
33
+ addMarkers(markers: Array<L.Marker>): void;
34
+ removeMarkers(markers: Array<L.Marker>): void;
35
+ hideMarker(marker: L.Marker): void;
36
+ showMarker(marker: L.Marker): void;
37
+ redraw(): void;
38
+ private bindMarkerChange;
39
+ private initGL;
40
+ private reset;
41
+ private handleZoomStart;
42
+ private animateZoom;
43
+ private scheduleRedraw;
44
+ private cancelRedraw;
45
+ private draw;
46
+ private getVisibleMarkers;
47
+ private pushQuad;
48
+ private drawBatch;
49
+ private bindArray;
50
+ private drawTitles;
51
+ private getTexture;
52
+ private createTexture;
53
+ private getMarkerIconLayout;
54
+ private shouldShowTitle;
55
+ private drawTitle;
56
+ private getTitleRect;
57
+ private getTitleMetrics;
58
+ private handleClick;
59
+ private findMarkerAt;
60
+ private isPointInRect;
61
+ private createShader;
62
+ private createProgram;
63
+ private getStringLength;
64
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@besovideo/bvmap-leaflet",
3
- "version": "0.0.43",
3
+ "version": "0.0.45",
4
4
  "description": "",
5
5
  "main": "./dist/main.js",
6
6
  "types": "./dist/types/main.d.ts",