tg-map-vue3 3.4.4 → 3.4.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/CHANGELOG.md CHANGED
@@ -5,6 +5,7 @@
5
5
  - feat: 添加矩形[TgRectangle]
6
6
  - feat: 点/圆/矩形/多边形/多段线 在`editable`/`draggable`模式时支持双向绑定
7
7
  - ***BREAKING CHANGE***: [TgPolygon].polygon, [TgPolyline].polyline 属性, 统一改成`overlay`
8
+ - ***BREAKING CHANGE***: 修复`setDisableDoubleClickZoom(type)`在google/baidu行为相反的问题, 并且重命名为`setDoubleClickZoom(enable)`
8
9
 
9
10
  ## 3.3.x
10
11
 
@@ -22,7 +22,6 @@ import { BaiduPolygon } from './overlay/polygon';
22
22
  import { BaiduPolyline } from './overlay/polyline';
23
23
  import { BaiduRectangle } from './overlay/rectangle';
24
24
  export declare class BaiduMap extends AbstractMap {
25
- setDefaultCursor(cursor: string): void;
26
25
  private buildInMapTypeId2BIMT;
27
26
  private baiduMapType2BIMT;
28
27
  private map;
@@ -34,8 +33,9 @@ export declare class BaiduMap extends AbstractMap {
34
33
  removeEventListener<K extends keyof AbstractMapEventMap>(type: K, listener: (event: AbstractMapEventMap[K]) => void): void;
35
34
  fromContainerPointToLatLng(point: Point): LatLng;
36
35
  fromLatLngToContainerPoint(latLng: LatLng): Point;
36
+ setDefaultCursor(cursor: string): void;
37
37
  setDraggable(draggable: boolean): void;
38
- setDisableDoubleClickZoom(type: boolean): void;
38
+ setDoubleClickZoom(enable: boolean): void;
39
39
  getCenter(): LatLng;
40
40
  setCenter(latlng: LatLng): void;
41
41
  getZoom(): number;
@@ -24,7 +24,6 @@ import { GooglePolyline } from './overlay/polyline';
24
24
  import { GoogleRectangle } from './overlay/rectangle';
25
25
  export declare class GoogleMap extends AbstractMap {
26
26
  mapOptions: MapOptions;
27
- setDefaultCursor(cursor: string): void;
28
27
  private buildInMapTypeId2BIMT;
29
28
  private googleMapTypeId2BIMT;
30
29
  private map;
@@ -34,8 +33,9 @@ export declare class GoogleMap extends AbstractMap {
34
33
  get coordType(): import("../lat-lng").CoordType;
35
34
  fromContainerPointToLatLng(point: Point): LatLng;
36
35
  fromLatLngToContainerPoint(latLng: LatLng): Point;
36
+ setDefaultCursor(cursor: string): void;
37
37
  setDraggable(draggable: boolean): void;
38
- setDisableDoubleClickZoom(type: boolean): void;
38
+ setDoubleClickZoom(enable: boolean): void;
39
39
  getCenter(): LatLng;
40
40
  setCenter(latlng: LatLng): void;
41
41
  setMinZoom(zoom: number): void;
@@ -24,7 +24,6 @@ import type { PolylineOptions, PolylineOverlay } from './overlay/polyline';
24
24
  import type { RectangleOptions, RectangleOverlay } from './overlay/rectangle';
25
25
  export declare class HereMap extends AbstractMap {
26
26
  mapOptions: MapOptions;
27
- setDefaultCursor(cursor: string): void;
28
27
  private map;
29
28
  defaultLayers: H.service.DefaultLayers;
30
29
  constructor(element: HTMLElement, mapOptions: MapOptions);
@@ -35,8 +34,9 @@ export declare class HereMap extends AbstractMap {
35
34
  setGestureHandling(gestureHandling: GestureHandlingOptions): void;
36
35
  fromContainerPointToLatLng(point: Point): LatLng;
37
36
  fromLatLngToContainerPoint(latLng: LatLng): Point;
37
+ setDefaultCursor(cursor: string): void;
38
38
  setDraggable(draggable: boolean): void;
39
- setDisableDoubleClickZoom(type: boolean): void;
39
+ setDoubleClickZoom(enable: boolean): void;
40
40
  setMinZoom(zoom: number): void;
41
41
  setMaxZoom(zoom: number): void;
42
42
  setMapStyle(mapStyle: MapStyle): void;
@@ -95,14 +95,15 @@ export declare abstract class AbstractMap implements CoordTypeSupplier, Tg.Event
95
95
  abstract fromContainerPointToLatLng(point: Point): LatLng;
96
96
  /** @see fromContainerPointToLatLng */
97
97
  abstract fromLatLngToContainerPoint(latLng: LatLng): Point;
98
+ abstract setDefaultCursor(cursor: CSS.Property.Cursor): void;
98
99
  /**
99
100
  * ## 不同行为
100
101
  * - baidu: 禁用拖拽后, 依然可以滚轮缩放
101
102
  * - google: 禁用拖拽后, 不能滚轮缩放
102
103
  */
103
104
  abstract setDraggable(draggable: boolean): void;
104
- abstract setDefaultCursor(cursor: CSS.Property.Cursor): void;
105
- abstract setDisableDoubleClickZoom(type: boolean): void;
105
+ /** 启用/禁用双击放大 */
106
+ abstract setDoubleClickZoom(enable: boolean): void;
106
107
  abstract getCenter(): LatLng;
107
108
  /**
108
109
  * ## {@link setZoom}和{@link setCenter}的调用顺序问题
package/dist/tg-map.js CHANGED
@@ -3833,9 +3833,6 @@ class Oi extends nt {
3833
3833
  a && (console.debug("remove:info-box", a), this.map.removeOverlay(a));
3834
3834
  });
3835
3835
  }
3836
- setDefaultCursor(e) {
3837
- this.innerMap.setDefaultCursor(e);
3838
- }
3839
3836
  setGestureHandling(e = G.auto) {
3840
3837
  switch (e === G.auto && (e = this.element.parentElement && Ve.isScrollable(this.element.parentElement) ? G.cooperative : G.greedy), e) {
3841
3838
  case G.cooperative:
@@ -3875,10 +3872,13 @@ class Oi extends nt {
3875
3872
  fromLatLngToContainerPoint(e) {
3876
3873
  return this.innerMap.pointToPixel(e.toBaidu(this.coordType));
3877
3874
  }
3875
+ setDefaultCursor(e) {
3876
+ this.innerMap.setDefaultCursor(e);
3877
+ }
3878
3878
  setDraggable(e) {
3879
3879
  e ? this.innerMap.enableDragging() : this.innerMap.disableDragging();
3880
3880
  }
3881
- setDisableDoubleClickZoom(e) {
3881
+ setDoubleClickZoom(e) {
3882
3882
  e ? this.map.enableDoubleClickZoom() : this.map.disableDoubleClickZoom();
3883
3883
  }
3884
3884
  getCenter() {
@@ -4011,9 +4011,6 @@ class Ci extends nt {
4011
4011
  mapTypeId: s == null ? void 0 : s.getGoogleMapTypeId()
4012
4012
  }), this.setEventTargetDelegate(new ee(this.map, this));
4013
4013
  }
4014
- setDefaultCursor(e) {
4015
- this.innerMap.setOptions({ draggableCursor: e });
4016
- }
4017
4014
  setGestureHandling(e) {
4018
4015
  this.map.setOptions({
4019
4016
  gestureHandling: e
@@ -4045,11 +4042,14 @@ class Ci extends nt {
4045
4042
  const o = Math.pow(2, h), l = r.fromLatLngToPoint(e.toGoogle(this.coordType));
4046
4043
  return l == null ? q.ZERO : { x: (l.x - n.x) * o, y: (l.y - a.y) * o };
4047
4044
  }
4045
+ setDefaultCursor(e) {
4046
+ this.innerMap.setOptions({ draggableCursor: e });
4047
+ }
4048
4048
  setDraggable(e) {
4049
4049
  this.innerMap.setOptions({ draggable: e });
4050
4050
  }
4051
- setDisableDoubleClickZoom(e) {
4052
- this.map.setOptions({ disableDoubleClickZoom: e });
4051
+ setDoubleClickZoom(e) {
4052
+ this.map.setOptions({ disableDoubleClickZoom: !e });
4053
4053
  }
4054
4054
  getCenter() {
4055
4055
  return y.fromGoogle(this.map.getCenter() ?? Y.LATLNG_ZERO, this.coordType);
@@ -4155,9 +4155,6 @@ class wi extends nt {
4155
4155
  center: (a = r.center) == null ? void 0 : a.toHere(this.coordType)
4156
4156
  }), new H.mapevents.Behavior(new H.mapevents.MapEvents(this.map)), H.ui.UI.createDefault(this.map, this.defaultLayers);
4157
4157
  }
4158
- setDefaultCursor(e) {
4159
- throw new Error("Method not implemented.");
4160
- }
4161
4158
  get innerMap() {
4162
4159
  return this.map;
4163
4160
  }
@@ -4180,10 +4177,13 @@ class wi extends nt {
4180
4177
  fromLatLngToContainerPoint(e) {
4181
4178
  throw new Error("Method not implemented.");
4182
4179
  }
4180
+ setDefaultCursor(e) {
4181
+ throw new Error("Method not implemented.");
4182
+ }
4183
4183
  setDraggable(e) {
4184
4184
  throw new Error("Method not implemented.");
4185
4185
  }
4186
- setDisableDoubleClickZoom(e) {
4186
+ setDoubleClickZoom(e) {
4187
4187
  throw new Error("Method not implemented.");
4188
4188
  }
4189
4189
  setMinZoom(e) {