@besovideo/bvmap-leaflet 0.0.10 → 0.0.13

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.
@@ -1,9 +1,11 @@
1
+ import { IRenderMarkerCluster } from './markerCluster/index';
1
2
  import { MapType, TileType } from './tmsProviders';
2
3
 
3
4
  declare const glbConfig: {
4
5
  mapType: MapType;
5
6
  tileType: TileType;
6
7
  mapInfoShow: string;
8
+ clusterType: IRenderMarkerCluster<any>["clusterType"];
7
9
  };
8
10
  type ConfigType = typeof glbConfig;
9
11
  export declare function setGlobalConfig(config: Partial<ConfigType>): void;
@@ -11,6 +13,7 @@ export declare function getGlobalConfig(): {
11
13
  mapType: MapType;
12
14
  tileType: TileType;
13
15
  mapInfoShow: string;
16
+ clusterType: IRenderMarkerCluster<any>["clusterType"];
14
17
  };
15
18
  export declare function watchConfigChange<T extends keyof ConfigType>(configItemType: T, handle: (val: ConfigType[T], config: ConfigType, configItemType: T) => void, runNow?: boolean): () => void;
16
19
  export declare function getConfigItem<T extends keyof ConfigType>(configItemType: T): [ConfigType[T], ConfigType];
