tg-map-core 4.1.8 → 4.2.1
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/map/event-target.d.ts +6 -0
- package/dist/src/map/map/baidu-map.d.ts +0 -3
- package/dist/src/map/map/controls/map-type.control.d.ts +4 -3
- package/dist/src/map/map/google-map.d.ts +0 -3
- package/dist/src/map/map/here-map.d.ts +0 -3
- package/dist/src/map/map/map-options.d.ts +5 -0
- package/dist/src/map/map/map-type.d.ts +5 -1
- package/dist/src/map/map/map.d.ts +2 -2
- package/dist/src/map/map/overlay/circle.d.ts +8 -2
- package/dist/src/map/map/overlay/icon.d.ts +1 -1
- package/dist/src/map/map/overlay/label.d.ts +2 -0
- package/dist/src/map/map/overlay/marker.d.ts +2 -0
- package/dist/src/map/map/overlay/overlay.d.ts +13 -2
- package/dist/src/map/map/overlay/polygon.d.ts +2 -1
- package/dist/src/map/map/overlay/polyline.d.ts +2 -1
- package/dist/src/map/map/overlay/rectangle.d.ts +2 -0
- package/dist/src/map/map/overlay/shape.d.ts +15 -0
- package/dist/src/map/map/talks-map.d.ts +18 -6
- package/dist/src/map/map-config.d.ts +3 -1
- package/dist/src/utils/talks-layers.d.ts +8 -4
- package/dist/tg-map-core.cjs +340 -86
- package/dist/tg-map-core.mjs +341 -87
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/map/dts/maptalks.d.ts +13 -12
|
@@ -65,7 +65,13 @@ export declare class TalksEventTargetDelegate<T extends UnionTalksEventTarget =
|
|
|
65
65
|
static EVENT_TYPE_MAP: {
|
|
66
66
|
'center-changed': string;
|
|
67
67
|
'zoom-changed': string;
|
|
68
|
+
'map-type-changed': string;
|
|
68
69
|
} & Record<string, string | undefined>;
|
|
70
|
+
private eventTypeMap;
|
|
71
|
+
/**
|
|
72
|
+
* @param eventTypeMap 额外的事件类型映射
|
|
73
|
+
*/
|
|
74
|
+
constructor(inner: T, coordTypeSupplier: CoordTypeSupplier, eventTypeMap?: Record<string, string>);
|
|
69
75
|
addEventListener(type: string, listener: Tg.EventListener): void;
|
|
70
76
|
removeEventListener(type: string, listener: Tg.EventListener): void;
|
|
71
77
|
}
|
|
@@ -20,7 +20,6 @@ import { BaiduInfoBoxOverlay } from './overlay/info-box';
|
|
|
20
20
|
import { BaiduInfoWindow } from './overlay/info-window';
|
|
21
21
|
import { BaiduLabelOverlay } from './overlay/label';
|
|
22
22
|
import { BaiduMarker } from './overlay/marker';
|
|
23
|
-
import type { BaiduOverlay } from './overlay/overlay';
|
|
24
23
|
import { BaiduPolygon } from './overlay/polygon';
|
|
25
24
|
import { BaiduPolyline } from './overlay/polyline';
|
|
26
25
|
import { BaiduRectangle } from './overlay/rectangle';
|
|
@@ -59,8 +58,6 @@ export declare class BaiduMap extends BaseMap {
|
|
|
59
58
|
getBounds(): LatLngBounds;
|
|
60
59
|
addElementOverlay(overlay: ElementOverlay): void;
|
|
61
60
|
removeElementOverlay(overlay: ElementOverlay): void;
|
|
62
|
-
addOverlay(overlay: BaiduOverlay): void;
|
|
63
|
-
removeOverlay(overlay: BaiduOverlay): void;
|
|
64
61
|
addCustomControl(control: CustomControl): void;
|
|
65
62
|
removeCustomControl(control: CustomControl): void;
|
|
66
63
|
createLabel: typeof BaiduLabelOverlay.create;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import * as maptalks from 'maptalks';
|
|
1
2
|
import type { BaiduMap } from '../baidu-map';
|
|
2
3
|
import type { GoogleMap } from '../google-map';
|
|
3
4
|
import { MapType } from '../map-type';
|
|
4
5
|
import type { TalksMap } from '../talks-map';
|
|
5
|
-
import { AbstractControl, BaiduControl, ControlPosition, EmptyControl, GoogleControl } from './control';
|
|
6
|
+
import { AbstractControl, BaiduControl, ControlPosition, EmptyControl, GoogleControl, TalksControl } from './control';
|
|
6
7
|
export interface MapTypeControl extends AbstractControl {
|
|
7
8
|
}
|
|
8
9
|
export declare enum MapTypeControlType {
|
|
@@ -17,7 +18,7 @@ export interface MapTypeControlOptions {
|
|
|
17
18
|
mapTypes?: MapType[];
|
|
18
19
|
}
|
|
19
20
|
export declare class BaiduMapTypeControl extends BaiduControl<BMap.MapTypeControl> implements MapTypeControl {
|
|
20
|
-
static create(this: BaiduMap, options: MapTypeControlOptions): BaiduMapTypeControl;
|
|
21
|
+
static create(this: BaiduMap, options: MapTypeControlOptions): EmptyControl | BaiduMapTypeControl;
|
|
21
22
|
}
|
|
22
23
|
export declare class GoogleMapTypeControl extends GoogleControl implements MapTypeControl {
|
|
23
24
|
type: MapTypeControlType;
|
|
@@ -28,6 +29,6 @@ export declare class GoogleMapTypeControl extends GoogleControl implements MapTy
|
|
|
28
29
|
onCreateOptions(): any;
|
|
29
30
|
addTo(map: GoogleMap): void;
|
|
30
31
|
}
|
|
31
|
-
export declare class TalksMapTypeControl extends
|
|
32
|
+
export declare class TalksMapTypeControl extends TalksControl<maptalks.control.LayerSwitcher> implements MapTypeControl {
|
|
32
33
|
static create(this: TalksMap, options: MapTypeControlOptions): TalksMapTypeControl;
|
|
33
34
|
}
|
|
@@ -20,7 +20,6 @@ import { GoogleInfoBoxOverlay } from './overlay/info-box';
|
|
|
20
20
|
import { GoogleInfoWindow } from './overlay/info-window';
|
|
21
21
|
import { GoogleLabelOverlay } from './overlay/label';
|
|
22
22
|
import { GoogleMarker } from './overlay/marker';
|
|
23
|
-
import type { GoogleOverlay } from './overlay/overlay';
|
|
24
23
|
import { GooglePolygon } from './overlay/polygon';
|
|
25
24
|
import { GooglePolyline } from './overlay/polyline';
|
|
26
25
|
import { GoogleRectangle } from './overlay/rectangle';
|
|
@@ -58,8 +57,6 @@ export declare class GoogleMap extends BaseMap {
|
|
|
58
57
|
getBounds(): LatLngBounds;
|
|
59
58
|
addElementOverlay(overlay: ElementOverlay): void;
|
|
60
59
|
removeElementOverlay(overlay: ElementOverlay): void;
|
|
61
|
-
addOverlay(overlay: GoogleOverlay): void;
|
|
62
|
-
removeOverlay(overlay: GoogleOverlay): void;
|
|
63
60
|
addCustomControl(control: CustomControl): void;
|
|
64
61
|
removeCustomControl(control: CustomControl): void;
|
|
65
62
|
createLabel: typeof GoogleLabelOverlay.create;
|
|
@@ -20,7 +20,6 @@ import type { InfoBoxOptions, InfoBoxOverlay } from './overlay/info-box';
|
|
|
20
20
|
import type { InfoWindowOptions, InfoWindowOverlay } from './overlay/info-window';
|
|
21
21
|
import type { LabelOptions, LabelOverlay } from './overlay/label';
|
|
22
22
|
import type { MarkerOptions, MarkerOverlay } from './overlay/marker';
|
|
23
|
-
import type { Overlay } from './overlay/overlay';
|
|
24
23
|
import type { PolygonOptions, PolygonOverlay } from './overlay/polygon';
|
|
25
24
|
import type { PolylineOptions, PolylineOverlay } from './overlay/polyline';
|
|
26
25
|
import type { RectangleOptions, RectangleOverlay } from './overlay/rectangle';
|
|
@@ -55,8 +54,6 @@ export declare class HereMap extends BaseMap {
|
|
|
55
54
|
getBounds(): LatLngBounds;
|
|
56
55
|
addElementOverlay(overlay: ElementOverlay): void;
|
|
57
56
|
removeElementOverlay(overlay: ElementOverlay): void;
|
|
58
|
-
addOverlay(overlay: Overlay<unknown>): void;
|
|
59
|
-
removeOverlay(overlay: Overlay<unknown>): void;
|
|
60
57
|
createMarker(options: MarkerOptions): MarkerOverlay;
|
|
61
58
|
createMarkerClusterer(options: MarkerClustererOptions): MarkerClusterer;
|
|
62
59
|
createHeatmap(options: HeatmapOptions): Heatmap;
|
|
@@ -42,10 +42,14 @@ export interface Layer {
|
|
|
42
42
|
export type OverlayMapType = MapType & Layer;
|
|
43
43
|
export declare class BuildInMapType implements MapType {
|
|
44
44
|
id: BuildInMapTypeIdIncludeIncompatible;
|
|
45
|
+
/** 在{@link MapType.BUILD_IN_MAP_TYPES.values}中的index */
|
|
46
|
+
index: number;
|
|
45
47
|
private baidu;
|
|
46
48
|
private google;
|
|
47
49
|
private googleCoordType;
|
|
48
|
-
constructor(id: BuildInMapTypeIdIncludeIncompatible,
|
|
50
|
+
constructor(id: BuildInMapTypeIdIncludeIncompatible,
|
|
51
|
+
/** 在{@link MapType.BUILD_IN_MAP_TYPES.values}中的index */
|
|
52
|
+
index: number, baidu: () => BMap.MapType, // 需要延迟初始化, 故写成方法
|
|
49
53
|
google: () => google.maps.MapTypeId, // 同上
|
|
50
54
|
googleCoordType: CoordType);
|
|
51
55
|
getId(): BuildInMapTypeIdIncludeIncompatible;
|
|
@@ -168,8 +168,8 @@ export declare abstract class BaseMap implements AbstractMap {
|
|
|
168
168
|
abstract getBounds(): LatLngBounds;
|
|
169
169
|
abstract addElementOverlay(overlay: ElementOverlay): void;
|
|
170
170
|
abstract removeElementOverlay(overlay: ElementOverlay): void;
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
addOverlay(overlay: Overlay): void;
|
|
172
|
+
removeOverlay(overlay: Overlay): void;
|
|
173
173
|
abstract createMarker(options: MarkerOptions): MarkerOverlay;
|
|
174
174
|
abstract createMarkerClusterer(options: MarkerClustererOptions): MarkerClusterer;
|
|
175
175
|
abstract createHeatmap(options: HeatmapOptions): Heatmap;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as maptalks from 'maptalks';
|
|
2
2
|
import type { Tg } from '../../event';
|
|
3
|
-
import { EventHubEventTargetDelegate } from '../../event-target';
|
|
3
|
+
import { EventHubEventTargetDelegate, type EventTargetDelegate } from '../../event-target';
|
|
4
4
|
import { LatLng } from '../../lat-lng';
|
|
5
5
|
import type { BaiduMap } from '../baidu-map';
|
|
6
6
|
import type { GoogleMap } from '../google-map';
|
|
@@ -35,7 +35,7 @@ export declare class BaiduCircle extends BaiduShape<BMap.Circle> implements Circ
|
|
|
35
35
|
private isDoingSetCenter;
|
|
36
36
|
private isDoingSetRadius;
|
|
37
37
|
private eventHubDelegate;
|
|
38
|
-
protected createDelegate(): EventHubEventTargetDelegate<"
|
|
38
|
+
protected createDelegate(): EventHubEventTargetDelegate<"center-changed" | "radius-changed">;
|
|
39
39
|
private onRadiusChanged;
|
|
40
40
|
private onCenterChanged;
|
|
41
41
|
private resetEditableTimeoutId;
|
|
@@ -53,6 +53,12 @@ export declare class GoogleCircle extends GoogleShape<google.maps.Circle> implem
|
|
|
53
53
|
}
|
|
54
54
|
export declare class TalksCircle extends TalksShape<maptalks.Circle> implements Circle {
|
|
55
55
|
static create(this: TalksMap, options: CircleOptions): TalksCircle;
|
|
56
|
+
private prevCenter?;
|
|
57
|
+
private prevRadius?;
|
|
58
|
+
private eventHubDelegate?;
|
|
59
|
+
protected createDelegate(): EventTargetDelegate;
|
|
60
|
+
private onRadiusChanged;
|
|
61
|
+
private onCenterChanged;
|
|
56
62
|
setCenter(center: LatLng): void;
|
|
57
63
|
getCenter(): LatLng;
|
|
58
64
|
setRadius(radius: number): void;
|
|
@@ -107,6 +107,8 @@ export declare class GoogleLabelOverlay extends GoogleOverlay<GoogleLabel> imple
|
|
|
107
107
|
export type TalksLabel = maptalks.ui.UIMarker;
|
|
108
108
|
export declare class TalksLabelOverlay extends TalksOverlay<TalksLabel> implements Label {
|
|
109
109
|
static create(this: TalksMap, options: LabelOptions): TalksLabelOverlay;
|
|
110
|
+
addTo(map: TalksMap): void;
|
|
111
|
+
remove(): void;
|
|
110
112
|
setContent(content: LabelContent): void;
|
|
111
113
|
getPosition(): LatLng;
|
|
112
114
|
setPosition(position: LatLng): void;
|
|
@@ -163,6 +163,8 @@ export declare class TalksMarker extends TalksOverlay<maptalks.Marker> implement
|
|
|
163
163
|
private labelMapChangedListener;
|
|
164
164
|
private labelVisibleChangeInCluster;
|
|
165
165
|
constructor(innerOverlay: maptalks.Marker, coordType: CoordType, map: TalksMap, state: Pick<MarkerOptions, 'icon' | 'label' | 'title'>);
|
|
166
|
+
addTo(map: TalksMap): void;
|
|
167
|
+
remove(): void;
|
|
166
168
|
getPosition(): LatLng;
|
|
167
169
|
setPosition(position: LatLng): void;
|
|
168
170
|
setTitle(title: string): void;
|
|
@@ -17,13 +17,20 @@ export declare abstract class Overlay<T = unknown> implements Tg.EventTarget {
|
|
|
17
17
|
constructor(innerOverlay: T,
|
|
18
18
|
/** 用于保存Overlay内部点的坐标, 它的值有可能和map的不同 */
|
|
19
19
|
coordType: CoordType);
|
|
20
|
+
/** @see addTo */
|
|
20
21
|
protected abstract map: BaseMap;
|
|
21
22
|
protected abstract createDelegate(): EventTargetDelegate;
|
|
22
23
|
private _delegate;
|
|
23
24
|
private get delegate();
|
|
24
25
|
addEventListener(type: string, listener: Tg.EventListener): void;
|
|
25
26
|
removeEventListener(type: string, listener: Tg.EventListener): void;
|
|
26
|
-
|
|
27
|
+
/**
|
|
28
|
+
* 添加到地图
|
|
29
|
+
* @param map 应该和this.map是同一个对象, 目前没有处理两个对象不同的情况, 因此在{@link remove}中也没有清空this.map, 并且this.map也没被声明成可空
|
|
30
|
+
*/
|
|
31
|
+
abstract addTo(map: BaseMap): void;
|
|
32
|
+
/** @see addTo */
|
|
33
|
+
abstract remove(): void;
|
|
27
34
|
abstract isVisible(): boolean;
|
|
28
35
|
abstract setVisible(visible: boolean): void;
|
|
29
36
|
}
|
|
@@ -31,6 +38,8 @@ export declare class GoogleOverlay<T extends UnionGoogleOverlay = UnionGoogleOve
|
|
|
31
38
|
protected map: GoogleMap;
|
|
32
39
|
constructor(innerOverlay: T, coordType: CoordType, map: GoogleMap);
|
|
33
40
|
protected createDelegate(): EventTargetDelegate;
|
|
41
|
+
addTo(map: GoogleMap): void;
|
|
42
|
+
remove(): void;
|
|
34
43
|
isVisible(): boolean;
|
|
35
44
|
setVisible(visible: boolean): void;
|
|
36
45
|
}
|
|
@@ -38,6 +47,8 @@ export declare class BaiduOverlay<T extends UnionBaiduOverlay = UnionBaiduOverla
|
|
|
38
47
|
protected map: BaiduMap;
|
|
39
48
|
constructor(innerOverlay: T, coordType: CoordType, map: BaiduMap);
|
|
40
49
|
protected createDelegate(): EventTargetDelegate;
|
|
50
|
+
addTo(map: BaiduMap): void;
|
|
51
|
+
remove(): void;
|
|
41
52
|
/** 仅限内部使用; 设为private时, 生成的d.ts文件中, 方法返回值会变成any, 故改成了public */
|
|
42
53
|
get overlay(): Required<Pick<UnionBaiduOverlay, "isVisible" | "show" | "hide">>;
|
|
43
54
|
isVisible(): boolean;
|
|
@@ -45,7 +56,7 @@ export declare class BaiduOverlay<T extends UnionBaiduOverlay = UnionBaiduOverla
|
|
|
45
56
|
/** 在创建BaiduOverlay时, 设置options.visible, 仅内部使用 */
|
|
46
57
|
visibleOptionInternal(visible: boolean | undefined): this;
|
|
47
58
|
}
|
|
48
|
-
export declare class TalksOverlay<T extends UnionTalksOverlay = UnionTalksOverlay> extends Overlay<T> {
|
|
59
|
+
export declare abstract class TalksOverlay<T extends UnionTalksOverlay = UnionTalksOverlay> extends Overlay<T> {
|
|
49
60
|
protected map: TalksMap;
|
|
50
61
|
constructor(innerOverlay: T, coordType: CoordType, map: TalksMap);
|
|
51
62
|
protected createDelegate(): EventTargetDelegate;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as maptalks from 'maptalks';
|
|
2
2
|
import type { Tg } from '../../event';
|
|
3
|
-
import { EventHubEventTargetDelegate } from '../../event-target';
|
|
3
|
+
import { EventHubEventTargetDelegate, type EventTargetDelegate } from '../../event-target';
|
|
4
4
|
import { LatLng } from '../../lat-lng';
|
|
5
5
|
import type { BaiduMap } from '../baidu-map';
|
|
6
6
|
import type { GoogleMap } from '../google-map';
|
|
@@ -44,6 +44,7 @@ export declare class GooglePolygon extends GoogleShape<google.maps.Polygon> impl
|
|
|
44
44
|
}
|
|
45
45
|
export declare class TalksPolygon extends TalksShape<maptalks.Polygon> implements Polygon {
|
|
46
46
|
static create(this: TalksMap, options: PolygonOptions): TalksPolygon;
|
|
47
|
+
protected createDelegate(): EventTargetDelegate;
|
|
47
48
|
getPaths(): LatLng[][];
|
|
48
49
|
setPaths(paths: LatLng[][]): void;
|
|
49
50
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as maptalks from 'maptalks';
|
|
2
2
|
import type { Tg } from '../../event';
|
|
3
|
-
import { EventHubEventTargetDelegate } from '../../event-target';
|
|
3
|
+
import { EventHubEventTargetDelegate, type EventTargetDelegate } from '../../event-target';
|
|
4
4
|
import { LatLng } from '../../lat-lng';
|
|
5
5
|
import type { BaiduMap } from '../baidu-map';
|
|
6
6
|
import type { GoogleMap } from '../google-map';
|
|
@@ -73,6 +73,7 @@ export declare class GooglePolyline extends GoogleShape<google.maps.Polyline> im
|
|
|
73
73
|
}
|
|
74
74
|
export declare class TalksPolyline extends TalksShape<maptalks.LineString> implements Polyline {
|
|
75
75
|
static create(this: TalksMap, options: PolylineOptions): TalksPolyline;
|
|
76
|
+
protected createDelegate(): EventTargetDelegate;
|
|
76
77
|
getPath(): LatLng[];
|
|
77
78
|
setPath(path: LatLng[]): void;
|
|
78
79
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as maptalks from 'maptalks';
|
|
2
2
|
import type { Tg } from '../../event';
|
|
3
|
+
import { type EventTargetDelegate } from '../../event-target';
|
|
3
4
|
import { CoordType, LatLngBounds } from '../../lat-lng';
|
|
4
5
|
import type { BaiduMap } from '../baidu-map';
|
|
5
6
|
import type { GoogleMap } from '../google-map';
|
|
@@ -53,6 +54,7 @@ export declare class GoogleRectangle extends GoogleShape<google.maps.Rectangle>
|
|
|
53
54
|
export declare class TalksRectangle extends TalksShape<maptalks.Rectangle> implements Rectangle {
|
|
54
55
|
static create(this: TalksMap, options: RectangleOptions): TalksRectangle;
|
|
55
56
|
private static convertBoundsToRect;
|
|
57
|
+
protected createDelegate(): EventTargetDelegate;
|
|
56
58
|
getBounds(): LatLngBounds;
|
|
57
59
|
setBounds(bounds: LatLngBounds): void;
|
|
58
60
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CoordType } from '../../lat-lng';
|
|
2
2
|
import type { UnionBaiduShape, UnionGoogleShape, UnionTalksShape } from '../../unions';
|
|
3
3
|
import type { BaiduMap } from '../baidu-map';
|
|
4
|
+
import type { TalksMap } from '../talks-map';
|
|
4
5
|
import type { SymbolIcon } from './icon';
|
|
5
6
|
import { BaiduOverlay, GoogleOverlay, TalksOverlay, type OverlayOptions } from './overlay';
|
|
6
7
|
export interface ShapeOptions extends OverlayOptions {
|
|
@@ -75,6 +76,20 @@ export declare abstract class GoogleShape<T extends UnionGoogleShape> extends Go
|
|
|
75
76
|
setZIndex(zIndex: number): void;
|
|
76
77
|
}
|
|
77
78
|
export declare abstract class TalksShape<T extends UnionTalksShape> extends TalksOverlay<T> implements Shape {
|
|
79
|
+
addTo(map: TalksMap): void;
|
|
80
|
+
remove(): void;
|
|
81
|
+
/**
|
|
82
|
+
* ## 编辑状态的映射
|
|
83
|
+
* tg-map的editable, 直接表示是否处于编辑状态
|
|
84
|
+
* talks的editable, 只是标记overlay是否可以编辑(默认为true), 要进入编辑状态(isEditing), 还需要执行startEdit()
|
|
85
|
+
* 也就是说我们需要想办法把talks的四个状态, 映射为tg-map的两个状态
|
|
86
|
+
*
|
|
87
|
+
* 我们的做法是, 用editable保存isEditing期望的值, 保证editable为true时isEditing也会为true, 为false时isEditing也会为false
|
|
88
|
+
* 这样就可以和tg-map的editable的语义简单对应上了
|
|
89
|
+
*
|
|
90
|
+
* @see addTo
|
|
91
|
+
* @see setEditable
|
|
92
|
+
*/
|
|
78
93
|
isEditable(): boolean;
|
|
79
94
|
setEditable(editable: boolean): void;
|
|
80
95
|
setStrokeColor(color: string): void;
|
|
@@ -24,16 +24,30 @@ import { TalksInfoBoxOverlay } from './overlay/info-box';
|
|
|
24
24
|
import { TalksInfoWindow } from './overlay/info-window';
|
|
25
25
|
import { TalksLabelOverlay } from './overlay/label';
|
|
26
26
|
import { TalksMarker } from './overlay/marker';
|
|
27
|
-
import type { TalksOverlay } from './overlay/overlay';
|
|
28
27
|
import { TalksPolygon } from './overlay/polygon';
|
|
29
28
|
import { TalksPolyline } from './overlay/polyline';
|
|
30
29
|
import { TalksRectangle } from './overlay/rectangle';
|
|
31
30
|
export declare class TalksMap extends BaseMap {
|
|
32
31
|
mapOptions: MapOptions;
|
|
32
|
+
/**
|
|
33
|
+
* 最多8项, 前四项对应{@link MapType.BUILD_IN_MAP_TYPES}的四个值(普通、卫星、混合、地形)的亮色版, 后四项对应暗色版
|
|
34
|
+
* @see computeBaseLayerId
|
|
35
|
+
*/
|
|
36
|
+
private baseLayoutIds;
|
|
33
37
|
private map;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
private attributionControl;
|
|
39
|
+
private baseLayerGroup;
|
|
40
|
+
private mapStyleTheme;
|
|
41
|
+
constructor(element: HTMLElement, mapOptions: MapOptions,
|
|
42
|
+
/**
|
|
43
|
+
* 最多8项, 前四项对应{@link MapType.BUILD_IN_MAP_TYPES}的四个值(普通、卫星、混合、地形)的亮色版, 后四项对应暗色版
|
|
44
|
+
* @see computeBaseLayerId
|
|
45
|
+
*/
|
|
46
|
+
baseLayoutIds: [TalksBaseLayerId, ...(TalksBaseLayerId | undefined)[]]);
|
|
47
|
+
private getCurrentBaseLayer;
|
|
48
|
+
private onBaseLayerChanged;
|
|
49
|
+
private computeBaseLayerId;
|
|
50
|
+
private setBaseLayer;
|
|
37
51
|
setGestureHandling(gestureHandling?: GestureHandlingOptions): void;
|
|
38
52
|
get innerMap(): maptalks.Map;
|
|
39
53
|
get coordType(): CoordType;
|
|
@@ -60,8 +74,6 @@ export declare class TalksMap extends BaseMap {
|
|
|
60
74
|
getBounds(): LatLngBounds;
|
|
61
75
|
addElementOverlay(overlay: ElementOverlay): void;
|
|
62
76
|
removeElementOverlay(overlay: ElementOverlay): void;
|
|
63
|
-
addOverlay(overlay: TalksOverlay): void;
|
|
64
|
-
removeOverlay(overlay: TalksOverlay): void;
|
|
65
77
|
createMarker: typeof TalksMarker.create;
|
|
66
78
|
createMarkerClusterer(options: MarkerClustererOptions): MarkerClusterer;
|
|
67
79
|
createHeatmap(options: HeatmapOptions): Heatmap;
|
|
@@ -29,8 +29,10 @@ export interface TgMapConfig {
|
|
|
29
29
|
amap: EmptyObject;
|
|
30
30
|
osm: EmptyObject;
|
|
31
31
|
talks: {
|
|
32
|
-
/** @
|
|
32
|
+
/** @deprecated 使用layerIds替代 */
|
|
33
33
|
layerId?: TalksBaseLayerId | '';
|
|
34
|
+
/** 只有第一个元素非空, 才是有效的值; 默认`bing` */
|
|
35
|
+
layerIds?: (TalksBaseLayerId | undefined)[];
|
|
34
36
|
};
|
|
35
37
|
}
|
|
36
38
|
export type PartialTgMapConfig = DeepPartial<TgMapConfig>;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import * as maptalks from 'maptalks';
|
|
2
2
|
import { CoordType } from '../map/lat-lng';
|
|
3
|
-
export declare const talksBaseLayerIds: readonly ["osm", "osm-
|
|
3
|
+
export declare const talksBaseLayerIds: readonly ["osm", "osm-light", "osm-dark", "osm-terrain", "google", "baidu", "baidu-detail", "amap", "amap-terrain", "tencent", "geoq", "tianditu", "yandex", "bing"];
|
|
4
4
|
export type TalksBaseLayerId = typeof talksBaseLayerIds[number];
|
|
5
|
-
export declare function talksBaseLayerIdToCoordType(layerId: TalksBaseLayerId
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
export declare function talksBaseLayerIdToCoordType(layerId: TalksBaseLayerId | (string & {
|
|
6
|
+
readonly __flavor__?: 'layerId';
|
|
7
|
+
})): CoordType;
|
|
8
|
+
declare function createTalksBaseLayerImpl(layerId: TalksBaseLayerId, { id, visible, }?: {
|
|
9
|
+
id?: "osm" | "osm-light" | "osm-dark" | "osm-terrain" | "google" | "baidu" | "baidu-detail" | "amap" | "amap-terrain" | "tencent" | "geoq" | "tianditu" | "yandex" | "bing" | undefined;
|
|
8
10
|
visible?: boolean | undefined;
|
|
9
11
|
}): maptalks.TileLayer;
|
|
12
|
+
export declare const createTalksBaseLayer: typeof createTalksBaseLayerImpl;
|
|
13
|
+
export {};
|