tg-map-vue3 3.1.5 → 3.1.7

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 (46) hide show
  1. package/dist/src/components/TgMap.vue.d.ts +6 -0
  2. package/dist/src/components/TgMapWidget.vue.d.ts +8 -8
  3. package/dist/src/components/controls/TgZoomControl.vue.d.ts +2 -6
  4. package/dist/src/components/index.d.ts +31 -28
  5. package/dist/src/components/map-hooks.d.ts +14 -0
  6. package/dist/src/components/map-mixin.d.ts +1 -0
  7. package/dist/src/map/event-target.d.ts +13 -1
  8. package/dist/src/map/lat-lng.d.ts +1 -1
  9. package/dist/src/map/map/baidu-map.d.ts +17 -13
  10. package/dist/src/map/map/controls/control.d.ts +3 -3
  11. package/dist/src/map/map/controls/map-type.control.d.ts +1 -1
  12. package/dist/src/map/map/controls/scale.control.d.ts +2 -2
  13. package/dist/src/map/map/controls/zoom.control.d.ts +1 -1
  14. package/dist/src/map/map/extra/autocomplete.d.ts +35 -0
  15. package/dist/src/map/map/extra/marker-clusterer.d.ts +3 -3
  16. package/dist/src/map/map/extra/places-service.d.ts +43 -0
  17. package/dist/src/map/map/google-map.d.ts +18 -14
  18. package/dist/src/map/map/here-map.d.ts +5 -1
  19. package/dist/src/map/map/map-options.d.ts +1 -1
  20. package/dist/src/map/map/map-type.d.ts +4 -4
  21. package/dist/src/map/map/map.d.ts +20 -16
  22. package/dist/src/map/map/overlay/baidu-info-box.d.ts +1 -1
  23. package/dist/src/map/map/overlay/circle.d.ts +3 -3
  24. package/dist/src/map/map/overlay/element-overlay.d.ts +2 -2
  25. package/dist/src/map/map/overlay/google-label.d.ts +14 -14
  26. package/dist/src/map/map/overlay/icon.d.ts +2 -2
  27. package/dist/src/map/map/overlay/info-box.d.ts +7 -7
  28. package/dist/src/map/map/overlay/info-window.d.ts +4 -4
  29. package/dist/src/map/map/overlay/label.d.ts +4 -4
  30. package/dist/src/map/map/overlay/marker.d.ts +7 -7
  31. package/dist/src/map/map/overlay/overlay.d.ts +3 -3
  32. package/dist/src/map/map/overlay/polygon.d.ts +3 -3
  33. package/dist/src/map/map/overlay/polyline.d.ts +3 -3
  34. package/dist/src/map/map/overlay/shape.d.ts +2 -2
  35. package/dist/src/map/map-config.d.ts +16 -5
  36. package/dist/src/map/map-loader.d.ts +12 -2
  37. package/dist/src/map/unions.d.ts +7 -4
  38. package/dist/src/utils/arrays.d.ts +1 -1
  39. package/dist/src/utils/google-utils.d.ts +31 -0
  40. package/dist/src/utils/here-utils.d.ts +1 -1
  41. package/dist/src/utils/hooks.d.ts +2 -0
  42. package/dist/tg-map.js +2927 -2645
  43. package/dist/tg-map.js.map +1 -1
  44. package/dist/tg-map.umd.cjs +5 -5
  45. package/dist/tg-map.umd.cjs.map +1 -1
  46. package/package.json +3 -3
