From 9a0e5b1c0219872c4afda33845dcbefdecdc256a Mon Sep 17 00:00:00 2001 From: William French Date: Tue, 23 Jun 2026 07:26:53 -0700 Subject: [PATCH 1/8] fix: Updates vite config to use correct key for prod. --- samples/vite.config.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/samples/vite.config.js b/samples/vite.config.js index 60b152624..67a9153dc 100644 --- a/samples/vite.config.js +++ b/samples/vite.config.js @@ -63,6 +63,11 @@ export default defineConfig(({ command }) => { } } + const isCI = process.env.CI === 'true'; + const apiKey = isCI + ? process.env.GOOGLE_MAPS_API_KEY + : process.env.JS_MAPS_DEV || process.env.GOOGLE_MAPS_API_KEY; + return { root: projectRepoRoot, // Vite's project root is js-api-samples/ build: { @@ -79,9 +84,7 @@ export default defineConfig(({ command }) => { }, define: { - 'import.meta.env.GOOGLE_MAPS_API_KEY': JSON.stringify( - process.env.GOOGLE_MAPS_API_KEY - ), + 'import.meta.env.GOOGLE_MAPS_API_KEY': JSON.stringify(apiKey), }, }; }); From 70d0a610070602de4958d1993693b02dbdfb4a77 Mon Sep 17 00:00:00 2001 From: William French Date: Tue, 23 Jun 2026 07:33:18 -0700 Subject: [PATCH 2/8] chore: inject GOOGLE_MAPS_API_KEY secret into deployment workflow and clean up legacy env variables --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c4c32796e..53324a195 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,6 +29,7 @@ jobs: id-token: write env: GOOGLE_MAPS_JS_SAMPLES_KEY: "${{ secrets.GOOGLE_MAPS_JS_SAMPLES_KEY }}" + GOOGLE_MAPS_API_KEY: "${{ secrets.GOOGLE_MAPS_API_KEY }}" steps: - name: Checkout main uses: actions/checkout@v4 From e082ccb1521bc0e484624d9e99f895b97f25de53 Mon Sep 17 00:00:00 2001 From: William French Date: Tue, 23 Jun 2026 09:51:14 -0700 Subject: [PATCH 3/8] feat: Updates workflows to use hidden API key values. --- .github/workflows/release.yml | 1 - .gitignore | 1 + samples/map-simple/index.html | 2 +- samples/map-simple/vite.config.js | 1 + vite.config.js | 93 +++++++++++++++++++++++++++++++ 5 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 samples/map-simple/vite.config.js create mode 100644 vite.config.js diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 53324a195..3c0b905ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,6 @@ jobs: contents: write id-token: write env: - GOOGLE_MAPS_JS_SAMPLES_KEY: "${{ secrets.GOOGLE_MAPS_JS_SAMPLES_KEY }}" GOOGLE_MAPS_API_KEY: "${{ secrets.GOOGLE_MAPS_API_KEY }}" steps: - name: Checkout main diff --git a/.gitignore b/.gitignore index 3e832de20..96c83ee38 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ samples/.env # Ignore dist files generated by build. samples/*/dist/ samples/*/*.js +!samples/*/vite.config.js # Ignore playwright outputs /test-results/ diff --git a/samples/map-simple/index.html b/samples/map-simple/index.html index 171112a1c..b4253b9dc 100644 --- a/samples/map-simple/index.html +++ b/samples/map-simple/index.html @@ -14,7 +14,7 @@ diff --git a/samples/map-simple/vite.config.js b/samples/map-simple/vite.config.js new file mode 100644 index 000000000..6207eee82 --- /dev/null +++ b/samples/map-simple/vite.config.js @@ -0,0 +1 @@ +export { default } from '../../vite.config.js'; diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 000000000..87e51300e --- /dev/null +++ b/vite.config.js @@ -0,0 +1,93 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { defineConfig } from 'vite'; +import dotenv from 'dotenv'; +import { resolve, basename } from 'path'; + +dotenv.config({ path: resolve(__dirname, '.env') }); + +export default defineConfig(({ command }) => { + // __dirname is /Users/[username]/git/js-api-samples/samples/ + const projectRepoRoot = resolve(__dirname); + + let effectiveOutDir; + const effectiveBuildInput = {}; // For rollupOptions.input + + if (command === 'build') { + // When `npm run build:vite --workspace=.` is run from a sample's directory, + // process.cwd() will be the path to that sample's directory. + const workspaceDir = process.cwd(); // e.g., /Users/[username]/git/js-api-samples/samples/test-example + const samplesBaseDir = resolve(projectRepoRoot, 'samples'); + + // Ensure we are building a specific sample within the 'samples' directory + if ( + workspaceDir.startsWith(samplesBaseDir) && + workspaceDir !== samplesBaseDir + ) { + const workspaceName = basename(workspaceDir); // e.g., "test-example" + // Output to project_root/dist/samples/workspace_name/dist/ + // This path must be relative to Vite's `root` option. + effectiveOutDir = resolve( + projectRepoRoot, + 'dist', + 'samples', + workspaceName, + 'dist' + ); + // Vite's `root` is projectRepoRoot, so input path is relative to that. + effectiveBuildInput['index'] = resolve(workspaceDir, 'index.html'); + } else { + // Fallback for builds not initiated from a specific workspace. + // This shouldn't happen with your current per-sample build scripts. + console.warn( + `Vite build initiated from unexpected directory: ${workspaceDir}. Defaulting output to root of dist.` + ); + effectiveOutDir = resolve(projectRepoRoot, 'dist'); + } + } + + const apiKey = process.env.GOOGLE_MAPS_API_KEY; + + return { + root: process.cwd(), // Always use the sample directory as the root + plugins: [ + { + name: 'html-transform', + enforce: 'pre', + transformIndexHtml(html) { + return html.replace(/GOOGLE_MAPS_API_KEY/g, apiKey); + }, + }, + ], + build: { + emptyOutDir: false, // Crucial: Do not empty the main dist dir for each sample. + outDir: effectiveOutDir || resolve(projectRepoRoot, 'dist'), // Default for serve/preview + rollupOptions: + command === 'build' && + Object.keys(effectiveBuildInput).length > 0 + ? { input: effectiveBuildInput } + : undefined, + }, + preview: { + port: 8080, + }, + + define: { + 'import.meta.env.GOOGLE_MAPS_API_KEY': JSON.stringify(apiKey), + }, + }; +}); From f5d08bdfae86e7d2f907c61aa8c440cc078c550c Mon Sep 17 00:00:00 2001 From: William French Date: Tue, 23 Jun 2026 09:51:14 -0700 Subject: [PATCH 4/8] feat: Updates workflows to use hidden API key values. --- samples/dist.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/dist.sh b/samples/dist.sh index 0c8e2b405..3bc722ba9 100755 --- a/samples/dist.sh +++ b/samples/dist.sh @@ -22,4 +22,5 @@ SAMPLE_DIR="${PROJECT_ROOT}/dist/samples/${NAME}" echo "PROJECT_ROOT: ${PROJECT_ROOT}" # Copy Vite output files to /dist/samples/${NAME}/dist -cp -r "${SCRIPT_DIR}/${NAME}/dist" "${SAMPLE_DIR}" +# This is no longer necessary as Vite is now configured to output directly to ${SAMPLE_DIR}/dist natively! +# cp -r "${SCRIPT_DIR}/${NAME}/dist" "${SAMPLE_DIR}" From 661cc25b9c2c1b8b100647fa09c30dd3131085e6 Mon Sep 17 00:00:00 2001 From: William French Date: Tue, 23 Jun 2026 09:51:14 -0700 Subject: [PATCH 5/8] feat: Updates workflows to use hidden API key values. --- .github/workflows/tests.yml | 1 + e2e/samples.spec.ts | 7 ++- samples/build-single.sh | 3 +- samples/dist.sh | 26 ----------- samples/vite.config.js | 90 ------------------------------------- 5 files changed, 5 insertions(+), 122 deletions(-) delete mode 100755 samples/dist.sh delete mode 100644 samples/vite.config.js diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7f6855980..cc7d36d37 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,6 +35,7 @@ on: env: SKIP_DIST: ${{ github.event_name == 'pull_request' || github.event_name == 'schedule' }} + GOOGLE_MAPS_API_KEY: "${{ secrets.JS_MAPS_DEV }}" concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/e2e/samples.spec.ts b/e2e/samples.spec.ts index f4a4d5f11..ac9ddc21a 100644 --- a/e2e/samples.spec.ts +++ b/e2e/samples.spec.ts @@ -146,7 +146,7 @@ foldersToTest.forEach((sampleFolder) => { // START run the preview // Get an available port const port = 8080; - const url = `http://localhost:${port}/`; + const url = `http://localhost:${port}/samples/${sampleFolder}/dist/`; const viteProcess = childProcess.spawn( 'vite', @@ -154,7 +154,6 @@ foldersToTest.forEach((sampleFolder) => { { cwd: path.join(samplesDir, sampleFolder), stdio: 'inherit', - detached: true, // Allows parent to exit independently, though we kill it in finally } ); @@ -252,8 +251,8 @@ foldersToTest.forEach((sampleFolder) => { ); } } - // Add a small delay to allow the process to terminate - await page.waitForTimeout(500); + // Add a small delay to allow the process to terminate without depending on the potentially closed page object + await new Promise((resolve) => setTimeout(resolve, 500)); } }); }); diff --git a/samples/build-single.sh b/samples/build-single.sh index be2eecfa9..0299702f4 100644 --- a/samples/build-single.sh +++ b/samples/build-single.sh @@ -196,5 +196,4 @@ set -e bash ../jsfiddle.sh "$NAME" bash ../app.sh "$NAME" bash ../docs.sh "$NAME" -npm run build:vite --workspace=. -bash ../dist.sh "$NAME" \ No newline at end of file +npm run build:vite --workspace=. \ No newline at end of file diff --git a/samples/dist.sh b/samples/dist.sh deleted file mode 100755 index 3bc722ba9..000000000 --- a/samples/dist.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# Copy/generate: -# - Vite build output for hosting - -if [ "$SKIP_DIST" = "true" ]; then - echo ">>>Skipping dist.sh (SKIP_DIST is true)" - exit 0 -fi - -echo ">>>Running dist.sh" - -NAME=$1 # The name of the folder, taken from package.json "build" line. - -# /Users/[USERNAME]/git/js-api-samples/samples - -SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" # Script directory (/samples) -PROJECT_ROOT=$(dirname "$SCRIPT_DIR") # Get the parent directory (js-api-samples) -DIST_DIR="${PROJECT_ROOT}/dist" -SAMPLE_DIR="${PROJECT_ROOT}/dist/samples/${NAME}" - -echo "PROJECT_ROOT: ${PROJECT_ROOT}" - -# Copy Vite output files to /dist/samples/${NAME}/dist -# This is no longer necessary as Vite is now configured to output directly to ${SAMPLE_DIR}/dist natively! -# cp -r "${SCRIPT_DIR}/${NAME}/dist" "${SAMPLE_DIR}" diff --git a/samples/vite.config.js b/samples/vite.config.js deleted file mode 100644 index 67a9153dc..000000000 --- a/samples/vite.config.js +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2024 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { defineConfig } from 'vite'; -import dotenv from 'dotenv'; -import { resolve, basename } from 'path'; - -dotenv.config(); - -export default defineConfig(({ command }) => { - // __dirname is /Users/wfrench/git/js-api-samples/samples/ - const projectRepoRoot = resolve(__dirname, '..'); // /Users/wfrench/git/js-api-samples/ - - let effectiveOutDir; - const effectiveBuildInput = {}; // For rollupOptions.input - - if (command === 'build') { - // When `npm run build:vite --workspace=.` is run from a sample's directory, - // process.cwd() will be the path to that sample's directory. - const workspaceDir = process.cwd(); // e.g., /Users/wfrench/git/js-api-samples/samples/test-example - const samplesBaseDir = resolve(projectRepoRoot, 'samples'); - - // Ensure we are building a specific sample within the 'samples' directory - if ( - workspaceDir.startsWith(samplesBaseDir) && - workspaceDir !== samplesBaseDir - ) { - const workspaceName = basename(workspaceDir); // e.g., "test-example" - // Output to project_root/dist/samples/workspace_name/dist/ - // This path must be relative to Vite's `root` option. - effectiveOutDir = resolve( - projectRepoRoot, - 'dist', - 'samples', - workspaceName, - 'dist' - ); - // Vite's `root` is projectRepoRoot, so input path is relative to that. - effectiveBuildInput[resolve(workspaceDir, 'index.html')] = resolve( - workspaceDir, - 'index.html' - ); - } else { - // Fallback for builds not initiated from a specific workspace. - // This shouldn't happen with your current per-sample build scripts. - console.warn( - `Vite build initiated from unexpected directory: ${workspaceDir}. Defaulting output to root of dist.` - ); - effectiveOutDir = resolve(projectRepoRoot, 'dist'); - } - } - - const isCI = process.env.CI === 'true'; - const apiKey = isCI - ? process.env.GOOGLE_MAPS_API_KEY - : process.env.JS_MAPS_DEV || process.env.GOOGLE_MAPS_API_KEY; - - return { - root: projectRepoRoot, // Vite's project root is js-api-samples/ - build: { - emptyOutDir: false, // Crucial: Do not empty the main dist dir for each sample. - outDir: effectiveOutDir || resolve(projectRepoRoot, 'dist'), // Default for serve/preview - rollupOptions: - command === 'build' && - Object.keys(effectiveBuildInput).length > 0 - ? { input: effectiveBuildInput } - : undefined, - }, - preview: { - port: 8080, - }, - - define: { - 'import.meta.env.GOOGLE_MAPS_API_KEY': JSON.stringify(apiKey), - }, - }; -}); From ca0bcab0278830428b121a337c3344c3fefd3a62 Mon Sep 17 00:00:00 2001 From: William French Date: Tue, 23 Jun 2026 13:26:13 -0700 Subject: [PATCH 6/8] feat: migrate all samples to dynamically injected API keys --- samples/3d-accessibility-features/index.html | 2 +- samples/3d-camera-boundary/index.html | 2 +- samples/3d-camera-center/index.html | 2 +- samples/3d-camera-position/index.html | 2 +- samples/3d-camera-position/package.json | 5 ++--- samples/3d-camera-to-around/index.html | 2 +- samples/3d-clamp-mode/index.html | 2 +- samples/3d-coverage-map/index.html | 2 +- samples/3d-hero-showcase/index.html | 2 +- samples/3d-label-toggle/index.html | 2 +- samples/3d-localization/index.html | 2 +- samples/3d-map-45-degree-locked/index.html | 2 +- samples/3d-map-45-degree/index.html | 2 +- samples/3d-map-events/index.html | 2 +- samples/3d-map-roadmap/index.html | 2 +- samples/3d-map-styling/index.html | 2 +- samples/3d-marker-click-event/index.html | 2 +- samples/3d-marker-collision-behavior/index.html | 2 +- samples/3d-marker-customization/index.html | 2 +- samples/3d-marker-graphics/index.html | 2 +- samples/3d-marker-html/index.html | 2 +- samples/3d-marker-interactive/index.html | 2 +- samples/3d-mesh-flatten/index.html | 2 +- samples/3d-model-interactive/index.html | 2 +- samples/3d-model/index.html | 2 +- samples/3d-places-autocomplete/index.html | 2 +- samples/3d-places/index.html | 2 +- samples/3d-polygon-click-event/index.html | 2 +- samples/3d-polygon-extruded-hole/index.html | 2 +- samples/3d-polygon/index.html | 2 +- samples/3d-polyline-click-event/index.html | 2 +- samples/3d-polyline-extruded/index.html | 2 +- samples/3d-polyline/index.html | 2 +- samples/3d-popover-location/index.html | 2 +- samples/3d-popover-marker/index.html | 2 +- samples/3d-simple-map-declarative/index.html | 2 +- samples/3d-simple-map/index.html | 2 +- samples/3d-simple-marker/index.html | 2 +- samples/add-map/index.html | 2 +- samples/address-validation/index.html | 2 +- samples/advanced-markers-accessibility/index.html | 2 +- samples/advanced-markers-altitude/index.html | 2 +- samples/advanced-markers-animation/index.html | 2 +- samples/advanced-markers-basic-style/index.html | 2 +- samples/advanced-markers-collision/index.html | 2 +- samples/advanced-markers-draggable/index.html | 2 +- samples/advanced-markers-graphics/index.html | 2 +- samples/advanced-markers-html-simple/index.html | 2 +- samples/advanced-markers-html/index.html | 2 +- samples/advanced-markers-simple/index.html | 2 +- samples/advanced-markers-zoom/index.html | 2 +- samples/ai-powered-summaries-basic/index.html | 2 +- samples/ai-powered-summaries/index.html | 2 +- samples/boundaries-choropleth/index.html | 2 +- samples/boundaries-click/index.html | 2 +- samples/boundaries-simple/index.html | 2 +- samples/boundaries-text-search/index.html | 2 +- samples/circle-simple/index.html | 2 +- samples/control-bounds-restriction/index.html | 2 +- samples/control-custom-state/index.html | 2 +- samples/control-disableUI/index.html | 2 +- samples/control-options/index.html | 2 +- samples/control-positioning-labels/index.html | 2 +- samples/control-positioning/index.html | 2 +- samples/control-replacement/index.html | 2 +- samples/control-simple/index.html | 2 +- samples/dds-datasets-point/index.html | 2 +- samples/dds-datasets-polygon-click/index.html | 2 +- samples/dds-datasets-polygon-colors/index.html | 2 +- samples/dds-datasets-polygon/index.html | 2 +- samples/dds-datasets-polyline/index.html | 2 +- samples/dds-region-viewer/index.html | 2 +- samples/deckgl-arclayer/index.html | 2 +- samples/deckgl-heatmap/index.html | 2 +- samples/deckgl-kml-updated/index.html | 2 +- samples/deckgl-kml/index.html | 2 +- samples/deckgl-points/index.html | 2 +- samples/deckgl-polygon/index.html | 2 +- samples/deckgl-tripslayer/index.html | 2 +- samples/event-arguments/index.html | 2 +- samples/event-click-latlng/index.html | 2 +- samples/event-closure/index.html | 2 +- samples/event-poi/index.html | 2 +- samples/event-properties/index.html | 2 +- samples/event-simple/index.html | 2 +- samples/geocoding-component-restriction/index.html | 2 +- samples/geocoding-place-id/index.html | 2 +- samples/geocoding-region-es/index.html | 2 +- samples/geocoding-region-us/index.html | 2 +- samples/geocoding-reverse/index.html | 2 +- samples/geocoding-simple/index.html | 2 +- samples/hiding-features/index.html | 2 +- samples/infowindow-simple/index.html | 2 +- samples/js-api-loader-map/index.ts | 2 +- samples/layer-data-event/index.html | 2 +- samples/layer-data-quakes-red/index.html | 2 +- samples/layer-data-quakes-simple/index.html | 2 +- samples/layer-data-simple/index.html | 2 +- samples/layer-data-style/index.html | 2 +- samples/map-events/index.html | 2 +- samples/map-projection-simple/index.html | 2 +- samples/map-simple-js/index.html | 2 +- samples/map-simple/index.html | 2 +- samples/place-autocomplete-basic-map/index.html | 2 +- samples/place-autocomplete-data-session/index.html | 2 +- samples/place-autocomplete-data-simple/index.html | 2 +- samples/place-autocomplete-element/index.html | 2 +- samples/place-autocomplete-map/index.html | 2 +- samples/place-class/index.html | 2 +- samples/place-nearby-search/index.html | 2 +- samples/place-photos/index.html | 2 +- samples/place-reviews/index.html | 2 +- samples/place-text-search/index.html | 2 +- samples/places-autocomplete-addressform/index.html | 2 +- samples/places-placeid-finder/index.html | 2 +- samples/polyline-complex/index.html | 2 +- samples/polyline-remove/index.html | 2 +- samples/polyline-simple/index.html | 2 +- samples/react-ui-kit-place-details-compact/src/app.tsx | 2 +- .../react-ui-kit-place-details-latlng-compact/src/app.tsx | 2 +- samples/react-ui-kit-place-details-latlng/src/app.tsx | 2 +- samples/react-ui-kit-place-details/src/app.tsx | 2 +- samples/react-ui-kit-search-nearby/src/app.tsx | 2 +- samples/react-ui-kit-search-text/src/app.tsx | 2 +- samples/rectangle-event/index.html | 2 +- samples/routes-compute-routes/index.html | 2 +- samples/routes-get-alternatives/index.html | 2 +- samples/routes-get-directions-panel/index.html | 2 +- samples/routes-get-directions/index.html | 2 +- samples/routes-markers/index.html | 2 +- samples/routes-route-matrix/index.html | 2 +- samples/streetview-overlays/index.html | 2 +- samples/test-example/index.html | 2 +- samples/ui-kit-place-details-compact/index.html | 2 +- samples/ui-kit-place-details/index.html | 2 +- samples/ui-kit-place-search-nearby/index.html | 2 +- samples/ui-kit-place-search-text/index.html | 2 +- samples/weather-api-current-compact/index.html | 2 +- samples/weather-api-current-compact/index.ts | 2 +- samples/web-components-events/index.html | 2 +- samples/web-components-map/index.html | 2 +- samples/web-components-markers/index.html | 2 +- 142 files changed, 143 insertions(+), 144 deletions(-) diff --git a/samples/3d-accessibility-features/index.html b/samples/3d-accessibility-features/index.html index 920f5be5a..4a357d88e 100644 --- a/samples/3d-accessibility-features/index.html +++ b/samples/3d-accessibility-features/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-camera-boundary/index.html b/samples/3d-camera-boundary/index.html index f84395145..b2c63bac8 100644 --- a/samples/3d-camera-boundary/index.html +++ b/samples/3d-camera-boundary/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-camera-center/index.html b/samples/3d-camera-center/index.html index d5185bf35..b13f7c289 100644 --- a/samples/3d-camera-center/index.html +++ b/samples/3d-camera-center/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-camera-position/index.html b/samples/3d-camera-position/index.html index a88c3fbf6..0efeafcce 100644 --- a/samples/3d-camera-position/index.html +++ b/samples/3d-camera-position/index.html @@ -13,7 +13,7 @@ diff --git a/samples/3d-camera-position/package.json b/samples/3d-camera-position/package.json index 94e7c0c98..3d8a26d1f 100644 --- a/samples/3d-camera-position/package.json +++ b/samples/3d-camera-position/package.json @@ -2,11 +2,10 @@ "name": "@js-api-samples/3d-camera-position", "version": "1.0.0", "scripts": { - "build": "tsc && bash ../jsfiddle.sh 3d-camera-position && bash ../app.sh 3d-camera-position && bash ../docs.sh 3d-camera-position && npm run build:vite --workspace=. && bash ../dist.sh 3d-camera-position", + "build": "bash ../build-single.sh", "test": "tsc && npm run build:vite --workspace=.", "start": "tsc && vite build --base './' && vite", "build:vite": "vite build --base './'", "preview": "vite preview" - }, - "dependencies": {} + } } diff --git a/samples/3d-camera-to-around/index.html b/samples/3d-camera-to-around/index.html index 82ca9d5e9..498f4b6cf 100644 --- a/samples/3d-camera-to-around/index.html +++ b/samples/3d-camera-to-around/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-clamp-mode/index.html b/samples/3d-clamp-mode/index.html index abf9d5efc..14dec6f9c 100644 --- a/samples/3d-clamp-mode/index.html +++ b/samples/3d-clamp-mode/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-coverage-map/index.html b/samples/3d-coverage-map/index.html index 6c05d75bd..1b1e509c4 100644 --- a/samples/3d-coverage-map/index.html +++ b/samples/3d-coverage-map/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-hero-showcase/index.html b/samples/3d-hero-showcase/index.html index 50cb6a31b..6bd4b0e46 100644 --- a/samples/3d-hero-showcase/index.html +++ b/samples/3d-hero-showcase/index.html @@ -23,7 +23,7 @@ diff --git a/samples/3d-label-toggle/index.html b/samples/3d-label-toggle/index.html index 50e618165..fd267adeb 100644 --- a/samples/3d-label-toggle/index.html +++ b/samples/3d-label-toggle/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-localization/index.html b/samples/3d-localization/index.html index 934afff74..10338fa23 100644 --- a/samples/3d-localization/index.html +++ b/samples/3d-localization/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-map-45-degree-locked/index.html b/samples/3d-map-45-degree-locked/index.html index 95e0fdc4e..05dde4845 100644 --- a/samples/3d-map-45-degree-locked/index.html +++ b/samples/3d-map-45-degree-locked/index.html @@ -12,7 +12,7 @@ + src="https://maps.googleapis.com/maps/api/js?loading=async&key=GOOGLE_MAPS_API_KEY&libraries=maps3d"> // prettier-ignore (g=>{var h,a,k,p="The Google Maps JavaScript API",c="google",l="importLibrary",q="__ib__",m=document,b=window;b=b[c]||(b[c]={});var d=b.maps||(b.maps={}),r=new Set,e=new URLSearchParams,u=()=>h||(h=new Promise(async(f,n)=>{await (a=m.createElement("script"));e.set("libraries",[...r]+"");for(k in g)e.set(k.replace(/[A-Z]/g,t=>"_"+t[0].toLowerCase()),g[k]);e.set("callback",c+".maps."+q);a.src=`https://maps.${c}apis.com/maps/api/js?`+e;d[q]=f;a.onerror=()=>h=n(Error(p+" could not load."));a.nonce=m.querySelector("script[nonce]")?.nonce||"";m.head.append(a)}));d[l]?console.warn(p+" only loads once. Ignoring:",g):d[l]=(f,...n)=>r.add(f)&&u().then(()=>d[l](f,...n))})({ - key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" + key: "GOOGLE_MAPS_API_KEY" }); diff --git a/samples/3d-map-events/index.html b/samples/3d-map-events/index.html index 546f6a604..e876aee0b 100644 --- a/samples/3d-map-events/index.html +++ b/samples/3d-map-events/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-map-roadmap/index.html b/samples/3d-map-roadmap/index.html index 518bcec02..93eb437fe 100644 --- a/samples/3d-map-roadmap/index.html +++ b/samples/3d-map-roadmap/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-map-styling/index.html b/samples/3d-map-styling/index.html index c624d2af1..b25e17add 100644 --- a/samples/3d-map-styling/index.html +++ b/samples/3d-map-styling/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-marker-click-event/index.html b/samples/3d-marker-click-event/index.html index eccdc4ca0..3d1892105 100644 --- a/samples/3d-marker-click-event/index.html +++ b/samples/3d-marker-click-event/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-marker-collision-behavior/index.html b/samples/3d-marker-collision-behavior/index.html index 1eac263d4..46f1e0633 100644 --- a/samples/3d-marker-collision-behavior/index.html +++ b/samples/3d-marker-collision-behavior/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-marker-customization/index.html b/samples/3d-marker-customization/index.html index 5a3bbf27e..c466ccf4c 100644 --- a/samples/3d-marker-customization/index.html +++ b/samples/3d-marker-customization/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-marker-graphics/index.html b/samples/3d-marker-graphics/index.html index 9e74e9377..6f03685de 100644 --- a/samples/3d-marker-graphics/index.html +++ b/samples/3d-marker-graphics/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-marker-html/index.html b/samples/3d-marker-html/index.html index d62dc5760..af5eca845 100644 --- a/samples/3d-marker-html/index.html +++ b/samples/3d-marker-html/index.html @@ -11,7 +11,7 @@ + src="https://maps.googleapis.com/maps/api/js?loading=async&key=GOOGLE_MAPS_API_KEY&libraries=maps3d"> // prettier-ignore (g=>{var h,a,k,p="The Google Maps JavaScript API",c="google",l="importLibrary",q="__ib__",m=document,b=window;b=b[c]||(b[c]={});var d=b.maps||(b.maps={}),r=new Set,e=new URLSearchParams,u=()=>h||(h=new Promise(async(f,n)=>{await (a=m.createElement("script"));e.set("libraries",[...r]+"");for(k in g)e.set(k.replace(/[A-Z]/g,t=>"_"+t[0].toLowerCase()),g[k]);e.set("callback",c+".maps."+q);a.src=`https://maps.${c}apis.com/maps/api/js?`+e;d[q]=f;a.onerror=()=>h=n(Error(p+" could not load."));a.nonce=m.querySelector("script[nonce]")?.nonce||"";m.head.append(a)}));d[l]?console.warn(p+" only loads once. Ignoring:",g):d[l]=(f,...n)=>r.add(f)&&u().then(()=>d[l](f,...n))})({ - key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" + key: "GOOGLE_MAPS_API_KEY" }); diff --git a/samples/3d-mesh-flatten/index.html b/samples/3d-mesh-flatten/index.html index 340abb122..ec3bdf8f1 100644 --- a/samples/3d-mesh-flatten/index.html +++ b/samples/3d-mesh-flatten/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-model-interactive/index.html b/samples/3d-model-interactive/index.html index 70d9ca97e..6e117d52c 100644 --- a/samples/3d-model-interactive/index.html +++ b/samples/3d-model-interactive/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-model/index.html b/samples/3d-model/index.html index 251fc359a..4e8733f24 100644 --- a/samples/3d-model/index.html +++ b/samples/3d-model/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-places-autocomplete/index.html b/samples/3d-places-autocomplete/index.html index b17e1fb08..31340f94c 100644 --- a/samples/3d-places-autocomplete/index.html +++ b/samples/3d-places-autocomplete/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-places/index.html b/samples/3d-places/index.html index 1f45b428e..30be37953 100644 --- a/samples/3d-places/index.html +++ b/samples/3d-places/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-polygon-click-event/index.html b/samples/3d-polygon-click-event/index.html index 78311109d..385ce3e1b 100644 --- a/samples/3d-polygon-click-event/index.html +++ b/samples/3d-polygon-click-event/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-polygon-extruded-hole/index.html b/samples/3d-polygon-extruded-hole/index.html index 813b87add..f06491b0e 100644 --- a/samples/3d-polygon-extruded-hole/index.html +++ b/samples/3d-polygon-extruded-hole/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-polygon/index.html b/samples/3d-polygon/index.html index b1a96cffe..7093f6e17 100644 --- a/samples/3d-polygon/index.html +++ b/samples/3d-polygon/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-polyline-click-event/index.html b/samples/3d-polyline-click-event/index.html index 38aa48b32..e125de38f 100644 --- a/samples/3d-polyline-click-event/index.html +++ b/samples/3d-polyline-click-event/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-polyline-extruded/index.html b/samples/3d-polyline-extruded/index.html index cb45394d1..85e55c69d 100644 --- a/samples/3d-polyline-extruded/index.html +++ b/samples/3d-polyline-extruded/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-polyline/index.html b/samples/3d-polyline/index.html index 543d55f95..3acf96de4 100644 --- a/samples/3d-polyline/index.html +++ b/samples/3d-polyline/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-popover-location/index.html b/samples/3d-popover-location/index.html index e7e8c1552..deddda3e3 100644 --- a/samples/3d-popover-location/index.html +++ b/samples/3d-popover-location/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-popover-marker/index.html b/samples/3d-popover-marker/index.html index b8b4a7196..31c462963 100644 --- a/samples/3d-popover-marker/index.html +++ b/samples/3d-popover-marker/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-simple-map-declarative/index.html b/samples/3d-simple-map-declarative/index.html index 945ac2d0f..2e5ead07c 100644 --- a/samples/3d-simple-map-declarative/index.html +++ b/samples/3d-simple-map-declarative/index.html @@ -11,7 +11,7 @@ + src="https://maps.googleapis.com/maps/api/js?loading=async&key=GOOGLE_MAPS_API_KEY&libraries=maps3d"> diff --git a/samples/3d-simple-map/index.html b/samples/3d-simple-map/index.html index 10a78c795..d1bed2c68 100644 --- a/samples/3d-simple-map/index.html +++ b/samples/3d-simple-map/index.html @@ -14,7 +14,7 @@ diff --git a/samples/3d-simple-marker/index.html b/samples/3d-simple-marker/index.html index 58b10d073..aaa45acb4 100644 --- a/samples/3d-simple-marker/index.html +++ b/samples/3d-simple-marker/index.html @@ -14,7 +14,7 @@ diff --git a/samples/add-map/index.html b/samples/add-map/index.html index e404f3437..308a37f43 100644 --- a/samples/add-map/index.html +++ b/samples/add-map/index.html @@ -14,7 +14,7 @@ diff --git a/samples/address-validation/index.html b/samples/address-validation/index.html index 6b84f270e..63b2d50ab 100644 --- a/samples/address-validation/index.html +++ b/samples/address-validation/index.html @@ -14,7 +14,7 @@ diff --git a/samples/advanced-markers-accessibility/index.html b/samples/advanced-markers-accessibility/index.html index 2bc919478..7d47a556d 100644 --- a/samples/advanced-markers-accessibility/index.html +++ b/samples/advanced-markers-accessibility/index.html @@ -15,7 +15,7 @@ diff --git a/samples/advanced-markers-altitude/index.html b/samples/advanced-markers-altitude/index.html index 98f15f194..873af5e4c 100644 --- a/samples/advanced-markers-altitude/index.html +++ b/samples/advanced-markers-altitude/index.html @@ -14,7 +14,7 @@ diff --git a/samples/advanced-markers-animation/index.html b/samples/advanced-markers-animation/index.html index 38150f9f9..587d0ce15 100644 --- a/samples/advanced-markers-animation/index.html +++ b/samples/advanced-markers-animation/index.html @@ -14,7 +14,7 @@ diff --git a/samples/advanced-markers-basic-style/index.html b/samples/advanced-markers-basic-style/index.html index 77c3be1d1..5f5eab914 100644 --- a/samples/advanced-markers-basic-style/index.html +++ b/samples/advanced-markers-basic-style/index.html @@ -14,7 +14,7 @@ diff --git a/samples/advanced-markers-collision/index.html b/samples/advanced-markers-collision/index.html index ae1b15884..4fb9db312 100644 --- a/samples/advanced-markers-collision/index.html +++ b/samples/advanced-markers-collision/index.html @@ -22,7 +22,7 @@ diff --git a/samples/advanced-markers-draggable/index.html b/samples/advanced-markers-draggable/index.html index 078611f64..95568889b 100644 --- a/samples/advanced-markers-draggable/index.html +++ b/samples/advanced-markers-draggable/index.html @@ -14,7 +14,7 @@ diff --git a/samples/advanced-markers-graphics/index.html b/samples/advanced-markers-graphics/index.html index c8b0a16c3..dc34b5f8d 100644 --- a/samples/advanced-markers-graphics/index.html +++ b/samples/advanced-markers-graphics/index.html @@ -13,7 +13,7 @@ diff --git a/samples/advanced-markers-html-simple/index.html b/samples/advanced-markers-html-simple/index.html index 1b104c75e..3e7311146 100644 --- a/samples/advanced-markers-html-simple/index.html +++ b/samples/advanced-markers-html-simple/index.html @@ -14,7 +14,7 @@ diff --git a/samples/advanced-markers-html/index.html b/samples/advanced-markers-html/index.html index c45f8e37e..845e9b37f 100644 --- a/samples/advanced-markers-html/index.html +++ b/samples/advanced-markers-html/index.html @@ -16,7 +16,7 @@ diff --git a/samples/advanced-markers-simple/index.html b/samples/advanced-markers-simple/index.html index 2eb922c9e..fa0ea879e 100644 --- a/samples/advanced-markers-simple/index.html +++ b/samples/advanced-markers-simple/index.html @@ -14,7 +14,7 @@ diff --git a/samples/advanced-markers-zoom/index.html b/samples/advanced-markers-zoom/index.html index cfd4b2c85..a5a47156a 100644 --- a/samples/advanced-markers-zoom/index.html +++ b/samples/advanced-markers-zoom/index.html @@ -14,7 +14,7 @@ diff --git a/samples/ai-powered-summaries-basic/index.html b/samples/ai-powered-summaries-basic/index.html index 0cb1bbbb8..d6ce2b93f 100644 --- a/samples/ai-powered-summaries-basic/index.html +++ b/samples/ai-powered-summaries-basic/index.html @@ -14,7 +14,7 @@ diff --git a/samples/ai-powered-summaries/index.html b/samples/ai-powered-summaries/index.html index ce27d6bb8..e0a751294 100644 --- a/samples/ai-powered-summaries/index.html +++ b/samples/ai-powered-summaries/index.html @@ -13,7 +13,7 @@ diff --git a/samples/boundaries-choropleth/index.html b/samples/boundaries-choropleth/index.html index 428b81d77..d1bf4fe80 100644 --- a/samples/boundaries-choropleth/index.html +++ b/samples/boundaries-choropleth/index.html @@ -14,7 +14,7 @@ diff --git a/samples/boundaries-click/index.html b/samples/boundaries-click/index.html index d2af3aaf6..cbd05fb44 100644 --- a/samples/boundaries-click/index.html +++ b/samples/boundaries-click/index.html @@ -14,7 +14,7 @@ diff --git a/samples/boundaries-simple/index.html b/samples/boundaries-simple/index.html index 301e7d4a6..cc9d7928e 100644 --- a/samples/boundaries-simple/index.html +++ b/samples/boundaries-simple/index.html @@ -14,7 +14,7 @@ diff --git a/samples/boundaries-text-search/index.html b/samples/boundaries-text-search/index.html index 91dfd85a2..c8dda6d33 100644 --- a/samples/boundaries-text-search/index.html +++ b/samples/boundaries-text-search/index.html @@ -14,7 +14,7 @@ diff --git a/samples/circle-simple/index.html b/samples/circle-simple/index.html index 54628e2f8..69e88e239 100644 --- a/samples/circle-simple/index.html +++ b/samples/circle-simple/index.html @@ -14,7 +14,7 @@ diff --git a/samples/control-bounds-restriction/index.html b/samples/control-bounds-restriction/index.html index a1b985053..da2249cea 100644 --- a/samples/control-bounds-restriction/index.html +++ b/samples/control-bounds-restriction/index.html @@ -14,7 +14,7 @@ diff --git a/samples/control-custom-state/index.html b/samples/control-custom-state/index.html index 33b55e1c8..fb4383a90 100644 --- a/samples/control-custom-state/index.html +++ b/samples/control-custom-state/index.html @@ -14,7 +14,7 @@ diff --git a/samples/control-disableUI/index.html b/samples/control-disableUI/index.html index 9a51f3dd9..781b2b5cc 100644 --- a/samples/control-disableUI/index.html +++ b/samples/control-disableUI/index.html @@ -14,7 +14,7 @@ diff --git a/samples/control-options/index.html b/samples/control-options/index.html index 0a6a1fce6..02bad2d85 100644 --- a/samples/control-options/index.html +++ b/samples/control-options/index.html @@ -14,7 +14,7 @@ diff --git a/samples/control-positioning-labels/index.html b/samples/control-positioning-labels/index.html index df02076c8..a317f08f4 100644 --- a/samples/control-positioning-labels/index.html +++ b/samples/control-positioning-labels/index.html @@ -14,7 +14,7 @@ diff --git a/samples/control-positioning/index.html b/samples/control-positioning/index.html index 0c958e15f..87d4be78c 100644 --- a/samples/control-positioning/index.html +++ b/samples/control-positioning/index.html @@ -14,7 +14,7 @@ diff --git a/samples/control-replacement/index.html b/samples/control-replacement/index.html index 27f05851d..41ba886c1 100644 --- a/samples/control-replacement/index.html +++ b/samples/control-replacement/index.html @@ -17,7 +17,7 @@ diff --git a/samples/control-simple/index.html b/samples/control-simple/index.html index a53421d67..14d9360b9 100644 --- a/samples/control-simple/index.html +++ b/samples/control-simple/index.html @@ -14,7 +14,7 @@ diff --git a/samples/dds-datasets-point/index.html b/samples/dds-datasets-point/index.html index 86307be6f..68847ce11 100644 --- a/samples/dds-datasets-point/index.html +++ b/samples/dds-datasets-point/index.html @@ -14,7 +14,7 @@ diff --git a/samples/dds-datasets-polygon-click/index.html b/samples/dds-datasets-polygon-click/index.html index cd2a90c59..f477c585f 100644 --- a/samples/dds-datasets-polygon-click/index.html +++ b/samples/dds-datasets-polygon-click/index.html @@ -14,7 +14,7 @@ diff --git a/samples/dds-datasets-polygon-colors/index.html b/samples/dds-datasets-polygon-colors/index.html index 7265da86b..d78928f9b 100644 --- a/samples/dds-datasets-polygon-colors/index.html +++ b/samples/dds-datasets-polygon-colors/index.html @@ -14,7 +14,7 @@ diff --git a/samples/dds-datasets-polygon/index.html b/samples/dds-datasets-polygon/index.html index df972c7ae..67adb1992 100644 --- a/samples/dds-datasets-polygon/index.html +++ b/samples/dds-datasets-polygon/index.html @@ -14,7 +14,7 @@ diff --git a/samples/dds-datasets-polyline/index.html b/samples/dds-datasets-polyline/index.html index d3c8ec296..645714c6b 100644 --- a/samples/dds-datasets-polyline/index.html +++ b/samples/dds-datasets-polyline/index.html @@ -14,7 +14,7 @@ diff --git a/samples/dds-region-viewer/index.html b/samples/dds-region-viewer/index.html index 36da5a972..7fa46f52f 100644 --- a/samples/dds-region-viewer/index.html +++ b/samples/dds-region-viewer/index.html @@ -14,7 +14,7 @@ diff --git a/samples/deckgl-arclayer/index.html b/samples/deckgl-arclayer/index.html index 165e8d4c9..192da8ab9 100644 --- a/samples/deckgl-arclayer/index.html +++ b/samples/deckgl-arclayer/index.html @@ -14,7 +14,7 @@ diff --git a/samples/deckgl-heatmap/index.html b/samples/deckgl-heatmap/index.html index 850bcf101..557b8e750 100644 --- a/samples/deckgl-heatmap/index.html +++ b/samples/deckgl-heatmap/index.html @@ -24,7 +24,7 @@ diff --git a/samples/deckgl-kml-updated/index.html b/samples/deckgl-kml-updated/index.html index 937a70627..7b3838567 100644 --- a/samples/deckgl-kml-updated/index.html +++ b/samples/deckgl-kml-updated/index.html @@ -24,7 +24,7 @@ diff --git a/samples/deckgl-kml/index.html b/samples/deckgl-kml/index.html index ea0654551..895e80c2f 100644 --- a/samples/deckgl-kml/index.html +++ b/samples/deckgl-kml/index.html @@ -24,7 +24,7 @@ diff --git a/samples/deckgl-points/index.html b/samples/deckgl-points/index.html index 16cd3d19e..d80d76fbc 100644 --- a/samples/deckgl-points/index.html +++ b/samples/deckgl-points/index.html @@ -13,7 +13,7 @@ diff --git a/samples/deckgl-polygon/index.html b/samples/deckgl-polygon/index.html index 21f1021e1..50981390f 100644 --- a/samples/deckgl-polygon/index.html +++ b/samples/deckgl-polygon/index.html @@ -23,7 +23,7 @@ diff --git a/samples/deckgl-tripslayer/index.html b/samples/deckgl-tripslayer/index.html index 761af5bb8..701e97f28 100644 --- a/samples/deckgl-tripslayer/index.html +++ b/samples/deckgl-tripslayer/index.html @@ -14,7 +14,7 @@ diff --git a/samples/event-arguments/index.html b/samples/event-arguments/index.html index ce1640f1c..cac8c870d 100644 --- a/samples/event-arguments/index.html +++ b/samples/event-arguments/index.html @@ -14,7 +14,7 @@ diff --git a/samples/event-click-latlng/index.html b/samples/event-click-latlng/index.html index 419d3510a..8dce6f216 100644 --- a/samples/event-click-latlng/index.html +++ b/samples/event-click-latlng/index.html @@ -14,7 +14,7 @@ diff --git a/samples/event-closure/index.html b/samples/event-closure/index.html index 542b62119..6fe9390d2 100644 --- a/samples/event-closure/index.html +++ b/samples/event-closure/index.html @@ -14,7 +14,7 @@ diff --git a/samples/event-poi/index.html b/samples/event-poi/index.html index f2e13944a..dd8c5a9b4 100644 --- a/samples/event-poi/index.html +++ b/samples/event-poi/index.html @@ -14,7 +14,7 @@ diff --git a/samples/event-properties/index.html b/samples/event-properties/index.html index 213df2c1d..71e7b114c 100644 --- a/samples/event-properties/index.html +++ b/samples/event-properties/index.html @@ -14,7 +14,7 @@ diff --git a/samples/event-simple/index.html b/samples/event-simple/index.html index 6f8e97cf9..824c4a012 100644 --- a/samples/event-simple/index.html +++ b/samples/event-simple/index.html @@ -14,7 +14,7 @@ diff --git a/samples/geocoding-component-restriction/index.html b/samples/geocoding-component-restriction/index.html index f2bfb4021..d79b86edc 100644 --- a/samples/geocoding-component-restriction/index.html +++ b/samples/geocoding-component-restriction/index.html @@ -14,7 +14,7 @@ diff --git a/samples/geocoding-place-id/index.html b/samples/geocoding-place-id/index.html index 7b66266e7..b93809003 100644 --- a/samples/geocoding-place-id/index.html +++ b/samples/geocoding-place-id/index.html @@ -14,7 +14,7 @@ diff --git a/samples/geocoding-region-es/index.html b/samples/geocoding-region-es/index.html index e096473ba..40ad10108 100644 --- a/samples/geocoding-region-es/index.html +++ b/samples/geocoding-region-es/index.html @@ -14,7 +14,7 @@ diff --git a/samples/geocoding-region-us/index.html b/samples/geocoding-region-us/index.html index 816bfdd90..f50c2ebd2 100644 --- a/samples/geocoding-region-us/index.html +++ b/samples/geocoding-region-us/index.html @@ -14,7 +14,7 @@ diff --git a/samples/geocoding-reverse/index.html b/samples/geocoding-reverse/index.html index 043b7afa3..8f9e01002 100644 --- a/samples/geocoding-reverse/index.html +++ b/samples/geocoding-reverse/index.html @@ -14,7 +14,7 @@ diff --git a/samples/geocoding-simple/index.html b/samples/geocoding-simple/index.html index bf88c526a..ff87bf10f 100644 --- a/samples/geocoding-simple/index.html +++ b/samples/geocoding-simple/index.html @@ -14,7 +14,7 @@ diff --git a/samples/hiding-features/index.html b/samples/hiding-features/index.html index 630abb2e3..d0ea753c5 100644 --- a/samples/hiding-features/index.html +++ b/samples/hiding-features/index.html @@ -14,7 +14,7 @@ diff --git a/samples/infowindow-simple/index.html b/samples/infowindow-simple/index.html index 8beaa0766..0765c3961 100644 --- a/samples/infowindow-simple/index.html +++ b/samples/infowindow-simple/index.html @@ -14,7 +14,7 @@ diff --git a/samples/js-api-loader-map/index.ts b/samples/js-api-loader-map/index.ts index 7d303b86a..47319ced0 100644 --- a/samples/js-api-loader-map/index.ts +++ b/samples/js-api-loader-map/index.ts @@ -10,7 +10,7 @@ import { setOptions, importLibrary } from '@googlemaps/js-api-loader'; // [END maps_js_api_loader_map_load] -const API_KEY = 'AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8'; +const API_KEY = 'GOOGLE_MAPS_API_KEY'; async function init(): Promise { // [START maps_js_api_loader_map_options] diff --git a/samples/layer-data-event/index.html b/samples/layer-data-event/index.html index 924cdf99c..a3ac17ab4 100644 --- a/samples/layer-data-event/index.html +++ b/samples/layer-data-event/index.html @@ -14,7 +14,7 @@ diff --git a/samples/layer-data-quakes-red/index.html b/samples/layer-data-quakes-red/index.html index 7f2240b5a..05d532fb3 100644 --- a/samples/layer-data-quakes-red/index.html +++ b/samples/layer-data-quakes-red/index.html @@ -15,7 +15,7 @@ diff --git a/samples/layer-data-quakes-simple/index.html b/samples/layer-data-quakes-simple/index.html index 26d01c86f..d5254cae1 100644 --- a/samples/layer-data-quakes-simple/index.html +++ b/samples/layer-data-quakes-simple/index.html @@ -15,7 +15,7 @@ diff --git a/samples/layer-data-simple/index.html b/samples/layer-data-simple/index.html index 943849540..08c4e481f 100644 --- a/samples/layer-data-simple/index.html +++ b/samples/layer-data-simple/index.html @@ -14,7 +14,7 @@ diff --git a/samples/layer-data-style/index.html b/samples/layer-data-style/index.html index 943cf9b70..448e7c74e 100644 --- a/samples/layer-data-style/index.html +++ b/samples/layer-data-style/index.html @@ -14,7 +14,7 @@ diff --git a/samples/map-events/index.html b/samples/map-events/index.html index da8a129bc..290a8f971 100644 --- a/samples/map-events/index.html +++ b/samples/map-events/index.html @@ -14,7 +14,7 @@ diff --git a/samples/map-projection-simple/index.html b/samples/map-projection-simple/index.html index a2cc852c7..1f126dff1 100644 --- a/samples/map-projection-simple/index.html +++ b/samples/map-projection-simple/index.html @@ -14,7 +14,7 @@ diff --git a/samples/map-simple-js/index.html b/samples/map-simple-js/index.html index 3206d77a4..d2861ebf2 100644 --- a/samples/map-simple-js/index.html +++ b/samples/map-simple-js/index.html @@ -21,7 +21,7 @@ diff --git a/samples/map-simple/index.html b/samples/map-simple/index.html index 171112a1c..b4253b9dc 100644 --- a/samples/map-simple/index.html +++ b/samples/map-simple/index.html @@ -14,7 +14,7 @@ diff --git a/samples/place-autocomplete-basic-map/index.html b/samples/place-autocomplete-basic-map/index.html index 9b022a9c6..8b6fa9b41 100644 --- a/samples/place-autocomplete-basic-map/index.html +++ b/samples/place-autocomplete-basic-map/index.html @@ -14,7 +14,7 @@ diff --git a/samples/place-autocomplete-data-session/index.html b/samples/place-autocomplete-data-session/index.html index 7925d662a..562fb43c8 100644 --- a/samples/place-autocomplete-data-session/index.html +++ b/samples/place-autocomplete-data-session/index.html @@ -14,7 +14,7 @@ diff --git a/samples/place-autocomplete-data-simple/index.html b/samples/place-autocomplete-data-simple/index.html index d0c5db8d4..6c4ca298d 100644 --- a/samples/place-autocomplete-data-simple/index.html +++ b/samples/place-autocomplete-data-simple/index.html @@ -14,7 +14,7 @@ diff --git a/samples/place-autocomplete-element/index.html b/samples/place-autocomplete-element/index.html index 5836b1746..6b4ad6932 100644 --- a/samples/place-autocomplete-element/index.html +++ b/samples/place-autocomplete-element/index.html @@ -14,7 +14,7 @@ diff --git a/samples/place-autocomplete-map/index.html b/samples/place-autocomplete-map/index.html index 714460150..158b56f5a 100644 --- a/samples/place-autocomplete-map/index.html +++ b/samples/place-autocomplete-map/index.html @@ -14,7 +14,7 @@ diff --git a/samples/place-class/index.html b/samples/place-class/index.html index d09423e3c..92fa5a9ab 100644 --- a/samples/place-class/index.html +++ b/samples/place-class/index.html @@ -14,7 +14,7 @@ diff --git a/samples/place-nearby-search/index.html b/samples/place-nearby-search/index.html index 9efe25799..e32659355 100644 --- a/samples/place-nearby-search/index.html +++ b/samples/place-nearby-search/index.html @@ -14,7 +14,7 @@ diff --git a/samples/place-photos/index.html b/samples/place-photos/index.html index 2fe6cef42..2861cb7b8 100644 --- a/samples/place-photos/index.html +++ b/samples/place-photos/index.html @@ -14,7 +14,7 @@ diff --git a/samples/place-reviews/index.html b/samples/place-reviews/index.html index 775a29f4e..5bedeb537 100644 --- a/samples/place-reviews/index.html +++ b/samples/place-reviews/index.html @@ -14,7 +14,7 @@ diff --git a/samples/place-text-search/index.html b/samples/place-text-search/index.html index 0b2530b4b..f134842e0 100644 --- a/samples/place-text-search/index.html +++ b/samples/place-text-search/index.html @@ -14,7 +14,7 @@ diff --git a/samples/places-autocomplete-addressform/index.html b/samples/places-autocomplete-addressform/index.html index 5f65bdf7d..f25ed746b 100644 --- a/samples/places-autocomplete-addressform/index.html +++ b/samples/places-autocomplete-addressform/index.html @@ -18,7 +18,7 @@ diff --git a/samples/places-placeid-finder/index.html b/samples/places-placeid-finder/index.html index 8cc50f211..4690a6de7 100644 --- a/samples/places-placeid-finder/index.html +++ b/samples/places-placeid-finder/index.html @@ -14,7 +14,7 @@ diff --git a/samples/polyline-complex/index.html b/samples/polyline-complex/index.html index c54fc579d..906272481 100644 --- a/samples/polyline-complex/index.html +++ b/samples/polyline-complex/index.html @@ -14,7 +14,7 @@ diff --git a/samples/polyline-remove/index.html b/samples/polyline-remove/index.html index dace93ece..2f0d2106c 100644 --- a/samples/polyline-remove/index.html +++ b/samples/polyline-remove/index.html @@ -14,7 +14,7 @@ diff --git a/samples/polyline-simple/index.html b/samples/polyline-simple/index.html index c79ed17ab..4674cbb56 100644 --- a/samples/polyline-simple/index.html +++ b/samples/polyline-simple/index.html @@ -14,7 +14,7 @@ diff --git a/samples/react-ui-kit-place-details-compact/src/app.tsx b/samples/react-ui-kit-place-details-compact/src/app.tsx index e9fcc91c1..526918c91 100644 --- a/samples/react-ui-kit-place-details-compact/src/app.tsx +++ b/samples/react-ui-kit-place-details-compact/src/app.tsx @@ -12,7 +12,7 @@ import { APIProvider, useMapsLibrary } from '@vis.gl/react-google-maps'; import './styles.css'; -const API_KEY = 'AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8'; +const API_KEY = 'GOOGLE_MAPS_API_KEY'; interface PlaceDetailsProps { placeId: string; diff --git a/samples/react-ui-kit-place-details-latlng-compact/src/app.tsx b/samples/react-ui-kit-place-details-latlng-compact/src/app.tsx index 833aed205..4be2b8c24 100644 --- a/samples/react-ui-kit-place-details-latlng-compact/src/app.tsx +++ b/samples/react-ui-kit-place-details-latlng-compact/src/app.tsx @@ -12,7 +12,7 @@ import { APIProvider, useMapsLibrary } from '@vis.gl/react-google-maps'; import './styles.css'; -const API_KEY = 'AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8'; +const API_KEY = 'GOOGLE_MAPS_API_KEY'; interface PlaceDetailsProps { lat: number; diff --git a/samples/react-ui-kit-place-details-latlng/src/app.tsx b/samples/react-ui-kit-place-details-latlng/src/app.tsx index f3e0ae2ed..fc9df0349 100644 --- a/samples/react-ui-kit-place-details-latlng/src/app.tsx +++ b/samples/react-ui-kit-place-details-latlng/src/app.tsx @@ -12,7 +12,7 @@ import { APIProvider, useMapsLibrary } from '@vis.gl/react-google-maps'; import './styles.css'; -const API_KEY = 'AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8'; +const API_KEY = 'GOOGLE_MAPS_API_KEY'; interface PlaceDetailsProps { lat: number; diff --git a/samples/react-ui-kit-place-details/src/app.tsx b/samples/react-ui-kit-place-details/src/app.tsx index db19de52c..8213269b4 100644 --- a/samples/react-ui-kit-place-details/src/app.tsx +++ b/samples/react-ui-kit-place-details/src/app.tsx @@ -12,7 +12,7 @@ import { APIProvider, useMapsLibrary } from '@vis.gl/react-google-maps'; import './styles.css'; -const API_KEY = 'AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8'; +const API_KEY = 'GOOGLE_MAPS_API_KEY'; interface PlaceDetailsProps { placeId: string; diff --git a/samples/react-ui-kit-search-nearby/src/app.tsx b/samples/react-ui-kit-search-nearby/src/app.tsx index 1fadcbc91..fc5e30762 100644 --- a/samples/react-ui-kit-search-nearby/src/app.tsx +++ b/samples/react-ui-kit-search-nearby/src/app.tsx @@ -25,7 +25,7 @@ import { import './styles.css'; -const API_KEY = 'AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8'; +const API_KEY = 'GOOGLE_MAPS_API_KEY'; const App = () => ( // prettier-ignore (g=>{var h,a,k,p="The Google Maps JavaScript API",c="google",l="importLibrary",q="__ib__",m=document,b=window;b=b[c]||(b[c]={});var d=b.maps||(b.maps={}),r=new Set,e=new URLSearchParams,u=()=>h||(h=new Promise(async(f,n)=>{await (a=m.createElement("script"));e.set("libraries",[...r]+"");for(k in g)e.set(k.replace(/[A-Z]/g,t=>"_"+t[0].toLowerCase()),g[k]);e.set("callback",c+".maps."+q);a.src=`https://maps.${c}apis.com/maps/api/js?`+e;d[q]=f;a.onerror=()=>h=n(Error(p+" could not load."));a.nonce=m.querySelector("script[nonce]")?.nonce||"";m.head.append(a)}));d[l]?console.warn(p+" only loads once. Ignoring:",g):d[l]=(f,...n)=>r.add(f)&&u().then(()=>d[l](f,...n))})({ - key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" + key: "GOOGLE_MAPS_API_KEY" }); diff --git a/samples/routes-compute-routes/index.html b/samples/routes-compute-routes/index.html index 6dbde0680..c9767db00 100644 --- a/samples/routes-compute-routes/index.html +++ b/samples/routes-compute-routes/index.html @@ -14,7 +14,7 @@ diff --git a/samples/routes-get-alternatives/index.html b/samples/routes-get-alternatives/index.html index 08b5484f8..c793e598d 100644 --- a/samples/routes-get-alternatives/index.html +++ b/samples/routes-get-alternatives/index.html @@ -14,7 +14,7 @@ diff --git a/samples/routes-get-directions-panel/index.html b/samples/routes-get-directions-panel/index.html index ffe9362d6..e88c2c5b2 100644 --- a/samples/routes-get-directions-panel/index.html +++ b/samples/routes-get-directions-panel/index.html @@ -14,7 +14,7 @@ diff --git a/samples/routes-get-directions/index.html b/samples/routes-get-directions/index.html index 249fa1ba9..d6082dfd7 100644 --- a/samples/routes-get-directions/index.html +++ b/samples/routes-get-directions/index.html @@ -14,7 +14,7 @@ diff --git a/samples/routes-markers/index.html b/samples/routes-markers/index.html index 7b2377fb7..05a261d5c 100644 --- a/samples/routes-markers/index.html +++ b/samples/routes-markers/index.html @@ -14,7 +14,7 @@ diff --git a/samples/routes-route-matrix/index.html b/samples/routes-route-matrix/index.html index 5955ddc5a..b371a25b2 100644 --- a/samples/routes-route-matrix/index.html +++ b/samples/routes-route-matrix/index.html @@ -14,7 +14,7 @@ diff --git a/samples/streetview-overlays/index.html b/samples/streetview-overlays/index.html index 7e6d2d520..e3e4f8e47 100644 --- a/samples/streetview-overlays/index.html +++ b/samples/streetview-overlays/index.html @@ -14,7 +14,7 @@ diff --git a/samples/test-example/index.html b/samples/test-example/index.html index 311f85713..ea3b7a8fa 100644 --- a/samples/test-example/index.html +++ b/samples/test-example/index.html @@ -16,7 +16,7 @@ diff --git a/samples/ui-kit-place-details-compact/index.html b/samples/ui-kit-place-details-compact/index.html index e6ddda001..90f4c9b17 100644 --- a/samples/ui-kit-place-details-compact/index.html +++ b/samples/ui-kit-place-details-compact/index.html @@ -14,7 +14,7 @@ diff --git a/samples/ui-kit-place-details/index.html b/samples/ui-kit-place-details/index.html index 983179af2..360497ec8 100644 --- a/samples/ui-kit-place-details/index.html +++ b/samples/ui-kit-place-details/index.html @@ -14,7 +14,7 @@ diff --git a/samples/ui-kit-place-search-nearby/index.html b/samples/ui-kit-place-search-nearby/index.html index 016ebe58a..0bf73e650 100644 --- a/samples/ui-kit-place-search-nearby/index.html +++ b/samples/ui-kit-place-search-nearby/index.html @@ -14,7 +14,7 @@ diff --git a/samples/ui-kit-place-search-text/index.html b/samples/ui-kit-place-search-text/index.html index 605b60f07..6aa715b0e 100644 --- a/samples/ui-kit-place-search-text/index.html +++ b/samples/ui-kit-place-search-text/index.html @@ -14,7 +14,7 @@ diff --git a/samples/weather-api-current-compact/index.html b/samples/weather-api-current-compact/index.html index 9ec60a670..eee640947 100644 --- a/samples/weather-api-current-compact/index.html +++ b/samples/weather-api-current-compact/index.html @@ -15,7 +15,7 @@ diff --git a/samples/weather-api-current-compact/index.ts b/samples/weather-api-current-compact/index.ts index acbe4793f..a2d408c53 100644 --- a/samples/weather-api-current-compact/index.ts +++ b/samples/weather-api-current-compact/index.ts @@ -11,7 +11,7 @@ import './simple-weather-widget'; // Import the custom element const CURRENT_CONDITIONS_API_URL = 'https://weather.googleapis.com/v1/currentConditions:lookup'; // Current Conditions API endpoint. -const API_KEY = 'AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8'; // Use the hardcoded API key from index.html +const API_KEY = 'GOOGLE_MAPS_API_KEY'; // Use the hardcoded API key from index.html const LIGHT_MAP_ID = 'c306b3c6dd3ed8d9'; const DARK_MAP_ID = '6b73a9fe7e831a00'; diff --git a/samples/web-components-events/index.html b/samples/web-components-events/index.html index ed1bbe845..1005cc78b 100644 --- a/samples/web-components-events/index.html +++ b/samples/web-components-events/index.html @@ -14,7 +14,7 @@ diff --git a/samples/web-components-map/index.html b/samples/web-components-map/index.html index 57b013c82..ffce96031 100644 --- a/samples/web-components-map/index.html +++ b/samples/web-components-map/index.html @@ -13,7 +13,7 @@ + src="https://maps.googleapis.com/maps/api/js?loading=async&key=GOOGLE_MAPS_API_KEY&libraries=maps,marker"> diff --git a/samples/web-components-markers/index.html b/samples/web-components-markers/index.html index addb240fb..d0278ea63 100644 --- a/samples/web-components-markers/index.html +++ b/samples/web-components-markers/index.html @@ -22,7 +22,7 @@ + src="https://maps.googleapis.com/maps/api/js?loading=async&key=GOOGLE_MAPS_API_KEY&libraries=maps,marker"> From a037831d4046d7cd4fdd2459de2c1df7ae4f5785 Mon Sep 17 00:00:00 2001 From: William French Date: Tue, 23 Jun 2026 14:25:41 -0700 Subject: [PATCH 7/8] chore: lock down API key scope in test workflow --- .github/workflows/tests.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cc7d36d37..b0d434166 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -138,6 +138,7 @@ jobs: done env: STEPS_GET_WORKSPACES_OUTPUTS_CHANGED_WORKSPACES: ${{ steps.get_workspaces.outputs.changed_workspaces }} + GOOGLE_MAPS_API_KEY: "${{ secrets.JS_MAPS_DEV }}" - name: Generate Index (Run Once After Builds) run: bash samples/generate-index.sh @@ -152,6 +153,7 @@ jobs: # Pass the correct base reference for find-changes.sh when called by samples.spec.ts GIT_BASE_REF: ${{ github.event_name == 'pull_request' && format('origin/{0}', github.base_ref) || github.event.before }} CI: true + GOOGLE_MAPS_API_KEY: "${{ secrets.JS_MAPS_DEV }}" - name: Upload Test Report Artifact uses: actions/upload-artifact@v4 @@ -204,6 +206,8 @@ jobs: - name: Build All Projects run: npm run build-all + env: + GOOGLE_MAPS_API_KEY: "${{ secrets.JS_MAPS_DEV }}" - name: Generate Index (Run Once After Full Builds) run: bash samples/generate-index.sh @@ -217,6 +221,7 @@ jobs: env: CI: true TEST_ALL_SAMPLES: "true" + GOOGLE_MAPS_API_KEY: "${{ secrets.JS_MAPS_DEV }}" - name: Upload Test Report Artifact uses: actions/upload-artifact@v4 From f988110407bbc5f1e96a2a66d25e92cd85f49f64 Mon Sep 17 00:00:00 2001 From: William French Date: Wed, 24 Jun 2026 10:48:01 -0700 Subject: [PATCH 8/8] fix: apply API key injection to JS/TS files in Vite --- vite.config.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/vite.config.js b/vite.config.js index 87e51300e..26e4f64e2 100644 --- a/vite.config.js +++ b/vite.config.js @@ -72,6 +72,18 @@ export default defineConfig(({ command }) => { return html.replace(/GOOGLE_MAPS_API_KEY/g, apiKey); }, }, + { + name: 'code-transform', + enforce: 'pre', + transform(code) { + if (code.includes('GOOGLE_MAPS_API_KEY')) { + return { + code: code.replace(/GOOGLE_MAPS_API_KEY/g, apiKey), + map: null, + }; + } + }, + }, ], build: { emptyOutDir: false, // Crucial: Do not empty the main dist dir for each sample.