vue3-google-map 0.26.0 → 0.27.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.
@@ -0,0 +1,16 @@
1
+ import { SuperClusterViewportAlgorithm, type AlgorithmInput, type AlgorithmOutput } from "@googlemaps/markerclusterer";
2
+ /**
3
+ * Wrapper around SuperClusterViewportAlgorithm that handles empty marker arrays.
4
+ *
5
+ * Stopgap for upstream issue googlemaps/js-markerclusterer#1129.
6
+ * The fix from PR #1014 was only applied to SuperClusterAlgorithm, not
7
+ * SuperClusterViewportAlgorithm. This wrapper adds the same empty markers check.
8
+ *
9
+ * @see https://github.com/googlemaps/js-markerclusterer/issues/1129
10
+ * @see https://github.com/googlemaps/js-markerclusterer/pull/1130
11
+ *
12
+ * TODO: Remove once upstream PR #1130 is released.
13
+ */
14
+ export declare class SafeSuperClusterViewportAlgorithm extends SuperClusterViewportAlgorithm {
15
+ calculate(input: AlgorithmInput): AlgorithmOutput;
16
+ }
@@ -1,12 +1,12 @@
1
1
  export { default as GoogleMap } from "./GoogleMap.vue";
2
- export { default as AdvancedMarker } from "./AdvancedMarker.vue";
3
- export { default as Marker } from "./Marker";
2
+ export { default as AdvancedMarker, type IAdvancedMarkerExposed as AdvancedMarkerExposed } from "./AdvancedMarker.vue";
3
+ export { default as Marker, type IMarkerExposed as MarkerExposed } from "./Marker";
4
4
  export { default as Polyline } from "./Polyline";
5
5
  export { default as Polygon } from "./Polygon";
6
6
  export { default as Rectangle } from "./Rectangle";
7
7
  export { default as Circle } from "./Circle";
8
8
  export { default as CustomControl } from "./CustomControl.vue";
9
- export { default as InfoWindow } from "./InfoWindow.vue";
10
- export { default as MarkerCluster } from "./MarkerCluster";
11
- export { default as CustomMarker } from "./CustomMarker.vue";
9
+ export { default as InfoWindow, type IInfoWindowExposed as InfoWindowExposed } from "./InfoWindow.vue";
10
+ export { default as MarkerCluster, type IMarkerClusterExposed as MarkerClusterExposed } from "./MarkerCluster";
11
+ export { default as CustomMarker, type ICustomMarkerExposed as CustomMarkerExposed } from "./CustomMarker.vue";
12
12
  export { default as HeatmapLayer } from "./HeatmapLayer";
@@ -5,5 +5,5 @@ type IComponent<T> = T extends "Marker" ? google.maps.Marker : T extends "Polyli
5
5
  type IComponentOptions<T> = T extends "Marker" ? google.maps.MarkerOptions : T extends "Polyline" ? google.maps.PolylineOptions : T extends "Polygon" ? google.maps.PolygonOptions : T extends "Rectangle" ? google.maps.RectangleOptions : T extends "Circle" ? google.maps.CircleOptions : T extends typeof customMarkerClassSymbol ? google.maps.CustomMarkerOptions & {
6
6
  element?: HTMLElement;
7
7
  } : never;
8
- export declare const useSetupMapComponent: <T extends ICtorKey>(ctorKey: T, events: string[], options: Ref<IComponentOptions<T>>, emit: (event: string, ...args: unknown[]) => void) => Ref<IComponent<T> | undefined>;
8
+ export declare const useSetupMapComponent: <T extends ICtorKey>(ctorKey: T, events: readonly string[], options: Ref<IComponentOptions<T>>, emit: (event: any, ...args: any[]) => void) => Ref<IComponent<T> | undefined>;
9
9
  export {};
@@ -1,2 +1,3 @@
1
1
  export * from "./components/index";
2
2
  export { mapSymbol, apiSymbol, mapTilesLoadedSymbol } from "./shared/index";
3
+ export type { ICustomMarkerOptions as CustomMarkerOptions } from "./@types/index";
@@ -10,4 +10,4 @@ export declare const customMarkerClassSymbol: "CustomMarker";
10
10
  * was fully loaded (including its tiles) to decide their behavior
11
11
  */
12
12
  export declare const mapTilesLoadedSymbol: InjectionKey<Ref<boolean>>;
13
- export declare const polylineEvents: string[];
13
+ export declare const polylineEvents: readonly ["click", "dblclick", "drag", "dragend", "dragstart", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "rightclick"];
@@ -1,13 +1,8 @@
1
1
  import { createCustomMarkerClass } from "./utils";
2
+ import type { ICustomMarkerOptions } from "./@types/index";
2
3
  declare global {
3
4
  namespace google.maps {
4
- interface CustomMarkerOptions {
5
- position?: google.maps.MarkerOptions["position"];
6
- map?: google.maps.Map | google.maps.StreetViewPanorama | null;
7
- anchorPoint?: "CENTER" | "TOP_CENTER" | "BOTTOM_CENTER" | "LEFT_CENTER" | "RIGHT_CENTER" | "TOP_LEFT" | "TOP_RIGHT" | "BOTTOM_LEFT" | "BOTTOM_RIGHT";
8
- offsetX?: number;
9
- offsetY?: number;
10
- zIndex?: number | null;
5
+ interface CustomMarkerOptions extends ICustomMarkerOptions {
11
6
  }
12
7
  let CustomMarker: ReturnType<typeof createCustomMarkerClass>;
13
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue3-google-map",
3
- "version": "0.26.0",
3
+ "version": "0.27.1",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,6 +17,7 @@
17
17
  ],
18
18
  "exports": {
19
19
  ".": {
20
+ "browser": "./dist/index.umd.js",
20
21
  "import": "./dist/index.mjs",
21
22
  "require": "./dist/index.cjs",
22
23
  "types": "./dist/types/index.d.ts"
@@ -51,6 +52,7 @@
51
52
  "docs:serve": "vitepress serve docs",
52
53
  "release": "standard-version",
53
54
  "test": "jest",
55
+ "test:types": "pnpm run build && tsc --noEmit --project tsconfig.typetest.json",
54
56
  "test:watch": "jest --watch",
55
57
  "test:coverage": "jest --coverage"
56
58
  },
@@ -78,6 +80,7 @@
78
80
  "eslint-config-prettier": "^8.10.0",
79
81
  "eslint-plugin-prettier": "^3.4.1",
80
82
  "eslint-plugin-vue": "^7.20.0",
83
+ "expect-type": "^1.3.0",
81
84
  "jest": "^29.7.0",
82
85
  "jest-environment-jsdom": "^29.7.0",
83
86
  "pnpm": "^10.13.1",