tg-map-core 4.1.3 → 4.1.5
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.
- package/dist/src/index.d.ts +3 -2
- package/dist/src/map/event-target.d.ts +2 -3
- package/dist/src/map/lat-lng.d.ts +2 -0
- package/dist/src/map/map/baidu-map.d.ts +2 -0
- package/dist/src/map/map/controls/control.d.ts +17 -0
- package/dist/src/map/map/controls/map-type.control.d.ts +5 -1
- package/dist/src/map/map/controls/scale.control.d.ts +3 -2
- package/dist/src/map/map/controls/zoom.control.d.ts +15 -2
- package/dist/src/map/map/extra/marker-clusterer.d.ts +75 -5
- package/dist/src/map/map/google-map.d.ts +2 -0
- package/dist/src/map/map/here-map.d.ts +2 -0
- package/dist/src/map/map/map-options.d.ts +24 -2
- package/dist/src/map/map/map.d.ts +7 -3
- package/dist/src/map/map/overlay/baidu-info-box.d.ts +15 -6
- package/dist/src/map/map/overlay/circle.d.ts +10 -1
- package/dist/src/map/map/overlay/icon.d.ts +34 -2
- package/dist/src/map/map/overlay/info-box.d.ts +36 -4
- package/dist/src/map/map/overlay/info-window.d.ts +28 -2
- package/dist/src/map/map/overlay/label.d.ts +19 -4
- package/dist/src/map/map/overlay/marker-label.d.ts +7 -0
- package/dist/src/map/map/overlay/marker.d.ts +46 -5
- package/dist/src/map/map/overlay/overlay.d.ts +9 -1
- package/dist/src/map/map/overlay/polygon.d.ts +8 -1
- package/dist/src/map/map/overlay/polyline.d.ts +8 -1
- package/dist/src/map/map/overlay/rectangle.d.ts +9 -1
- package/dist/src/map/map/overlay/shape.d.ts +12 -2
- package/dist/src/map/map/talks-map.d.ts +33 -29
- package/dist/src/map/map-config.d.ts +11 -2
- package/dist/src/map/map-factory.d.ts +5 -1
- package/dist/src/map/unions.d.ts +5 -1
- package/dist/src/utils/arrays.d.ts +8 -0
- package/dist/src/utils/baidu-utils.d.ts +25 -0
- package/dist/src/utils/objects.d.ts +2 -2
- package/dist/src/{map/talks → utils}/talks-layers.d.ts +3 -3
- package/dist/src/utils/talks-utils.d.ts +24 -0
- package/dist/src/utils/utils.d.ts +5 -0
- package/dist/src/utils/values.d.ts +6 -0
- package/dist/tg-map-core.cjs +10473 -5178
- package/dist/tg-map-core.css +1 -2
- package/dist/tg-map-core.mjs +10459 -5176
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -6
- package/src/map/dts/baidu.d.ts +9 -0
- package/src/map/dts/maptalks.d.ts +74 -2
- package/src/map/dts/maptalks.markercluster.d.ts +35 -0
- package/dist/src/map/talks/talks-utils.d.ts +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tg-map-core",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.5",
|
|
4
4
|
"author": "ipcjs",
|
|
5
5
|
"description": "封装 百度地图, Google地图, Here地图(未完成), Maptalks 的地图库",
|
|
6
6
|
"keywords": [
|
|
@@ -33,21 +33,25 @@
|
|
|
33
33
|
"dist"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@google/markerclusterer": "2.0.9",
|
|
37
36
|
"@types/baidumap-web-sdk": "0.0.11",
|
|
37
|
+
"@types/bmapgl-browser": "github:TranscodeGroup/DefinitelyTyped#path:/types/bmapgl-browser&9ed2593293c552e55d3defc8ca17d13d5f37cf5b",
|
|
38
38
|
"@types/google.maps": "3.51.1",
|
|
39
39
|
"@types/heremaps": "3.0.14",
|
|
40
|
-
"bmaplib.heatmap": "github:TranscodeGroup/BMapLib.Heatmap#v2",
|
|
41
|
-
"bmaplib.markerclusterer": "github:TranscodeGroup/BMapLib.MarkerClusterer#e24e502c4e626a8e698ae3fcb17d0b3c31815f0f",
|
|
42
40
|
"coordtransform": "github:TranscodeGroup/coordtransform#fa1d037ed54bac0beddfd62d2c4c00f882b07004",
|
|
43
41
|
"deepmerge": "^4.3.1",
|
|
44
42
|
"is-plain-object": "3.0.1",
|
|
45
|
-
"maptalks": "1.
|
|
46
|
-
"
|
|
43
|
+
"maptalks": "^1.7.1",
|
|
44
|
+
"maptalks.markercluster": "0.8.8",
|
|
45
|
+
"tg-commons": "^1.2.8"
|
|
47
46
|
},
|
|
48
47
|
"devDependencies": {
|
|
48
|
+
"@google/markerclusterer": "2.0.9",
|
|
49
|
+
"@rollup/plugin-commonjs": "^29.0.0",
|
|
50
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
49
51
|
"@rollup/plugin-replace": "^6.0.2",
|
|
50
52
|
"@rollup/plugin-typescript": "^12.1.2",
|
|
53
|
+
"bmaplib.heatmap": "github:TranscodeGroup/BMapLib.Heatmap#v2",
|
|
54
|
+
"bmaplib.markerclusterer": "github:TranscodeGroup/BMapLib.MarkerClusterer#e24e502c4e626a8e698ae3fcb17d0b3c31815f0f",
|
|
51
55
|
"rollup": "^4.37.0",
|
|
52
56
|
"rollup-plugin-postcss": "^4.0.2",
|
|
53
57
|
"sass": "^1.89.2",
|
package/src/map/dts/baidu.d.ts
CHANGED
|
@@ -1,10 +1,82 @@
|
|
|
1
|
-
|
|
1
|
+
import * as maptalks from 'maptalks'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* maptalks的类型声明有点问题, 使用该模块扩展, 规避一些报错
|
|
5
5
|
*/
|
|
6
6
|
declare module 'maptalks' {
|
|
7
|
+
interface LayerAbstractRenderer {
|
|
8
|
+
setToRedraw():void
|
|
9
|
+
}
|
|
7
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
|
+
config(): MapOptionsType
|
|
15
|
+
}
|
|
16
|
+
interface TileLayer {
|
|
17
|
+
config(options: TileLayerOptionsType): this
|
|
18
|
+
config<K extends keyof TileLayerOptionsType>(conf: K, value: TileLayerOptionsType[K]): this
|
|
19
|
+
config(): TileLayerOptionsType
|
|
20
|
+
}
|
|
21
|
+
interface Marker {
|
|
22
|
+
config(options: MarkerOptionsType): this
|
|
23
|
+
config<K extends keyof MarkerOptionsType>(conf: K, value: MarkerOptionsType[K]): this
|
|
24
|
+
config(): MarkerOptionsType
|
|
25
|
+
updateSymbol(props: AnyMarkerSymbol | Array<AnyMarkerSymbol>): this
|
|
26
|
+
}
|
|
27
|
+
interface Polygon {
|
|
28
|
+
config(options: PolygonOptionsType): this
|
|
29
|
+
config<K extends keyof PolygonOptionsType>(conf: K, value: PolygonOptionsType[K]): this
|
|
30
|
+
config(): PolygonOptionsType
|
|
31
|
+
updateSymbol(props: FillSymbol | Array<AnySymbol>): this
|
|
32
|
+
}
|
|
33
|
+
interface LineString {
|
|
34
|
+
config(options: LineStringOptionsType): this
|
|
35
|
+
config<K extends keyof LineStringOptionsType>(conf: K, value: LineStringOptionsType[K]): this
|
|
36
|
+
config(): LineStringOptionsType
|
|
37
|
+
updateSymbol(props: LineSymbol | Array<AnySymbol>): this
|
|
38
|
+
}
|
|
39
|
+
interface Circle {
|
|
40
|
+
config(options: CircleOptionsType): this
|
|
41
|
+
config<K extends keyof CircleOptionsType>(conf: K, value: CircleOptionsType[K]): this
|
|
42
|
+
config(): CircleOptionsType
|
|
43
|
+
updateSymbol(props: FillSymbol | Array<AnySymbol>): this
|
|
44
|
+
}
|
|
45
|
+
interface Rectangle {
|
|
46
|
+
config(options: RectangleOptionsType): this
|
|
47
|
+
config<K extends keyof RectangleOptionsType>(conf: K, value: RectangleOptionsType[K]): this
|
|
48
|
+
config(): RectangleOptionsType
|
|
49
|
+
updateSymbol(props: FillSymbol | Array<AnySymbol>): this
|
|
50
|
+
}
|
|
51
|
+
namespace ui {
|
|
52
|
+
interface UIMarker {
|
|
53
|
+
config(options: UIMarkerOptionsType): this
|
|
54
|
+
config<K extends keyof UIMarkerOptionsType>(conf: K, value: UIMarkerOptionsType[K]): this
|
|
55
|
+
config(): UIMarkerOptionsType
|
|
56
|
+
}
|
|
57
|
+
interface InfoWindow {
|
|
58
|
+
config(options: InfoWindowOptionsType): this
|
|
59
|
+
config<K extends keyof InfoWindowOptionsType>(conf: K, value: InfoWindowOptionsType[K]): this
|
|
60
|
+
config(): InfoWindowOptionsType
|
|
61
|
+
/** 若不传{@link coordinate}则使用owner的中心点 */
|
|
62
|
+
show(coordinate?: Coordinate): this;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
namespace control {
|
|
66
|
+
interface Control {
|
|
67
|
+
config(options: ControlOptionsType): this
|
|
68
|
+
config<K extends keyof ControlOptionsType>(conf: K, value: ControlOptionsType[K]): this
|
|
69
|
+
config(): ControlOptionsType
|
|
70
|
+
}
|
|
71
|
+
interface Zoom {
|
|
72
|
+
config(options: ZoomOptionsTypeSpec & ControlOptionsType): this
|
|
73
|
+
config<K extends keyof ZoomOptionsTypeSpec & ControlOptionsType>(conf: K, value: (ZoomOptionsTypeSpec & ControlOptionsType)[K]): this
|
|
74
|
+
config(): ZoomOptionsTypeSpec & ControlOptionsType
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/** {@link DomPositionType}里设置transform等其他css样式, 也会生效 */
|
|
78
|
+
type FixedDomPositionType = DomPositionType & Partial<Pick<CSSStyleDeclaration, 'transform'>>
|
|
8
79
|
}
|
|
9
80
|
|
|
10
|
-
|
|
81
|
+
// TODO: 使用这个导出的maptalks编译会报错...
|
|
82
|
+
export { maptalks }
|
|
@@ -0,0 +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
|
+
}
|