@@ -0,0 +1,29 @@
1
+ import { IShapeExtraInfo } from './index';
2
+ import { ICustomControls } from './utils';
3
+
4
+ export interface ICustomControlsCircleInit extends IShapeExtraInfo {
5
+ circleInfo?: {
6
+ center: L.LatLngTuple;
7
+ radius: number;
8
+ };
9
+ title: string;
10
+ color: string;
11
+ opacity: number;
12
+ polygonStrokeWidth: number;
13
+ onDrawingEnd?: () => void;
14
+ }
15
+ export declare class CustomControlsCircle implements ICustomControls<ICustomControlsCircleInit, "circleInfo"> {
16
+ private map;
17
+ private circle;
18
+ private infoCircle;
19
+ private titleMarker;
20
+ private radiusMarker;
21
+ constructor(map: L.Map, infoCircle: ICustomControlsCircleInit);
22
+ private update;
23
+ enableEdit(): void;
24
+ disableEdit(): void;
25
+ getInfo(): ICustomControlsCircleInit;
26
+ setInfo(params: Partial<ICustomControlsCircleInit>): void;
27
+ onClick(handle: () => void): void;
28
+ remove(): void;
29
+ }
@@ -0,0 +1,17 @@
1
+ export interface DistanceToolsTexts {
2
+ start: string;
3
+ end: string;
4
+ total: string;
5
+ kiloMeter: string;
6
+ drawingEnd?: () => void;
7
+ onMove?: () => void;
8
+ }
9
+ export declare class DistanceTools {
10
+ path: L.Polyline;
11
+ map: L.Map;
12
+ params: DistanceToolsTexts;
13
+ constructor(map: L.Map, params: DistanceToolsTexts);
14
+ private titleArray;
15
+ private update;
16
+ remove(): void;
17
+ }
@@ -0,0 +1,16 @@
1
+ import { MakerTitle } from './titleMarker';
2
+
3
+ export type TitleType = "START" | "NORMAL" | "END" | "CENTER";
4
+ export declare class DistanceToolsMarkerTitle {
5
+ titleMarker: MakerTitle;
6
+ titleType: TitleType;
7
+ setTitle: (title: string) => void;
8
+ private updateTitle;
9
+ constructor(map: L.Map, onClose: () => void, onDelete: () => void);
10
+ SetLatlng(latlng?: L.LatLngExpression): void;
11
+ remove(): void;
12
+ SetTitleType(titleType: TitleType): void;
13
+ private kiloMeter;
14
+ setUserData(kiloMeter: number): void;
15
+ getUserData(): number;
16
+ }
@@ -0,0 +1,12 @@
1
+ export interface IGeoProperties {
2
+ name: string;
3
+ stroke?: string;
4
+ "stroke-opacity"?: number;
5
+ "stroke-width"?: number;
6
+ description?: string;
7
+ }
8
+ export declare function ParseGeoJsonToPathInfo(geoJson: GeoJSON.FeatureCollection<GeoJSON.Geometry, IGeoProperties>): {
9
+ position: L.LatLngTuple | Array<L.LatLngTuple>;
10
+ props: IGeoProperties;
11
+ type: "Point" | "LineString";
12
+ }[];
@@ -0,0 +1,41 @@
1
+ import { ITitileLineInfoInit, LeafletTitleLine } from './titleLine';
2
+ import { CustomControlsMarker, ICustomControlsMarkerInit } from './maker';
3
+ import { CustomControlsPolygon, ICustomControlsPolygon } from './polygon';
4
+ import { CustomControlsCircle, ICustomControlsCircleInit } from './circle';
5
+ import { CustomControlsRectangle, ICustomControlsRectangleInit } from './rectangle';
6
+ import { DistanceTools, DistanceToolsTexts } from './distanceTools';
7
+ import { IAreaToolsInit, PolygonAreaTools } from './polygonAreaTools';
8
+
9
+ export type TShapeType = keyof ShapeTypeMap;
10
+ export interface ShapeTypeMap {
11
+ MARKER: ReturnType<LeafletCustomControlsMgr["addMarker"]>;
12
+ POLYLINE: ReturnType<LeafletCustomControlsMgr["addLine"]>;
13
+ POLYGON: ReturnType<LeafletCustomControlsMgr["addPolygon"]>;
14
+ RECTANGLE: ReturnType<LeafletCustomControlsMgr["addRectangle"]>;
15
+ CIRCLE: ReturnType<LeafletCustomControlsMgr["addCircle"]>;
16
+ }
17
+ export interface IShapeExtraInfo {
18
+ id?: string;
19
+ isSave?: boolean;
20
+ decription?: string;
21
+ }
22
+ export declare function ParseShapeType<T extends TShapeType>(shapeType: T, obj: any): ShapeTypeMap[T];
23
+ export interface IShapeTypeAppend {
24
+ shapeType: TShapeType;
25
+ }
26
+ export declare class LeafletCustomControlsMgr {
27
+ private map;
28
+ constructor(map: L.Map);
29
+ addLine(info: ITitileLineInfoInit): LeafletTitleLine & IShapeTypeAppend;
30
+ addMarker(info: ICustomControlsMarkerInit): CustomControlsMarker & IShapeTypeAppend;
31
+ addPolygon(info: ICustomControlsPolygon): CustomControlsPolygon & IShapeTypeAppend;
32
+ addCircle(info: ICustomControlsCircleInit): CustomControlsCircle & IShapeTypeAppend;
33
+ addRectangle(info: ICustomControlsRectangleInit): CustomControlsRectangle & IShapeTypeAppend;
34
+ addDistanceRule(params: DistanceToolsTexts): DistanceTools;
35
+ addPolygonAreaRule(params: IAreaToolsInit): PolygonAreaTools;
36
+ parseGeoJson(geoJson: GeoJSON.FeatureCollection): {
37
+ position: L.LatLngTuple | Array<L.LatLngTuple>;
38
+ props: import('./geojson').IGeoProperties;
39
+ type: "Point" | "LineString";
40
+ }[];
41
+ }
@@ -0,0 +1,39 @@
1
+ import { IShapeExtraInfo } from './index';
2
+ import { ICustomControls } from './utils';
3
+
4
+ export interface ICustomControlsMarker {
5
+ latlng: L.LatLngTuple;
6
+ }
7
+ export interface ICustomControlsMarkerInit extends IShapeExtraInfo {
8
+ title: string;
9
+ color: string;
10
+ size: number;
11
+ showName: boolean;
12
+ latlng?: L.LatLngTuple;
13
+ onDrawingEnd?: () => void;
14
+ }
15
+ export type ICustomControlsMarkerInitStyle = Omit<ICustomControlsMarkerInit, "latlng">;
16
+ export declare class CustomControlsMarker implements ICustomControls<ICustomControlsMarkerInit, "latlng"> {
17
+ map: L.Map;
18
+ marker: L.Marker;
19
+ html: HTMLDivElement;
20
+ markerInfo: ICustomControlsMarkerInit;
21
+ constructor(map: L.Map, markerInitInfo: ICustomControlsMarkerInit);
22
+ enableEdit(): void;
23
+ disableEdit(): void;
24
+ setInfo(params: Partial<Omit<ICustomControlsMarkerInit, "latlng">>): void;
25
+ private SetStyle;
26
+ onClick(handleClick: () => void): void;
27
+ getInfo(): {
28
+ latlng: L.LatLngTuple;
29
+ title: string;
30
+ color: string;
31
+ size: number;
32
+ showName: boolean;
33
+ onDrawingEnd?: () => void;
34
+ id?: string;
35
+ isSave?: boolean;
36
+ decription?: string;
37
+ };
38
+ remove(): void;
39
+ }
@@ -0,0 +1,35 @@
1
+ import { IShapeExtraInfo } from './index';
2
+ import { ICustomControls } from './utils';
3
+
4
+ export interface ICustomControlsPolygon extends IShapeExtraInfo {
5
+ color: string;
6
+ latlngs?: Array<L.LatLngTuple>;
7
+ opacity: number;
8
+ title: string;
9
+ polygonStrokeWidth: number;
10
+ onDrawingEnd?: () => void;
11
+ }
12
+ export declare class CustomControlsPolygon implements ICustomControls<ICustomControlsPolygon, "latlngs"> {
13
+ private polygonInfo;
14
+ private polygon;
15
+ private markerTitle;
16
+ constructor(map: L.Map, polygonInfo: ICustomControlsPolygon);
17
+ setInfo(params: Partial<Omit<ICustomControlsPolygon, "latlngs">>): void;
18
+ onClick(handle: () => void): void;
19
+ private SetStyle;
20
+ enableEdit(): void;
21
+ disableEdit(): void;
22
+ getInfo(): {
23
+ latlngs: import('leaflet').LatLngTuple[];
24
+ color: string;
25
+ opacity: number;
26
+ title: string;
27
+ polygonStrokeWidth: number;
28
+ onDrawingEnd?: () => void;
29
+ id?: string;
30
+ isSave?: boolean;
31
+ decription?: string;
32
+ };
33
+ OnClick(handleClick: () => void): void;
34
+ remove(): void;
35
+ }
@@ -0,0 +1,16 @@
1
+ export interface IAreaToolsInit {
2
+ kiloMeterSquare: string;
3
+ MeterSquare: string;
4
+ color: string;
5
+ onRemove?(): void;
6
+ onDrawingEnd?(): void;
7
+ }
8
+ export declare class PolygonAreaTools {
9
+ private map;
10
+ private titleMarker;
11
+ private polygon;
12
+ private params;
13
+ constructor(map: L.Map, params: IAreaToolsInit);
14
+ private update;
15
+ remove(): void;
16
+ }
@@ -0,0 +1,27 @@
1
+ import { IShapeExtraInfo } from './index';
2
+ import { ICustomControls } from './utils';
3
+
4
+ export interface ICustomControlsRectangleInit extends IShapeExtraInfo {
5
+ reacInfo?: {
6
+ latlngBounds: L.LatLngBoundsLiteral;
7
+ };
8
+ color: string;
9
+ polygonStrokeWidth: number;
10
+ opacity: number;
11
+ title: string;
12
+ onDrawingEnd?: () => void;
13
+ }
14
+ export declare class CustomControlsRectangle implements ICustomControls<ICustomControlsRectangleInit, "reacInfo"> {
15
+ private map;
16
+ private rectangle;
17
+ private rectangleInfo;
18
+ private titleMarker;
19
+ constructor(map: L.Map, init: ICustomControlsRectangleInit);
20
+ enableEdit(): void;
21
+ disableEdit(): void;
22
+ getInfo(): ICustomControlsRectangleInit;
23
+ setInfo(params: Partial<Omit<ICustomControlsRectangleInit, "reacInfo">>): void;
24
+ private update;
25
+ onClick(handle: () => void): void;
26
+ remove(): void;
27
+ }
@@ -0,0 +1,49 @@
1
+ import { IShapeExtraInfo } from './index';
2
+ import { ICustomControls } from './utils';
3
+
4
+ export interface ITitileLineInfo extends IShapeExtraInfo {
5
+ latlngs: Array<L.LatLngExpression>;
6
+ title: string;
7
+ color: string;
8
+ lineStyle: "dashed" | "solid";
9
+ polygonStrokeWidth: number;
10
+ onDrawingEnd?: () => void;
11
+ }
12
+ export type ITitileLineInfoInit = Omit<ITitileLineInfo, "latlngs"> & {
13
+ latlngs?: Array<L.LatLngExpression>;
14
+ };
15
+ export declare class LeafletTitleLine implements ICustomControls<ITitileLineInfo, "latlngs"> {
16
+ private map;
17
+ private polyline;
18
+ private marker;
19
+ private html;
20
+ private titleLatlng;
21
+ private onRemove;
22
+ private lineInfo;
23
+ constructor(map: L.Map, lineInfo: ITitileLineInfo, onRemove: () => void);
24
+ enableEdit(): void;
25
+ disableEdit(): void;
26
+ setInfo(params: Partial<Omit<ITitileLineInfo, "latlngs">>): void;
27
+ private setLineStyle;
28
+ private load;
29
+ getInfo(): {
30
+ latlngs: import('leaflet').LatLngTuple[];
31
+ title: string;
32
+ color: string;
33
+ lineStyle: "dashed" | "solid";
34
+ polygonStrokeWidth: number;
35
+ onDrawingEnd?: () => void;
36
+ id?: string;
37
+ isSave?: boolean;
38
+ decription?: string;
39
+ };
40
+ disableEditable(): void;
41
+ private tryInitLatlng;
42
+ private setPathStyle;
43
+ enableEditable(): void;
44
+ private title;
45
+ private updateTitle;
46
+ remove(): void;
47
+ setTitle(title: string): void;
48
+ onClick(onHandle: (line: LeafletTitleLine) => void): void;
49
+ }
@@ -0,0 +1,15 @@
1
+ export declare class MakerTitle {
2
+ private html;
3
+ private marker;
4
+ private map;
5
+ private icon;
6
+ constructor(map: L.Map);
7
+ private latlngTitle;
8
+ setLatlng(latlng?: L.LatLngExpression): void;
9
+ private updata;
10
+ private title;
11
+ private titleHtml;
12
+ setTitle(title: string): void;
13
+ setTitleHtml(titleHtml?: HTMLDivElement): void;
14
+ remove(): void;
15
+ }
@@ -0,0 +1,8 @@
1
+ export interface ICustomControls<TInit, M extends keyof TInit> {
2
+ enableEdit(): void;
3
+ disableEdit(): void;
4
+ getInfo(): TInit;
5
+ setInfo(params: Partial<Omit<TInit, M>>): void;
6
+ onClick(handle: () => void): void;
7
+ remove(): void;
8
+ }
@@ -3,8 +3,10 @@ import { MapType, ICustomMapInfo, TileType } from './tmsProviders';
3
3
  import { IAddMarkerParams, ILeafletCustomMarker, IRenderMarkerCluster, LeafletMarkerHandle } from './markerCluster/index';
