tg-map-core 4.2.1 → 4.2.3

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,62 +1,62 @@
1
- declare namespace BMap {
2
- class OverlayV3 {
3
- initialize(map: Map): HTMLElement
4
- isVisible(): boolean
5
- draw(): void
6
- show(): void
7
- hide(): void
8
- // 这些方法文档中都没写, 但确实可以调用...
9
- addEventListener(event: string, handler: Callback): void
10
- removeEventListener(event: string, handler: Callback): void
11
- /** @param event type名要以'on'开头 */
12
- dispatchEvent(event: { type: string }): void
13
- }
14
- interface Map {
15
- addEventListener(event: string, handler: Callback): void
16
- removeEventListener(event: string, handler: Callback): void
17
- }
18
- interface Autocomplete {
19
- addEventListener(event: string, handler: Callback): void
20
- removeEventListener(event: string, handler: Callback): void
21
- }
22
- interface AutocompleteResultPoi {
23
- city: string
24
- }
25
- interface LocalSearchOptions {
26
- onSearchComplete?: ((results: LocalResult[] | LocalResult) => void) | undefined;
27
- }
28
- interface LocalResultPoi {
29
- uid: string
30
- }
31
-
32
- interface MarkerOptions {
33
- icon?: BMap.Symbol | Icon
34
- }
35
-
36
- interface Marker {
37
- setIcon(icon: Icon | BMap.Symbol): void;
38
- getIcon(): Icon | BMap.Symbol;
39
- }
40
-
41
- interface Symbol {
42
- /** 实际的锚点, 第一次添加到地图上时会为undefined */
43
- anchor?: Size
44
- style: {
45
- /** 设置的锚点 */
46
- anchor: Size
47
- }
48
- }
49
-
50
- interface IconOptions {
51
- imageSize?: Size
52
- }
53
- }
54
-
55
- declare namespace BMapGL {
56
- interface SVGSymbol {
57
- style: {
58
- /** 设置的锚点 */
59
- anchor: Size
60
- }
61
- }
62
- }
1
+ declare namespace BMap {
2
+ class OverlayV3 {
3
+ initialize(map: Map): HTMLElement
4
+ isVisible(): boolean
5
+ draw(): void
6
+ show(): void
7
+ hide(): void
8
+ // 这些方法文档中都没写, 但确实可以调用...
9
+ addEventListener(event: string, handler: Callback): void
10
+ removeEventListener(event: string, handler: Callback): void
11
+ /** @param event type名要以'on'开头 */
12
+ dispatchEvent(event: { type: string }): void
13
+ }
14
+ interface Map {
15
+ addEventListener(event: string, handler: Callback): void
16
+ removeEventListener(event: string, handler: Callback): void
17
+ }
18
+ interface Autocomplete {
19
+ addEventListener(event: string, handler: Callback): void
20
+ removeEventListener(event: string, handler: Callback): void
21
+ }
22
+ interface AutocompleteResultPoi {
23
+ city: string
24
+ }
25
+ interface LocalSearchOptions {
26
+ onSearchComplete?: ((results: LocalResult[] | LocalResult) => void) | undefined;
27
+ }
28
+ interface LocalResultPoi {
29
+ uid: string
30
+ }
31
+
32
+ interface MarkerOptions {
33
+ icon?: BMap.Symbol | Icon
34
+ }
35
+
36
+ interface Marker {
37
+ setIcon(icon: Icon | BMap.Symbol): void;
38
+ getIcon(): Icon | BMap.Symbol;
39
+ }
40
+
41
+ interface Symbol {
42
+ /** 实际的锚点, 第一次添加到地图上时会为undefined */
43
+ anchor?: Size
44
+ style: {
45
+ /** 设置的锚点 */
46
+ anchor: Size
47
+ }
48
+ }
49
+
50
+ interface IconOptions {
51
+ imageSize?: Size
52
+ }
53
+ }
54
+
55
+ declare namespace BMapGL {
56
+ interface SVGSymbol {
57
+ style: {
58
+ /** 设置的锚点 */
59
+ anchor: Size
60
+ }
61
+ }
62
+ }
@@ -1,10 +1,10 @@
1
- declare namespace google.maps {
2
- /** url可以直接作为Icon */
3
- type UrlIcon = string
4
- interface InfoWindow {
5
- /** 获取Map, 文档中没写这个方法 */
6
- getMap(): Map | undefined
7
- /** 获取锚点, 文档中没写这个方法 */
8
- getAnchor(): Marker | undefined
9
- }
10
- }
1
+ declare namespace google.maps {
2
+ /** url可以直接作为Icon */
3
+ type UrlIcon = string
4
+ interface InfoWindow {
5
+ /** 获取Map, 文档中没写这个方法 */
6
+ getMap(): Map | undefined
7
+ /** 获取锚点, 文档中没写这个方法 */
8
+ getAnchor(): Marker | undefined
9
+ }
10
+ }
@@ -1,16 +1,16 @@
1
- // v3.1
2
- declare namespace H {
3
- namespace service {
4
- interface PlatformV31Constructor {
5
- new(options: { apikey: string }): Platform
6
- }
7
- interface PlatformV31 extends Platform {
8
-
9
- }
10
- let PlatformV31: PlatformV31Constructor
11
- interface DefaultLayers {
12
- raster: { normal: H.service.MapType, satellite: H.service.MapType, terrain: H.service.MapType }
13
- vector: { normal: { map: H.map.layer.TileLayer, traffic: H.map.layer.TileLayer, trafficincidents: H.map.layer.MarkerTileLayer } }
14
- }
15
- }
16
- }
1
+ // v3.1
2
+ declare namespace H {
3
+ namespace service {
4
+ interface PlatformV31Constructor {
5
+ new(options: { apikey: string }): Platform
6
+ }
7
+ interface PlatformV31 extends Platform {
8
+
9
+ }
10
+ let PlatformV31: PlatformV31Constructor
11
+ interface DefaultLayers {
12
+ raster: { normal: H.service.MapType, satellite: H.service.MapType, terrain: H.service.MapType }
13
+ vector: { normal: { map: H.map.layer.TileLayer, traffic: H.map.layer.TileLayer, trafficincidents: H.map.layer.MarkerTileLayer } }
14
+ }
15
+ }
16
+ }
@@ -1,4 +1,4 @@
1
- /* eslint-disable @typescript-eslint/triple-slash-reference */
2
- /// <reference path="./baidu.d.ts" preserve="true" />
3
- /// <reference path="./google.d.ts" preserve="true" />
4
- /// <reference path="./here-v31.d.ts" preserve="true" />
1
+ /* eslint-disable @typescript-eslint/triple-slash-reference */
2
+ /// <reference path="./baidu.d.ts" preserve="true" />
3
+ /// <reference path="./google.d.ts" preserve="true" />
4
+ /// <reference path="./here-v31.d.ts" preserve="true" />
@@ -1,15 +1,15 @@
1
- /**
2
- * 当前版本, tsconfig中`allowJs:true`和`declaration:true`不兼容, 导致引用第三方js库时, 无法利用JSDoc的类型注解
3
- * 未来貌似会增加允许两者同时为true的功能, 详见{@link https://github.com/microsoft/TypeScript/pull/32372}
4
- *
5
- * 当前使用两个tsconfig, 达到类似效果:
6
- * 1. tsconfig.json: `allowJs:true`+`declaration:false`, 用来在VSCode中利用第三方JS库的JSDoc注解
7
- * 2. tsconfig.types.json: `allowJs:false`+`declaration:true`, 用来在编译时正常输出.d.ts文件
8
- *
9
- * 而该文件(`js-modules.d.ts`)的作用就是声明用到的第三方js库, 让tsconfig.types.json能够正常编译
10
- *
11
- * typescript 3.7 之后已支持两者同时为true, 该文件暂时没有用, 可以移除
12
- */
13
- // cSpell:ignore bmaplib, markerclusterer
14
- // declare module 'bmaplib.markerclusterer'
15
- // declare module '@google/markerclusterer'
1
+ /**
2
+ * 当前版本, tsconfig中`allowJs:true`和`declaration:true`不兼容, 导致引用第三方js库时, 无法利用JSDoc的类型注解
3
+ * 未来貌似会增加允许两者同时为true的功能, 详见{@link https://github.com/microsoft/TypeScript/pull/32372}
4
+ *
5
+ * 当前使用两个tsconfig, 达到类似效果:
6
+ * 1. tsconfig.json: `allowJs:true`+`declaration:false`, 用来在VSCode中利用第三方JS库的JSDoc注解
7
+ * 2. tsconfig.types.json: `allowJs:false`+`declaration:true`, 用来在编译时正常输出.d.ts文件
8
+ *
9
+ * 而该文件(`js-modules.d.ts`)的作用就是声明用到的第三方js库, 让tsconfig.types.json能够正常编译
10
+ *
11
+ * typescript 3.7 之后已支持两者同时为true, 该文件暂时没有用, 可以移除
12
+ */
13
+ // cSpell:ignore bmaplib, markerclusterer
14
+ // declare module 'bmaplib.markerclusterer'
15
+ // declare module '@google/markerclusterer'
@@ -1,83 +1,83 @@
1
- import * as maptalks from 'maptalks'
2
-
3
- /**
4
- * maptalks的类型声明有点问题, 使用该模块扩展, 规避一些报错
5
- */
6
- declare module 'maptalks' {
7
- interface LayerAbstractRenderer {
8
- setToRedraw(): void
9
- }
10
- type Eventable = InstanceType<ReturnType<typeof Eventable>>
11
- interface Map {
12
- config(options: MapOptionsType): this
13
- config<K extends keyof MapOptionsType>(conf: K, value: MapOptionsType[K]): this
14
- /** @deprecated config()内部会复制一遍options的值, 故如果只是读取, 建议直接使用{@link options}, */
15
- config(): MapOptionsType
16
- }
17
- interface TileLayer {
18
- config(options: TileLayerOptionsType): this
19
- config<K extends keyof TileLayerOptionsType>(conf: K, value: TileLayerOptionsType[K]): this
20
- /** @deprecated */ config(): TileLayerOptionsType
21
- }
22
- interface Marker {
23
- config(options: MarkerOptionsType): this
24
- config<K extends keyof MarkerOptionsType>(conf: K, value: MarkerOptionsType[K]): this
25
- /** @deprecated */ config(): MarkerOptionsType
26
- updateSymbol(props: AnyMarkerSymbol | Array<AnyMarkerSymbol>): this
27
- }
28
- interface Polygon {
29
- config(options: PolygonOptionsType): this
30
- config<K extends keyof PolygonOptionsType>(conf: K, value: PolygonOptionsType[K]): this
31
- /** @deprecated */ config(): PolygonOptionsType
32
- updateSymbol(props: FillSymbol | Array<AnySymbol>): this
33
- }
34
- interface LineString {
35
- config(options: LineStringOptionsType): this
36
- config<K extends keyof LineStringOptionsType>(conf: K, value: LineStringOptionsType[K]): this
37
- /** @deprecated */ config(): LineStringOptionsType
38
- updateSymbol(props: LineSymbol | Array<AnySymbol>): this
39
- }
40
- interface Circle {
41
- config(options: CircleOptionsType): this
42
- config<K extends keyof CircleOptionsType>(conf: K, value: CircleOptionsType[K]): this
43
- /** @deprecated */ config(): CircleOptionsType
44
- updateSymbol(props: FillSymbol | Array<AnySymbol>): this
45
- }
46
- interface Rectangle {
47
- config(options: RectangleOptionsType): this
48
- config<K extends keyof RectangleOptionsType>(conf: K, value: RectangleOptionsType[K]): this
49
- /** @deprecated */ config(): RectangleOptionsType
50
- updateSymbol(props: FillSymbol | Array<AnySymbol>): this
51
- }
52
- namespace ui {
53
- interface UIMarker {
54
- config(options: UIMarkerOptionsType): this
55
- config<K extends keyof UIMarkerOptionsType>(conf: K, value: UIMarkerOptionsType[K]): this
56
- /** @deprecated */ config(): UIMarkerOptionsType
57
- }
58
- interface InfoWindow {
59
- config(options: InfoWindowOptionsType): this
60
- config<K extends keyof InfoWindowOptionsType>(conf: K, value: InfoWindowOptionsType[K]): this
61
- /** @deprecated */ config(): InfoWindowOptionsType
62
- /** 若不传{@link coordinate}则使用owner的中心点 */
63
- show(coordinate?: Coordinate): this
64
- }
65
- }
66
- namespace control {
67
- interface Control {
68
- config(options: ControlOptionsType): this
69
- config<K extends keyof ControlOptionsType>(conf: K, value: ControlOptionsType[K]): this
70
- /** @deprecated */ config(): ControlOptionsType
71
- }
72
- interface Zoom {
73
- config(options: ZoomOptionsTypeSpec & ControlOptionsType): this
74
- config<K extends keyof ZoomOptionsTypeSpec & ControlOptionsType>(conf: K, value: (ZoomOptionsTypeSpec & ControlOptionsType)[K]): this
75
- /** @deprecated */ config(): ZoomOptionsTypeSpec & ControlOptionsType
76
- }
77
- }
78
- /** {@link DomPositionType}里设置transform等其他css样式, 也会生效 */
79
- type FixedDomPositionType = DomPositionType & Partial<Pick<CSSStyleDeclaration, 'transform'>>
80
- }
81
-
82
- // TODO: 使用这个导出的maptalks编译会报错...
83
- export { maptalks }
1
+ import * as maptalks from 'maptalks'
2
+
3
+ /**
4
+ * maptalks的类型声明有点问题, 使用该模块扩展, 规避一些报错
5
+ */
6
+ declare module 'maptalks' {
7
+ interface LayerAbstractRenderer {
8
+ setToRedraw(): void
9
+ }
10
+ type Eventable = InstanceType<ReturnType<typeof Eventable>>
11
+ interface Map {
12
+ config(options: MapOptionsType): this
13
+ config<K extends keyof MapOptionsType>(conf: K, value: MapOptionsType[K]): this
14
+ /** @deprecated config()内部会复制一遍options的值, 故如果只是读取, 建议直接使用{@link options}, */
15
+ config(): MapOptionsType
16
+ }
17
+ interface TileLayer {
18
+ config(options: TileLayerOptionsType): this
19
+ config<K extends keyof TileLayerOptionsType>(conf: K, value: TileLayerOptionsType[K]): this
20
+ /** @deprecated */ config(): TileLayerOptionsType
21
+ }
22
+ interface Marker {
23
+ config(options: MarkerOptionsType): this
24
+ config<K extends keyof MarkerOptionsType>(conf: K, value: MarkerOptionsType[K]): this
25
+ /** @deprecated */ config(): MarkerOptionsType
26
+ updateSymbol(props: AnyMarkerSymbol | Array<AnyMarkerSymbol>): this
27
+ }
28
+ interface Polygon {
29
+ config(options: PolygonOptionsType): this
30
+ config<K extends keyof PolygonOptionsType>(conf: K, value: PolygonOptionsType[K]): this
31
+ /** @deprecated */ config(): PolygonOptionsType
32
+ updateSymbol(props: FillSymbol | Array<AnySymbol>): this
33
+ }
34
+ interface LineString {
35
+ config(options: LineStringOptionsType): this
36
+ config<K extends keyof LineStringOptionsType>(conf: K, value: LineStringOptionsType[K]): this
37
+ /** @deprecated */ config(): LineStringOptionsType
38
+ updateSymbol(props: LineSymbol | Array<AnySymbol>): this
39
+ }
40
+ interface Circle {
41
+ config(options: CircleOptionsType): this
42
+ config<K extends keyof CircleOptionsType>(conf: K, value: CircleOptionsType[K]): this
43
+ /** @deprecated */ config(): CircleOptionsType
44
+ updateSymbol(props: FillSymbol | Array<AnySymbol>): this
45
+ }
46
+ interface Rectangle {
47
+ config(options: RectangleOptionsType): this
48
+ config<K extends keyof RectangleOptionsType>(conf: K, value: RectangleOptionsType[K]): this
49
+ /** @deprecated */ config(): RectangleOptionsType
50
+ updateSymbol(props: FillSymbol | Array<AnySymbol>): this
51
+ }
52
+ namespace ui {
53
+ interface UIMarker {
54
+ config(options: UIMarkerOptionsType): this
55
+ config<K extends keyof UIMarkerOptionsType>(conf: K, value: UIMarkerOptionsType[K]): this
56
+ /** @deprecated */ config(): UIMarkerOptionsType
57
+ }
58
+ interface InfoWindow {
59
+ config(options: InfoWindowOptionsType): this
60
+ config<K extends keyof InfoWindowOptionsType>(conf: K, value: InfoWindowOptionsType[K]): this
61
+ /** @deprecated */ config(): InfoWindowOptionsType
62
+ /** 若不传{@link coordinate}则使用owner的中心点 */
63
+ show(coordinate?: Coordinate): this
64
+ }
65
+ }
66
+ namespace control {
67
+ interface Control {
68
+ config(options: ControlOptionsType): this
69
+ config<K extends keyof ControlOptionsType>(conf: K, value: ControlOptionsType[K]): this
70
+ /** @deprecated */ config(): ControlOptionsType
71
+ }
72
+ interface Zoom {
73
+ config(options: ZoomOptionsTypeSpec & ControlOptionsType): this
74
+ config<K extends keyof ZoomOptionsTypeSpec & ControlOptionsType>(conf: K, value: (ZoomOptionsTypeSpec & ControlOptionsType)[K]): this
75
+ /** @deprecated */ config(): ZoomOptionsTypeSpec & ControlOptionsType
76
+ }
77
+ }
78
+ /** {@link DomPositionType}里设置transform等其他css样式, 也会生效 */
79
+ type FixedDomPositionType = DomPositionType & Partial<Pick<CSSStyleDeclaration, 'transform'>>
80
+ }
81
+
82
+ // TODO: 使用这个导出的maptalks编译会报错...
83
+ export { maptalks }
@@ -1,35 +1,35 @@
1
- declare module 'maptalks.markercluster' {
2
- import * as maptalks from 'maptalks'
3
-
4
- export interface ClusterLayerOptionsType extends maptalks.OverlayLayerOptionsType {
5
- renderer?: string;
6
- /** @default 160 */
7
- maxClusterRadius?: number;
8
- textSumProperty?: string;
9
- symbol?: maptalks.AnyMarkerSymbol;
10
- /** @default true */
11
- drawClusterText?: boolean;
12
- textSymbol?: maptalks.TextSymbol;
13
- /** @default true */
14
- animation?: boolean;
15
- /** @default 450 */
16
- animationDuration?: number;
17
- maxClusterZoom?: number;
18
- /** @default true */
19
- noClusterWithOneMarker?: boolean;
20
- /** @default true */
21
- forceRenderOnZooming?: boolean;
22
- }
23
-
24
- export class ClusterLayer extends maptalks.OverlayLayer {
25
- constructor(name: string, markers?: maptalks.Marker[] | ClusterLayerOptionsType, options?: ClusterLayerOptionsType)
26
- addMarker(markers: maptalks.Marker | maptalks.Marker[]): this
27
- /** @see https://github.com/maptalks/maptalks.markercluster/blob/c2ebb293b04e4ce5560137a1ec093023c8ea81f2/index.js#L283-L286 */
28
- identify(coordinate: Coordinate, options: LayerIdentifyOptionsType): maptalks.Marker[] | { center: maptalks.Coordinate, children: maptalks.Marker[] } | null
29
- getClusters(): { center: maptalks.Coordinate; children: maptalks.Marker[]; count: number; key: string }[]
30
-
31
- config(options: ClusterLayerOptionsType): this
32
- config<K extends keyof ClusterLayerOptionsType>(conf: K, value: ClusterLayerOptionsType[K]): this
33
- config(): ClusterLayerOptionsType
34
- }
35
- }
1
+ declare module 'maptalks.markercluster' {
2
+ import * as maptalks from 'maptalks'
3
+
4
+ export interface ClusterLayerOptionsType extends maptalks.OverlayLayerOptionsType {
5
+ renderer?: string;
6
+ /** @default 160 */
7
+ maxClusterRadius?: number;
8
+ textSumProperty?: string;
9
+ symbol?: maptalks.AnyMarkerSymbol;
10
+ /** @default true */
11
+ drawClusterText?: boolean;
12
+ textSymbol?: maptalks.TextSymbol;
13
+ /** @default true */
14
+ animation?: boolean;
15
+ /** @default 450 */
16
+ animationDuration?: number;
17
+ maxClusterZoom?: number;
18
+ /** @default true */
19
+ noClusterWithOneMarker?: boolean;
20
+ /** @default true */
21
+ forceRenderOnZooming?: boolean;
22
+ }
23
+
24
+ export class ClusterLayer extends maptalks.OverlayLayer {
25
+ constructor(name: string, markers?: maptalks.Marker[] | ClusterLayerOptionsType, options?: ClusterLayerOptionsType)
26
+ addMarker(markers: maptalks.Marker | maptalks.Marker[]): this
27
+ /** @see https://github.com/maptalks/maptalks.markercluster/blob/c2ebb293b04e4ce5560137a1ec093023c8ea81f2/index.js#L283-L286 */
28
+ identify(coordinate: Coordinate, options: LayerIdentifyOptionsType): maptalks.Marker[] | { center: maptalks.Coordinate, children: maptalks.Marker[] } | null
29
+ getClusters(): { center: maptalks.Coordinate; children: maptalks.Marker[]; count: number; key: string }[]
30
+
31
+ config(options: ClusterLayerOptionsType): this
32
+ config<K extends keyof ClusterLayerOptionsType>(conf: K, value: ClusterLayerOptionsType[K]): this
33
+ config(): ClusterLayerOptionsType
34
+ }
35
+ }