Skip to content

Commit

Permalink
refactor: exports Marker from marker-utils (#641)
Browse files Browse the repository at this point in the history
  • Loading branch information
amuramoto authored May 23, 2023
1 parent 4c041a3 commit 40b33c8
Show file tree
Hide file tree
Showing 13 changed files with 8,786 additions and 5,535 deletions.
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

0 comments on commit 40b33c8

Please sign in to comment.