4
4
  import { LeafletTrackPlayback } from './trackPlayback/index';
5
5
  import { LeafletEditableHandle } from './leafletEditable/index';
6
- import { LeafletTitleLineMgr } from './titleLine/index';
6
+ import { LeafletCustomControlsMgr } from './customControls/index';
7
7
 
8
+ export { ParseShapeType as ParseShapeType } from './customControls/index';
9
+ export type { TShapeType, ShapeTypeMap, IShapeTypeAppend, IShapeExtraInfo } from './customControls/index';
8
10
  export { PolygonHandle as LeaflePolygonEditHandle, ClrcleHandle as LeafletCicleEditHandle, } from './leafletEditable/index';
9
11
  export type { ILeafletCustomMarker } from './markerCluster/index';
10
12
  export type { LeafletInfoWindow } from './infoWindow/index';
@@ -15,6 +17,7 @@ export declare function SwichTileType(params: {
15
17
  custom?: ICustomMapInfo;
16
18
  }): void;
17
19
  export declare function SetMapBottomLeftShow(info: string): void;
20
+ export declare function SetMapClusterType(clusterType: IRenderMarkerCluster<any>["clusterType"]): void;
18
21
  export type ICustomLeafletMap = ReturnType<typeof CreateMap>;
19
22
  export type { IRenderMarkerCluster } from './markerCluster/index';
