Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: exports Marker from marker-utils #641

Merged
merged 1 commit into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14,299 changes: 8,772 additions & 5,527 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/algorithms/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import { Cluster } from "../cluster";
import { filterMarkersToPaddedViewport } from "./utils";
import { MarkerUtils } from "../marker-utils";
import { MarkerUtils, Marker } from "../marker-utils";

export interface AlgorithmInput {
/**
Expand Down
1 change: 1 addition & 0 deletions src/algorithms/grid.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import { GridAlgorithm } from "./grid";
import { initialize, MapCanvasProjection } from "@googlemaps/jest-mocks";
import { Marker } from "../marker-utils";

initialize();
const markers = [
Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {

import { Cluster } from "../cluster";
import equal from "fast-deep-equal";
import { MarkerUtils } from "../marker-utils";
import { MarkerUtils, Marker } from "../marker-utils";

export interface GridOptions extends ViewportAlgorithmOptions {
gridSize?: number;
Expand Down
1 change: 1 addition & 0 deletions src/algorithms/supercluster.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import { SuperClusterAlgorithm } from "./supercluster";
import { initialize } from "@googlemaps/jest-mocks";
import { Marker } from "../marker-utils";

initialize();
const markerClasses = [
Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/supercluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import { AbstractAlgorithm, AlgorithmInput, AlgorithmOutput } from "./core";
import SuperCluster, { ClusterFeature } from "supercluster";
import { MarkerUtils } from "../marker-utils";
import { MarkerUtils, Marker } from "../marker-utils";
import { Cluster } from "../cluster";
import equal from "fast-deep-equal";

Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { MarkerUtils } from "../marker-utils";
import { MarkerUtils, Marker } from "../marker-utils";

/**
* Returns the markers visible in a padded map viewport
Expand Down
2 changes: 1 addition & 1 deletion src/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { MarkerUtils } from "./marker-utils";
import { MarkerUtils, Marker } from "./marker-utils";

export interface ClusterOptions {
position?: google.maps.LatLng | google.maps.LatLngLiteral;
Expand Down
1 change: 0 additions & 1 deletion src/global.d.ts

This file was deleted.

4 changes: 4 additions & 0 deletions src/marker-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
* shared behavior of Advanced Markers and Markers.
*/

export type Marker =
| google.maps.Marker
| google.maps.marker.AdvancedMarkerElement;

export class MarkerUtils {
public static isAdvancedMarker(
marker: Marker
Expand Down
2 changes: 1 addition & 1 deletion src/markerclusterer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
} from ".";

import { initialize } from "@googlemaps/jest-mocks";
import { MarkerUtils } from "./marker-utils";
import { MarkerUtils, Marker } from "./marker-utils";

initialize();
const markerClasses = [
Expand Down
2 changes: 1 addition & 1 deletion src/markerclusterer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
import { ClusterStats, DefaultRenderer, Renderer } from "./renderer";
import { Cluster } from "./cluster";
import { OverlayViewSafe } from "./overlay-view-safe";
import { MarkerUtils } from "./marker-utils";
import { MarkerUtils, Marker } from "./marker-utils";

export type onClusterClickHandler = (
event: google.maps.MapMouseEvent,
Expand Down
1 change: 1 addition & 0 deletions src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

import { Cluster } from "./cluster";
import { Marker } from "./marker-utils";

/**
* Provides statistics on all clusters in the current render cycle for use in {@link Renderer.render}.
Expand Down