Skip to content

Commit

Permalink
fix: enable advanced markers in the examples (#661)
Browse files Browse the repository at this point in the history
  • Loading branch information
vicb committed Jun 1, 2023
1 parent 709077f commit b4cb8f3
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
5 changes: 3 additions & 2 deletions examples/algorithms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ import {
NoopAlgorithm,
SuperClusterAlgorithm,
} from "../src";
import { getLoaderOptions, sync } from "./config";
import { MAP_ID, getLoaderOptions, sync } from "./config";

import { Loader } from "@googlemaps/js-api-loader";
import trees from "./trees.json";

const mapOptions = {
const mapOptions: google.maps.MapOptions = {
center: { lat: 40.7128, lng: -73.85 },
zoom: 10,
mapId: MAP_ID,
};

new Loader(getLoaderOptions()).load().then(() => {
Expand Down
4 changes: 2 additions & 2 deletions examples/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@

import { LoaderOptions } from "@googlemaps/js-api-loader";

export const MAP_ID = "7b9a897acd0a63a4";
export const MAP_ID = "DEMO_MAP_ID";

const DEFAULT_KEY = "AIzaSyDhRjl83cPVWeaEer-SnKIw7GTjBuqWxXI";

export const getLoaderOptions = (): LoaderOptions => ({
apiKey: localStorage.getItem("gmaps-key") ?? DEFAULT_KEY,
version: "weekly",
libraries: [],
libraries: ["marker"],
});

// helper function to keep maps in sync
Expand Down
5 changes: 3 additions & 2 deletions examples/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
* limitations under the License.
*/

import { getLoaderOptions } from "./config";
import { MAP_ID, getLoaderOptions } from "./config";
import { Loader } from "@googlemaps/js-api-loader";
import { MarkerClusterer } from "../src";
import trees from "./trees.json";

const mapOptions = {
const mapOptions: google.maps.MapOptions = {
center: { lat: 40.7128, lng: -73.85 },
zoom: 12,
mapId: MAP_ID,
};

new Loader(getLoaderOptions()).load().then(() => {
Expand Down
5 changes: 3 additions & 2 deletions examples/renderers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@ import {
MarkerClusterer,
Renderer,
} from "../src";
import { getLoaderOptions, sync } from "./config";
import { MAP_ID, getLoaderOptions, sync } from "./config";

import { Loader } from "@googlemaps/js-api-loader";
import { interpolateRgb } from "d3-interpolate";
import trees from "./trees.json";

const mapOptions = {
const mapOptions: google.maps.MapOptions = {
center: { lat: 40.7128, lng: -73.85 },
zoom: 10,
mapId: MAP_ID,
};

const interpolatedRenderer = {
Expand Down
5 changes: 3 additions & 2 deletions examples/updates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
* limitations under the License.
*/

import { getLoaderOptions } from "./config";
import { MAP_ID, getLoaderOptions } from "./config";
import { Loader } from "@googlemaps/js-api-loader";
import { MarkerClusterer } from "../src";
import trees from "./trees.json";

const mapOptions = {
const mapOptions: google.maps.MapOptions = {
center: { lat: 40.7128, lng: -73.85 },
zoom: 12,
mapId: MAP_ID,
};

new Loader(getLoaderOptions()).load().then(async () => {
Expand Down

0 comments on commit b4cb8f3

Please sign in to comment.