20
23
  export type { LeafletTrackPlaybackPoint } from './trackPlayback/index';
@@ -143,11 +146,14 @@ export declare function CreateMap<T>(params: {
143
146
  getContainer(): HTMLElement;
144
147
  updateContainer(): void;
145
148
  removeAllMarkers(): void;
149
+ setCursor(): {
150
+ resume(): void;
151
+ };
146
152
  };
147
153
  playback: LeafletTrackPlayback;
148
154
  fenceHandle: LeafletEditableHandle;
149
155
  components: {
150
- titleLineMgr: LeafletTitleLineMgr;
156
+ titleLineMgr: LeafletCustomControlsMgr;
151
157
  };
152
158
  conversion: {
153
159
  containerPointToLatLng(point: [x: number, y: number]): L.LatLng;
@@ -15,6 +15,9 @@ export declare class LeafletMutilsEditableHandle {
15
15
  addPolygonHandle(): PolygonHandle;
16
16
  clear(): void;
17
17
  }
18
+ export declare function setMapEditCursor(map: L.Map, cursor?: string): {
19
+ resume(): void;
20
+ };
18
21
  export declare class PolygonHandle {
19
22
  private polygon;
20
23
  private map;
@@ -5,6 +5,7 @@ import { createMarkerCustomFromMarker } from './marker';
5
5
  export interface IRenderMarkerCluster<T> {
6
6
  rendeCluster?: (userDatas: Array<T>, map: L.Map, cluster: ReturnType<LeafletMarkerHandle<any>["getCurrentZoomCluster"]>) => L.DivIcon;
7
7
  onClusterClick?: (userDatas: Array<T>, cluster: L.MarkerCluster, map: L.Map) => void;
8
+ clusterType?: "NORMAL" | "NO_CLUSTER";
8
9
  }
9
10
  export type ILeafletCustomMarker = ReturnType<typeof createMarkerCustomFromMarker>;
10
11
  export interface IAddMarkerParams<T> {
@@ -18,7 +19,7 @@ export interface IAddMarkerParams<T> {
18
19
  options?: L.MarkerOptions;
19
20
  }
20
21
  export declare class IntervalTick {
21
- constructor(cluster: L.MarkerClusterGroup);
22
+ constructor();
22
23
  private tasks;
23
24
  push(task: () => void): Promise<void>;
24
25
  }
@@ -32,11 +33,13 @@ export declare class LeafletMarkerHandle<T = any> {
32
33
  private freshCurrentZoomCluster;
33
34
  getCurrentZoomCluster(cluster: L.MarkerCluster): {
34
35
  utils: {
36
+ getPos: () => L.Point;
35
37
  freshIcons: () => void;
36
38
  };
37
39
  currentId: string;
38
40
  };
39
41
  private gRealtimeTrack;
42
+ private radius;
40
43
  constructor(map: L.Map, renderOptions: IRenderMarkerCluster<T>);
41
44
  private clusterClickHandle;
42
45
  on(eventType: "clusterclick", handle: (userDatas: T[], utils: {
@@ -45,6 +48,10 @@ export declare class LeafletMarkerHandle<T = any> {
45
48
  }) => void): void;
46
49
  off(eventType: "clusterclick", handle: Parameters<LeafletMarkerHandle["on"]>[1]): void;
47
50
  private iconCreateFunction;
51
+ setMaxClusterRadius(radius: number): void;
52
+ private szMarkers;
53
+ private addMarkerWrapper;
54
+ proxyRemove(marker: L.Marker): void;
48
55
  addMarkers(markerInfos: Array<IAddMarkerParams<T>>): {
49
56
  getUserData(): T;
50
57
  emitsClick(): void;
@@ -6,7 +6,9 @@ import { CreateMarker } from './utils';
6
6
  export declare function createMarkerCustomFromMarker<T>(markerCreated: ReturnType<typeof CreateMarker>, addParams: IAddMarkerParams<T>, addition: {
7
7
  infoWindow: LeafletInfoWindow;
8
8
  map: L.Map;
9
- cluster: L.MarkerClusterGroup;
9
+ cluster: {
10
+ proxyRemove(marker: L.Marker): void;
11
+ };
10
12
  intervalTick: IntervalTick;
11
13
  realtimeTrackMgr: RealtimeTrackMgr;
12
14
  }): {
@@ -6,8 +6,9 @@ interface Icustom {
6
6
  onTooltipUpdata?: IRealtimeTrackEvents["onTooltipUpdate"];
7
7
  }
8
8
  export declare class PolylineTrack extends L.Polyline {
9
+ private cicleColorMy?;
9
10
  constructor(latlngs: L.LatLngExpression[] | L.LatLngExpression[][], options?: L.PolylineOptions & {
10
- custom: Icustom;
11
+ custom?: Icustom;
11
12
  });
12
13
  private customData;
13
14
  private myCircleBorder;
@@ -21,5 +22,6 @@ export declare class PolylineTrack extends L.Polyline {
21
22
  title: string;
22
23
  value: string;
23
24
  }>): this;
25
+ private filterCircleMarkers;
24
26
  }
25
27
  export {};
@@ -4,6 +4,7 @@ export declare class RealtimeTrackMgr {
4
4
  private tooltipContentDiv;
5
5
  private tooltip;
6
6
  private mapTrajektoria;
7
+ private getColor;
7
8
  private getTrajektoria;
8
9
  startTrajektoria(marker: L.Marker): void;
9
10
  stopTrajektoria(marker: L.Marker): void;
@@ -3,7 +3,7 @@ export declare class TrajektoriaAndTrack {
3
3
  private marker;
4
4
  private map;
5
5
  private currentMarker;
6
- constructor(map: L.Map, marker: L.Marker);
6
+ constructor(map: L.Map, marker: L.Marker, lineOptions: L.PolylineOptions);
7
7
  private onMarker;
8
8
  private bTrajektoriaing;
9
9
  private bTracking;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@besovideo/bvmap-leaflet",
3
- "version": "0.0.10",
3
+ "version": "0.0.13",
4
4
  "description": "",
5
5
  "main": "./dist/main.js",
6
6
  "types": "./dist/types/main.d.ts",
@@ -16,6 +16,9 @@
16
16
  "@types/leaflet-editable": "^1.2.6",
17
17
  "@types/leaflet-rotate": "^0.1.4",
18
18
  "@types/leaflet.markercluster": "^1.5.4",
19
+ "@types/node": "^22.9.0",
20
+ "kml": "^0.0.1",
21
+ "togeojson": "^0.16.0",
19
22
  "typescript": "^5.5.4",
20
23
  "vite": "^5.3.4",
21
24
  "vite-plugin-dts": "4.0.0-beta.2"
@@ -1,12 +0,0 @@
1
- export declare class LeafletTitleLineMgr {
2
- private map;
3
- constructor(map: L.Map);
4
- private lines;
5
- addLine(latlngs: Array<L.LatLngTuple>, title: string): LeafletTitleLine;
6
- }
7
- declare class LeafletTitleLine {
8
- private map;
9
- private polyline;
10
- constructor(map: L.Map, latlngs: Array<L.LatLngTuple>, title: string);
11
- }
12
- export {};