tg-map-core 4.1.4 → 4.1.6

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.
Files changed (45) hide show
  1. package/dist/src/index.d.ts +3 -2
  2. package/dist/src/map/event-target.d.ts +2 -3
  3. package/dist/src/map/lat-lng.d.ts +2 -0
  4. package/dist/src/map/map/baidu-map.d.ts +2 -0
  5. package/dist/src/map/map/controls/control.d.ts +17 -0
  6. package/dist/src/map/map/controls/map-type.control.d.ts +5 -1
  7. package/dist/src/map/map/controls/scale.control.d.ts +3 -2
  8. package/dist/src/map/map/controls/zoom.control.d.ts +15 -2
  9. package/dist/src/map/map/extra/marker-clusterer.d.ts +75 -5
  10. package/dist/src/map/map/google-map.d.ts +2 -0
  11. package/dist/src/map/map/here-map.d.ts +2 -0
  12. package/dist/src/map/map/map-options.d.ts +24 -2
  13. package/dist/src/map/map/map.d.ts +7 -3
  14. package/dist/src/map/map/overlay/baidu-info-box.d.ts +15 -6
  15. package/dist/src/map/map/overlay/circle.d.ts +10 -1
  16. package/dist/src/map/map/overlay/icon.d.ts +34 -2
  17. package/dist/src/map/map/overlay/info-box.d.ts +36 -4
  18. package/dist/src/map/map/overlay/info-window.d.ts +28 -2
  19. package/dist/src/map/map/overlay/label.d.ts +19 -4
  20. package/dist/src/map/map/overlay/marker-label.d.ts +7 -0
  21. package/dist/src/map/map/overlay/marker.d.ts +46 -5
  22. package/dist/src/map/map/overlay/overlay.d.ts +9 -1
  23. package/dist/src/map/map/overlay/polygon.d.ts +8 -1
  24. package/dist/src/map/map/overlay/polyline.d.ts +8 -1
  25. package/dist/src/map/map/overlay/rectangle.d.ts +9 -1
  26. package/dist/src/map/map/overlay/shape.d.ts +12 -2
  27. package/dist/src/map/map/talks-map.d.ts +33 -29
  28. package/dist/src/map/map-config.d.ts +11 -2
  29. package/dist/src/map/map-factory.d.ts +5 -1
  30. package/dist/src/map/unions.d.ts +5 -1
  31. package/dist/src/utils/arrays.d.ts +8 -0
  32. package/dist/src/utils/baidu-utils.d.ts +25 -0
  33. package/dist/src/utils/objects.d.ts +2 -2
  34. package/dist/src/utils/talks-layers.d.ts +9 -0
  35. package/dist/src/utils/talks-utils.d.ts +24 -0
  36. package/dist/src/utils/utils.d.ts +5 -0
  37. package/dist/src/utils/values.d.ts +6 -0
  38. package/dist/tg-map-core.cjs +6761 -5498
  39. package/dist/tg-map-core.css +1 -2
  40. package/dist/tg-map-core.mjs +6747 -5499
  41. package/dist/tsconfig.tsbuildinfo +1 -1
  42. package/package.json +5 -3
  43. package/src/map/dts/baidu.d.ts +9 -0
  44. package/src/map/dts/maptalks.d.ts +74 -2
  45. package/src/map/dts/maptalks.markercluster.d.ts +35 -0
@@ -51,3 +51,12 @@ declare namespace BMap {
51
51
  imageSize?: Size
52
52
  }
53
53
  }
54
+
55
+ declare namespace BMapGL {
56
+ interface SVGSymbol {
57
+ style: {
58
+ /** 设置的锚点 */
59
+ anchor: Size
60
+ }
61
+ }
62
+ }
@@ -1,10 +1,82 @@
1
- // cspell: ignore zindex
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
- export { }
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
+ }