@@ -82,6 +82,9 @@ declare const _default: import("vue").DefineComponent<{
82
82
  mapType: {
83
83
  type: import("vue").PropType<any>;
84
84
  };
85
+ hideLogo: {
86
+ type: import("vue").PropType<boolean>;
87
+ };
85
88
  onLoad: import("vue").Prop<import("../utils/vue-utils").EventCallback<AbstractMap>, import("../utils/vue-utils").EventCallback<AbstractMap>>;
86
89
  'onUpdate:center': import("vue").Prop<import("../utils/vue-utils").EventCallback<LatLng>, import("../utils/vue-utils").EventCallback<LatLng>>;
87
90
  'onUpdate:current-center': import("vue").Prop<import("../utils/vue-utils").EventCallback<LatLng>, import("../utils/vue-utils").EventCallback<LatLng>>;
@@ -169,6 +172,9 @@ declare const _default: import("vue").DefineComponent<{
169
172
  mapType: {
170
173
  type: import("vue").PropType<any>;
171
174
  };
175
+ hideLogo: {
176
+ type: import("vue").PropType<boolean>;
177
+ };
172
178
  onLoad: import("vue").Prop<import("../utils/vue-utils").EventCallback<AbstractMap>, import("../utils/vue-utils").EventCallback<AbstractMap>>;
173
179
  'onUpdate:center': import("vue").Prop<import("../utils/vue-utils").EventCallback<LatLng>, import("../utils/vue-utils").EventCallback<LatLng>>;
174
180
  'onUpdate:current-center': import("vue").Prop<import("../utils/vue-utils").EventCallback<LatLng>, import("../utils/vue-utils").EventCallback<LatLng>>;
@@ -2,19 +2,19 @@ import { dimen } from '../utils/formatter';
2
2
  /** TgMap上的Widget, 只是对绝对布局进行简单的封装 */
3
3
  declare const _default: import("vue").DefineComponent<{
4
4
  left: {
5
- type: (NumberConstructor | StringConstructor)[];
5
+ type: (StringConstructor | NumberConstructor)[];
6
6
  default: null;
7
7
  };
8
8
  top: {
9
- type: (NumberConstructor | StringConstructor)[];
9
+ type: (StringConstructor | NumberConstructor)[];
10
10
  default: null;
11
11
  };
12
12
  right: {
13
- type: (NumberConstructor | StringConstructor)[];
13
+ type: (StringConstructor | NumberConstructor)[];
14
14
  default: null;
15
15
  };
16
16
  bottom: {
17
- type: (NumberConstructor | StringConstructor)[];
17
+ type: (StringConstructor | NumberConstructor)[];
18
18
  default: null;
19
19
  };
20
20
  }, unknown, unknown, {
@@ -23,19 +23,19 @@ declare const _default: import("vue").DefineComponent<{
23
23
  dimen: typeof dimen;
24
24
  }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
25
25
  left: {
26
- type: (NumberConstructor | StringConstructor)[];
26
+ type: (StringConstructor | NumberConstructor)[];
27
27
  default: null;
28
28
  };
29
29
  top: {
30
- type: (NumberConstructor | StringConstructor)[];
30
+ type: (StringConstructor | NumberConstructor)[];
31
31
  default: null;
32
32
  };
33
33
  right: {
34
- type: (NumberConstructor | StringConstructor)[];
34
+ type: (StringConstructor | NumberConstructor)[];
35
35
  default: null;
36
36
  };
37
37
  bottom: {
38
- type: (NumberConstructor | StringConstructor)[];
38
+ type: (StringConstructor | NumberConstructor)[];
39
39
  default: null;
40
40
  };
41
41
  }>>, {
@@ -1,15 +1,11 @@
1
- import type { ZoomControl } from '../../map/map/controls/zoom.control';
1
+ import { createEmptyVNode } from '../../utils/vue-utils';
2
2
  import { ControlPosition } from '../../map/map/controls/control';
3
3
  declare const _default: import("vue").DefineComponent<{
4
4
  position: {
5
5
  type: import("vue").PropType<import("../../utils/mapped-types").StringEnumValue<typeof ControlPosition>>;
6
6
  default: ControlPosition;
7
7
  };
8
- }, {
9
- control: ZoomControl;
10
- }, unknown, {}, {}, import("vue").DefineComponent<{}, {}, {}, {}, {
11
- recreate(): void;
12
- }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
8
+ }, typeof createEmptyVNode, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
13
9
  position: {
14
10
  type: import("vue").PropType<import("../../utils/mapped-types").StringEnumValue<typeof ControlPosition>>;
15
11
  default: ControlPosition;
@@ -1,12 +1,40 @@
1
1
  /// <reference types="@/map/dts" />
2
2
  import type { App } from 'vue';
3
- import { type PartialTgMapConfig, setTgMapConfig, type TgMapConfig, getTgMapConfig } from '../map/map-config';
4
- import MapMixin, { MIXIN_HOOK_DESTROY, MIXIN_HOOK_CREATE, MIXIN_MAP_NAME } from './map-mixin';
3
+ import { getTgMapConfig, setTgMapConfig, type PartialTgMapConfig, type TgMapConfig } from '../map/map-config';
5
4
  import LifecycleLogPlugin, { type LifecycleLogOptions } from '../utils/lifecycle-log';
5
+ import MapMixin, { MIXIN_HOOK_CREATE, MIXIN_HOOK_DESTROY, MIXIN_MAP_NAME } from './map-mixin';
6
6
  declare const TgMapPlugin: {
7
7
  install(app: App, config?: PartialTgMapConfig): void;
8
8
  };
9
9
  export default TgMapPlugin;
10
+ export { type Tg } from '../map/event';
11
+ export * from '../map/lat-lng';
12
+ export * from '../map/map-factory';
13
+ export * from '../map/map/controls/control';
14
+ export * from '../map/map/controls/map-type.control';
15
+ export * from '../map/map/controls/scale.control';
16
+ export * from '../map/map/controls/zoom.control';
17
+ export * from '../map/map/extra/autocomplete';
18
+ export * from '../map/map/extra/marker-clusterer';
19
+ export * from '../map/map/extra/places-service';
20
+ export * from '../map/map/map';
21
+ export * from '../map/map/overlay/circle';
22
+ export * from '../map/map/overlay/icon';
23
+ export * from '../map/map/overlay/info-box';
24
+ export * from '../map/map/overlay/info-window';
25
+ export * from '../map/map/overlay/marker';
26
+ export * from '../map/map/overlay/overlay';
27
+ export * from '../map/map/overlay/polygon';
28
+ export * from '../map/map/overlay/polyline';
29
+ export * from '../map/types';
30
+ export * from '../utils/arrays';
31
+ export * from '../utils/mapped-types';
32
+ export { Objects } from '../utils/objects';
33
+ export * from '../utils/spherical-utils';
34
+ export * from '../utils/strings';
35
+ export * from '../utils/utils';
36
+ export * from '../utils/values';
37
+ export * from '../utils/vue-utils';
10
38
  export { default as TgMap } from './TgMap.vue';
11
39
  export { default as TgMapWidget } from './TgMapWidget.vue';
12
40
  export { default as TgCustomControl } from './controls/TgCustomControl.vue';
@@ -15,6 +43,7 @@ export { default as TgScaleControl } from './controls/TgScaleControl.vue';
15
43
  export { default as TgZoomControl } from './controls/TgZoomControl.vue';
16
44
  export { default as TgMarkerClusterer } from './extra/TgMarkerClusterer.vue';
17
45
  export { default as TgTrafficLayer } from './layers/TgTrafficLayer.vue';
46
+ export * from './map-hooks';
18
47
  export { default as TgCircle } from './overlays/TgCircle.vue';
19
48
  export { default as TgElementOverlay } from './overlays/TgElementOverlay.vue';
20
49
  export { default as TgInfoBox } from './overlays/TgInfoBox.vue';
@@ -23,30 +52,4 @@ export { default as TgLabel } from './overlays/TgLabel.vue';
23
52
  export { default as TgMarker } from './overlays/TgMarker.vue';
24
53
  export { default as TgPolygon } from './overlays/TgPolygon.vue';
25
54
  export { default as TgPolyline } from './overlays/TgPolyline.vue';
26
- export * from '../map/lat-lng';
27
- export * from '../map/map/map';
28
- export * from '../map/map-factory';
29
- export * from '../map/types';
30
- export { type Tg } from '../map/event';
31
- export * from '../map/map/overlay/icon';
32
- export * from '../map/map/overlay/marker';
33
- export * from '../map/map/overlay/circle';
34
- export * from '../map/map/overlay/polygon';
35
- export * from '../map/map/overlay/polyline';
36
- export * from '../map/map/overlay/overlay';
37
- export * from '../map/map/overlay/info-window';
38
- export * from '../map/map/overlay/info-box';
39
- export * from '../map/map/extra/marker-clusterer';
40
- export * from '../map/map/controls/control';
41
- export * from '../map/map/controls/map-type.control';
42
- export * from '../map/map/controls/scale.control';
43
- export * from '../map/map/controls/zoom.control';
44
- export * from '../utils/utils';
45
- export * from '../utils/vue-utils';
46
- export * from '../utils/mapped-types';
47
- export * from '../utils/spherical-utils';
48
- export { Objects } from '../utils/objects';
49
- export * from '../utils/arrays';
50
- export * from '../utils/strings';
51
- export * from '../utils/values';
52
55
  export { TgMapConfig, PartialTgMapConfig, getTgMapConfig, setTgMapConfig, LifecycleLogPlugin, LifecycleLogOptions, MapMixin, MIXIN_HOOK_CREATE, MIXIN_HOOK_DESTROY, MIXIN_MAP_NAME, };
@@ -0,0 +1,14 @@
1
+ import { type Ref } from 'vue';
2
+ import { type AbstractMap } from '.';
3
+ /** 作为Vue3下, `MapMixin`的替代 */
4
+ export declare function useTgMap(): {
5
+ mapRef: Ref<AbstractMap | undefined>;
6
+ /** 读取map对象, 只要放在<tg-map>里面的组件(除#overlay插槽外)都能够立即读取到map对象 */
7
+ readonly map: AbstractMap;
8
+ /** 地图元素创建回调 */
9
+ onCreate(hook: VoidFunction): void;
10
+ /** 地图元素销毁回调 */
11
+ onDestroy(hook: VoidFunction): void;
12
+ /** 重新创建地图元素 */
13
+ recreate(): void;
14
+ };
@@ -14,6 +14,7 @@ declare module 'vue' {
14
14
  [MIXIN_HOOK_DESTROY]?(): void;
15
15
  }
16
16
  }
17
+ /** @deprecated 使用{@link useTgMap}替代 */
17
18
  declare const MapMixin: import("vue").DefineComponent<{}, {}, {}, {}, {
18
19
  recreate(): void;
19
20
  }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
@@ -1,6 +1,18 @@
1
1
  import { type Tg } from './event';
2
2
  import { type CoordTypeSupplier } from './lat-lng';
3
- import type { UnionGoogleEventTarget, UnionBaiduEventTarget } from './unions';
3
+ import type { UnionBaiduEventTarget, UnionGoogleEventTarget } from './unions';
4
+ /**
5
+ * 移除事件监听的函数
6
+ *
7
+ * 实现{@link EventTarget}有点复杂, 对于简单的情况, 实现一个设置监听的函数+返回{@link RemoveEventListenerFunction}就够了
8
+ * @see addBaiduEventListener
9
+ * @see addGoogleEventListener
10
+ * */
11
+ export interface RemoveEventListenerFunction {
12
+ (): void;
13
+ }
14
+ export declare function addGoogleEventListener(target: UnionGoogleEventTarget, type: string, listener: (...args: any[]) => void): RemoveEventListenerFunction;
15
+ export declare function addBaiduEventListener(target: UnionBaiduEventTarget, type: string, listener: (...args: any[]) => void): RemoveEventListenerFunction;
4
16
  /**
5
17
  * ## Delegate(代理) VS Mixin(混合)
6
18
  * Delegate相对于Mixin的优点是调用路径更明确, 缺点是js/ts原生不支持, 需要写样板代码
@@ -1,5 +1,5 @@
1
1
  /// <reference types="baidumap-web-sdk" />
2
- /// <reference types="googlemaps" />
2
+ /// <reference types="google.maps" />
3
3
  /// <reference types="heremaps" />
4
4
  import { type LngLatTuple } from 'coordtransform';
5
5
  export declare enum CoordType {
@@ -1,22 +1,24 @@
1
1
  import { LatLng, LatLngBounds } from '../lat-lng';
2
- import { AbstractMap, type AbstractMapEventMap } from './map';
3
- import { MapOptions, GestureHandlingOptions, type MapStyle } from './map-options';
4
- import type { BaiduOverlay } from './overlay/overlay';
5
- import { BaiduMarkerClusterer, type MarkerClustererOptions } from './extra/marker-clusterer';
6
- import { BaiduPolyline } from './overlay/polyline';
7
- import { BaiduPolygon } from './overlay/polygon';
8
- import { BaiduCircle } from './overlay/circle';
2
+ import type { Padding, Point } from '../types';
9
3
  import { CustomControl } from './controls/control';
10
4
  import { BaiduMapTypeControl } from './controls/map-type.control';
11
- import { BaiduZoomControl } from './controls/zoom.control';
12
5
  import { BaiduScaleControl } from './controls/scale.control';
13
- import { BaiduMarker } from './overlay/marker';
14
- import { BaiduInfoWindow } from './overlay/info-window';
6
+ import { BaiduZoomControl } from './controls/zoom.control';
7
+ import { type Autocomplete, type AutocompleteOptions } from './extra/autocomplete';
8
+ import { BaiduMarkerClusterer, type MarkerClustererOptions } from './extra/marker-clusterer';
9
+ import { type PlaceServiceOptions, type PlacesService } from './extra/places-service';
10
+ import { AbstractMap, type AbstractMapEventMap } from './map';
11
+ import { GestureHandlingOptions, MapOptions, type MapStyle } from './map-options';
15
12
  import { BuildInMapTypeId, MapType, type Layer } from './map-type';
16
- import type { Padding, Point } from '../types';
17
- import { BaiduLabelOverlay } from './overlay/label';
18
- import { BaiduInfoBoxOverlay } from './overlay/info-box';
13
+ import { BaiduCircle } from './overlay/circle';
19
14
  import type { ElementOverlay } from './overlay/element-overlay';
15
+ import { BaiduInfoBoxOverlay } from './overlay/info-box';
16
+ import { BaiduInfoWindow } from './overlay/info-window';
17
+ import { BaiduLabelOverlay } from './overlay/label';
18
+ import { BaiduMarker } from './overlay/marker';
19
+ import type { BaiduOverlay } from './overlay/overlay';
20
+ import { BaiduPolygon } from './overlay/polygon';
21
+ import { BaiduPolyline } from './overlay/polyline';
20
22
  export declare class BaiduMap extends AbstractMap {
21
23
  setDefaultCursor(cursor: string): void;
22
24
  private buildInMapTypeId2BIMT;
@@ -63,4 +65,6 @@ export declare class BaiduMap extends AbstractMap {
63
65
  createZoomControl: typeof BaiduZoomControl.create;
64
66
  createScaleControl: typeof BaiduScaleControl.create;
65
67
  createMarkerClusterer(options: MarkerClustererOptions): BaiduMarkerClusterer;
68
+ createAutocomplete(options: AutocompleteOptions): Autocomplete;
69
+ createPlaceService(options: PlaceServiceOptions): PlacesService;
66
70
  }
@@ -1,8 +1,8 @@
1
- /// <reference types="googlemaps" />
2
- import type { UnionControl } from '../../unions';
1
+ /// <reference types="google.maps" />
3
2
  import { KeyValue } from '../../../utils/values';
4
- import type { GoogleMap } from '../google-map';
3
+ import type { UnionControl } from '../../unions';
5
4
  import type { BaiduMap } from '../baidu-map';
5
+ import type { GoogleMap } from '../google-map';
6
6
  import type { AbstractMap } from '../map';
7
7
  export declare enum ControlPosition {
8
8
  /** 左上 */
@@ -1,8 +1,8 @@
1
1
  /// <reference types="baidumap-web-sdk" />
2
- import { BaiduControl, GoogleControl, ControlPosition, AbstractControl } from './control';
3
2
  import type { BaiduMap } from '../baidu-map';
4
3
  import type { GoogleMap } from '../google-map';
5
4
  import { MapType } from '../map-type';
5
+ import { AbstractControl, BaiduControl, ControlPosition, GoogleControl } from './control';
6
6
  export interface MapTypeControl extends AbstractControl {
7
7
  }
8
8
  export declare enum MapTypeControlType {
@@ -1,6 +1,6 @@
1
- import { BaiduControl, GoogleControl, ControlPosition, AbstractControl } from './control';
2
- import type { GoogleMap } from '../google-map';
3
1
  import type { BaiduMap } from '../baidu-map';
2
+ import type { GoogleMap } from '../google-map';
3
+ import { AbstractControl, BaiduControl, ControlPosition, GoogleControl } from './control';
4
4
  export interface ScaleControl extends AbstractControl {
5
5
  }
6
6
  export interface ScaleControlOptions {
@@ -1,7 +1,7 @@
1
1
  /// <reference types="baidumap-web-sdk" />
2
- import { BaiduControl, GoogleControl, ControlPosition, AbstractControl } from './control';
3
2
  import type { BaiduMap } from '../baidu-map';
4
3
  import type { GoogleMap } from '../google-map';
4
+ import { AbstractControl, BaiduControl, ControlPosition, GoogleControl } from './control';
5
5
  export interface ZoomControl extends AbstractControl {
6
6
  }
7
7
  export interface ZoomControlOptions {
@@ -0,0 +1,35 @@
1
+ /// <reference types="google.maps" />
2
+ import { type EventCallback } from '../../../components';
3
+ import { type AddressFields } from '../../../utils/google-utils';
4
+ import { type RemoveEventListenerFunction } from '../../event-target';
5
+ import type { UnionAutocomplete } from '../../unions';
6
+ import type { BaiduMap } from '../baidu-map';
7
+ import type { GoogleMap } from '../google-map';
8
+ import type { AbstractMap } from '../map';
9
+ export interface AutocompleteResult extends AddressFields {
10
+ /** 名字 */
11
+ title: string;
12
+ }
13
+ export interface AutocompleteOptions {
14
+ input: HTMLInputElement;
15
+ bindToMap?: boolean;
16
+ }
17
+ /**
18
+ * 该类没有太多事件, 故没有去实现{@link Tg.EventTarget}接口
19
+ */
20
+ export declare abstract class Autocomplete {
21
+ map: AbstractMap;
22
+ abstract inner: UnionAutocomplete;
23
+ constructor(map: AbstractMap);
24
+ abstract addResultListener(listener: EventCallback<AutocompleteResult>): RemoveEventListenerFunction;
25
+ }
26
+ export declare class GoogleAutocomplete extends Autocomplete {
27
+ inner: google.maps.places.Autocomplete;
28
+ constructor(map: GoogleMap, options: AutocompleteOptions);
29
+ addResultListener(listener: EventCallback<AutocompleteResult>): RemoveEventListenerFunction;
30
+ }
31
+ export declare class BaiduAutocomplete extends Autocomplete {
32
+ inner: BMap.Autocomplete;
33
+ constructor(map: BaiduMap, options: AutocompleteOptions);
34
+ addResultListener(listener: EventCallback<AutocompleteResult>): RemoveEventListenerFunction;
35
+ }
@@ -1,8 +1,8 @@
1
- import type { AbstractMap } from '../map';
2
- import type { GoogleMap } from '../google-map';
1
+ import type { Point, Size } from '../../types';
3
2
  import type { BaiduMap } from '../baidu-map';
3
+ import type { GoogleMap } from '../google-map';
4
+ import type { AbstractMap } from '../map';
4
5
  import type { MarkerOverlay } from '../overlay/marker';
5
- import type { Size, Point } from '../../types';
6
6
  export interface MarkerClustererOptions {
7
7
  markers?: MarkerOverlay[];
8
8
  gridSize?: number;
@@ -0,0 +1,43 @@
1
+ /// <reference types="google.maps" />
2
+ /// <reference types="baidumap-web-sdk" />
3
+ import { LatLng, LatLngBounds, type AbstractMap } from '../../../components';
4
+ import type { UnionPlacesService } from '../../unions';
5
+ import type { BaiduMap } from '../baidu-map';
6
+ import type { GoogleMap } from '../google-map';
7
+ export interface Place {
8
+ id: string;
9
+ position: LatLng;
10
+ country: string;
11
+ province: string;
12
+ city: string;
13
+ title: string;
14
+ address: string;
15
+ }
16
+ export interface PlaceServiceOptions {
17
+ }
18
+ export declare abstract class PlacesService {
19
+ map: AbstractMap;
20
+ abstract inner: UnionPlacesService;
21
+ constructor(map: AbstractMap);
22
+ abstract search(query: string): Promise<Place[]>;
23
+ abstract searchInBounds(query: string, bounds: LatLngBounds): Promise<Place[]>;
24
+ abstract searchNearBy(query: string, center: LatLng, radius: number): Promise<Place[]>;
25
+ }
26
+ export declare class GooglePlacesService extends PlacesService {
27
+ inner: google.maps.places.PlacesService;
28
+ constructor(map: GoogleMap, options: PlaceServiceOptions);
29
+ search(query: string): Promise<Place[]>;
30
+ searchInBounds(query: string, bounds: LatLngBounds): Promise<Place[]>;
31
+ searchNearBy(query: string, center: LatLng, radius: number): Promise<Place[]>;
32
+ private searchImpl;
33
+ }
34
+ export declare class BaiduPlacesService extends PlacesService {
35
+ private searchRequestMap;
36
+ get inner(): BMap.LocalSearch;
37
+ currentSearch: BMap.LocalSearch | undefined;
38
+ constructor(map: BaiduMap, options: PlaceServiceOptions);
39
+ search(query: string): Promise<Place[]>;
40
+ searchInBounds(query: string, bounds: LatLngBounds): Promise<Place[]>;
41
+ searchNearBy(query: string, center: LatLng, radius: number): Promise<Place[]>;
42
+ private newSearch;
43
+ }
@@ -1,23 +1,25 @@
1
- /// <reference types="googlemaps" />
1
+ /// <reference types="google.maps" />
2
2
  import { LatLng, LatLngBounds } from '../lat-lng';
3
- import { AbstractMap } from './map';
4
- import type { MapOptions, GestureHandlingOptions, MapStyle } from './map-options';
5
- import type { GoogleOverlay } from './overlay/overlay';
6
- import { type MarkerClustererOptions, GoogleMarkerClusterer } from './extra/marker-clusterer';
7
- import { GooglePolyline } from './overlay/polyline';
8
- import { GooglePolygon } from './overlay/polygon';
9
- import { GoogleCircle } from './overlay/circle';
3
+ import { Point, type Padding } from '../types';
10
4
  import { CustomControl } from './controls/control';
11
5
  import { GoogleMapTypeControl } from './controls/map-type.control';
12
- import { GoogleZoomControl } from './controls/zoom.control';
13
6
  import { GoogleScaleControl } from './controls/scale.control';
14
- import { GoogleMarker } from './overlay/marker';
15
- import { GoogleInfoWindow } from './overlay/info-window';
7
+ import { GoogleZoomControl } from './controls/zoom.control';
8
+ import { Autocomplete, type AutocompleteOptions } from './extra/autocomplete';
9
+ import { GoogleMarkerClusterer, type MarkerClustererOptions } from './extra/marker-clusterer';
10
+ import { type PlaceServiceOptions, type PlacesService } from './extra/places-service';
11
+ import { AbstractMap } from './map';
12
+ import type { GestureHandlingOptions, MapOptions, MapStyle } from './map-options';
16
13
  import { BuildInMapTypeId, MapType, type Layer, type OverlayMapType } from './map-type';
17
- import { type Padding, Point } from '../types';
18
- import { GoogleLabelOverlay } from './overlay/label';
19
- import { GoogleInfoBoxOverlay } from './overlay/info-box';
14
+ import { GoogleCircle } from './overlay/circle';
20
15
  import type { ElementOverlay } from './overlay/element-overlay';
16
+ import { GoogleInfoBoxOverlay } from './overlay/info-box';
17
+ import { GoogleInfoWindow } from './overlay/info-window';
18
+ import { GoogleLabelOverlay } from './overlay/label';
19
+ import { GoogleMarker } from './overlay/marker';
20
+ import type { GoogleOverlay } from './overlay/overlay';
21
+ import { GooglePolygon } from './overlay/polygon';
22
+ import { GooglePolyline } from './overlay/polyline';
21
23
  export declare class GoogleMap extends AbstractMap {
22
24
  mapOptions: MapOptions;
23
25
  setDefaultCursor(cursor: string): void;
@@ -65,4 +67,6 @@ export declare class GoogleMap extends AbstractMap {
65
67
  createZoomControl: typeof GoogleZoomControl.create;
66
68
  createScaleControl: typeof GoogleScaleControl.create;
67
69
  createMarkerClusterer(options: MarkerClustererOptions): GoogleMarkerClusterer;
70
+ createAutocomplete(options: AutocompleteOptions): Autocomplete;
71
+ createPlaceService(options: PlaceServiceOptions): PlacesService;
68
72
  }
@@ -1,7 +1,9 @@
1
1
  /// <reference types="heremaps" />
2
+ import { CoordType, LatLng } from '../lat-lng';
3
+ import type { Autocomplete, AutocompleteOptions } from './extra/autocomplete';
4
+ import type { PlaceServiceOptions, PlacesService } from './extra/places-service';
2
5
  import { AbstractMap } from './map';
3
6
  import type { MapOptions } from './map-options';
4
- import { CoordType, LatLng } from '../lat-lng';
5
7
  export declare class HereMap extends AbstractMap {
6
8
  mapOptions: MapOptions;
7
9
  setDefaultCursor(cursor: string): void;
@@ -46,4 +48,6 @@ export declare class HereMap extends AbstractMap {
46
48
  createMapTypeControl(options: import('./controls/map-type.control').MapTypeControlOptions): import('./controls/map-type.control').MapTypeControl;
47
49
  createZoomControl(options: import('./controls/zoom.control').ZoomControlOptions): import('./controls/zoom.control').ZoomControl;
48
50
  createScaleControl(options: import('./controls/scale.control').ScaleControlOptions): import('./controls/zoom.control').ZoomControl;
51
+ createAutocomplete(options: AutocompleteOptions): Autocomplete;
52
+ createPlaceService(options: PlaceServiceOptions): PlacesService;
49
53
  }
@@ -1,4 +1,4 @@
1
- /// <reference types="googlemaps" />
1
+ /// <reference types="google.maps" />
2
2
  import { LatLng } from '../lat-lng';
3
3
  import type { BuildInMapTypeId } from './map-type';
4
4
  export declare const InfoWindowModeValues: readonly ["single", "multi"];
@@ -1,10 +1,10 @@
1
1
  /// <reference types="baidumap-web-sdk" />
2
2
  /// <reference types="baidumap-web-sdk" />
3
- /// <reference types="googlemaps" />
4
- import type { GoogleLayer } from '../unions';
5
- import type { Point } from '../types';
6
- import { CoordType } from '../lat-lng';
3
+ /// <reference types="google.maps" />
7
4
  import { FastFindValues } from '../../utils/values';
5
+ import { CoordType } from '../lat-lng';
6
+ import type { Point } from '../types';
7
+ import type { GoogleLayer } from '../unions';
8
8
  /**
9
9
  * 内置地图的id
10
10
  */
@@ -1,24 +1,26 @@
1
- import type { CoordType, CoordTypeSupplier, LatLng, LatLngBounds } from '../lat-lng';
2
- import type { MarkerOverlay, MarkerOptions } from './overlay/marker';
3
- import type { Overlay } from './overlay/overlay';
4
- import type { UnionMap } from '../unions';
5
- import type { MarkerClustererOptions, MarkerClusterer } from './extra/marker-clusterer';
6
- import type { InfoWindowOverlay, InfoWindowOptions } from './overlay/info-window';
7
- import type { PolylineOptions, PolylineOverlay } from './overlay/polyline';
8
- import type { PolygonOptions, PolygonOverlay } from './overlay/polygon';
9
- import type { CircleOptions, CircleOverlay } from './overlay/circle';
10
1
  import type { Tg } from '../event';
11
2
  import type { AbstractEventTargetDelegate } from '../event-target';
12
- import type { CustomControl, AbstractControl } from './controls/control';
13
- import type { MapTypeControlOptions, MapTypeControl } from './controls/map-type.control';
14
- import type { ZoomControlOptions, ZoomControl } from './controls/zoom.control';
3
+ import type { CoordType, CoordTypeSupplier, LatLng, LatLngBounds } from '../lat-lng';
4
+ import type { Padding, Point } from '../types';
5
+ import type { UnionMap } from '../unions';
6
+ import type { AbstractControl, CustomControl } from './controls/control';
7
+ import type { MapTypeControl, MapTypeControlOptions } from './controls/map-type.control';
15
8
  import type { ScaleControlOptions } from './controls/scale.control';
9
+ import type { ZoomControl, ZoomControlOptions } from './controls/zoom.control';
10
+ import type { Autocomplete, AutocompleteOptions } from './extra/autocomplete';
11
+ import type { MarkerClusterer, MarkerClustererOptions } from './extra/marker-clusterer';
12
+ import type { PlaceServiceOptions, PlacesService } from './extra/places-service';
16
13
  import type { GestureHandlingOptions, MapStyle } from './map-options';
17
- import type { BuildInMapTypeId, MapType, Layer, OverlayMapType } from './map-type';
18
- import type { Padding, Point } from '../types';
19
- import type { LabelOptions, LabelOverlay } from './overlay/label';
20
- import type { InfoBoxOptions, InfoBoxOverlay } from './overlay/info-box';
14
+ import type { BuildInMapTypeId, Layer, MapType, OverlayMapType } from './map-type';
15
+ import type { CircleOptions, CircleOverlay } from './overlay/circle';
21
16
  import type { ElementOverlay } from './overlay/element-overlay';
17
+ import type { InfoBoxOptions, InfoBoxOverlay } from './overlay/info-box';
18
+ import type { InfoWindowOptions, InfoWindowOverlay } from './overlay/info-window';
19
+ import type { LabelOptions, LabelOverlay } from './overlay/label';
20
+ import type { MarkerOptions, MarkerOverlay } from './overlay/marker';
21
+ import type { Overlay } from './overlay/overlay';
22
+ import type { PolygonOptions, PolygonOverlay } from './overlay/polygon';
23
+ import type { PolylineOptions, PolylineOverlay } from './overlay/polyline';
22
24
  export type AbstractMapEventMap = {
23
25
  click: Tg.MouseEvent;
24
26
  dblclick: Tg.MouseEvent;
@@ -106,6 +108,8 @@ export declare abstract class AbstractMap implements CoordTypeSupplier, Tg.Event
106
108
  abstract removeOverlay(overlay: Overlay): void;
107
109
  abstract createMarker(options: MarkerOptions): MarkerOverlay;
108
110
  abstract createMarkerClusterer(options: MarkerClustererOptions): MarkerClusterer;
111
+ abstract createAutocomplete(options: AutocompleteOptions): Autocomplete;
112
+ abstract createPlaceService(options: PlaceServiceOptions): PlacesService;
109
113
  abstract createInfoWindow(options: InfoWindowOptions): InfoWindowOverlay;
110
114
  abstract createInfoBox(options: InfoBoxOptions): InfoBoxOverlay;
111
115
  abstract createPolyline(options: PolylineOptions): PolylineOverlay;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="baidumap-web-sdk" />
2
2
  import { Point } from '../../types';
3
- import type { BMarker } from './marker';
4
3
  import './baidu-info-box.scss';
4
+ import type { BMarker } from './marker';
5
5
  export type BaiduInfoBox = InstanceType<ReturnType<typeof createBaiduInfoBoxClass>>;
6
6
  export declare function createBaiduInfoBox(content: HTMLElement, position?: BMap.Point, offset?: Point, zIndex?: number, maxWidth?: number, borderClass?: string): {
7
7
  container: HTMLElement;
@@ -1,11 +1,11 @@
1
1
  /// <reference types="baidumap-web-sdk" />
2
- /// <reference types="googlemaps" />
2
+ /// <reference types="google.maps" />
3
3
  import type { Tg } from '../../event';
4
- import type { Overlay } from './overlay';
5
- import { type Shape, type ShapeOptions, BaiduShape, GoogleShape } from './shape';
6
4
  import { LatLng } from '../../lat-lng';
7
5
  import type { BaiduMap } from '../baidu-map';
8
6
  import type { GoogleMap } from '../google-map';
7
+ import type { Overlay } from './overlay';
8
+ import { BaiduShape, GoogleShape, type Shape, type ShapeOptions } from './shape';
9
9
  type CircleEventMap = {
10
10
  click: Tg.Event;
11
11
  dblclick: Tg.Event;
@@ -1,6 +1,6 @@
1
- /// <reference types="googlemaps" />
1
+ /// <reference types="google.maps" />
2
2
  import { LatLng } from '../../lat-lng';
3
- import type { Point } from '../../types';
3
+ import { Point } from '../../types';
4
4
  import type { AbstractMap } from '../map';
5
5
  import './element-overlay.scss';
6
6
  export declare enum MapPane {