@besovideo/bvmap-leaflet 0.0.12 → 0.0.14

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.
@@ -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('./geojsonTest').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,16 @@
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
+ onClick(handle: () => void): void;
16
+ }
@@ -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';
@@ -144,11 +146,14 @@ export declare function CreateMap<T>(params: {
144
146
  getContainer(): HTMLElement;
145
147
  updateContainer(): void;
146
148
  removeAllMarkers(): void;
149
+ setCursor(): {
150
+ resume(): void;
151
+ };
147
152
  };
148
153
  playback: LeafletTrackPlayback;
149
154
  fenceHandle: LeafletEditableHandle;
150
155
  components: {
151
- titleLineMgr: LeafletTitleLineMgr;
156
+ titleLineMgr: LeafletCustomControlsMgr;
152
157
  };
153
158
  conversion: {
154
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;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@besovideo/bvmap-leaflet",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "description": "",
5
5
  "main": "./dist/main.js",
6
6
  "types": "./dist/types/main.d.ts",
7
7
  "type": "module",
8
8
  "scripts": {
9
- "dev": "vite",
9
+ "dev": "vite --force",
10
10
  "build": "vite build"
11
11
  },
12
12
  "keywords": [],
@@ -17,6 +17,8 @@
17
17
  "@types/leaflet-rotate": "^0.1.4",
18
18
  "@types/leaflet.markercluster": "^1.5.4",
19
19
  "@types/node": "^22.9.0",
20
+ "kml": "^0.0.1",
21
+ "togeojson": "^0.16.0",
20
22
  "typescript": "^5.5.4",
21
23
  "vite": "^5.3.4",
22
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 {};