Skip to content
Open
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
2 changes: 1 addition & 1 deletion packages/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"license": "MIT",
"dependencies": {
"@arcgis/core": "4.31.6",
"@googlemaps/js-api-loader": "1.14.3",
"@googlemaps/js-api-loader": "2.0.2",
"@storybook/mdx2-csf": "^1.1.0",
"@types/leaflet": "1.9.15",
"leaflet": "1.9.4",
Expand Down
14 changes: 7 additions & 7 deletions packages/storybook/src/stories/google/setup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Loader } from "@googlemaps/js-api-loader";
import { setOptions, importLibrary } from "@googlemaps/js-api-loader";
import {
setupMapContainer,
setupControls,
Expand All @@ -20,7 +20,7 @@ const initialiseGoogleMap = async ({
zoom: number;
}) => {
// Check for Google Maps API key (can be set via environment or global)
let apiKey = (import.meta as any).env.GOOGLE_API_KEY;
const apiKey = (import.meta as any).env.GOOGLE_API_KEY;

// If no API key is provided, use empty string (will still work for development)
if (!apiKey) {
Expand All @@ -29,13 +29,13 @@ const initialiseGoogleMap = async ({
);
}

const loader = new Loader({
apiKey,
version: "weekly",
setOptions({
key: apiKey,
v: "weekly",
});

// Load Google Maps API
const google = await loader.load();
// Load Google Maps API (maps for Map/Data/OverlayView, core for LatLng/Point/Size)
await Promise.all([importLibrary("maps"), importLibrary("core")]);

// Create Google Maps instance
const map = new google.maps.Map(mapContainer, {
Expand Down
2 changes: 1 addition & 1 deletion packages/terra-draw-google-maps-adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Terra Draw Adapter for Google Maps JavaScript API",
"peerDependencies": {
"terra-draw": "^1.0.0",
"@googlemaps/js-api-loader": "^1.14.3"
"@googlemaps/js-api-loader": "^1.14.3 || ^2.0.0"
},
"devDependencies": {
"@types/google.maps": "^3.49.2"
Expand Down