Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
8f33fae
chore: inject GOOGLE_MAPS_API_KEY secret into deployment workflow and…
willum070 Jun 23, 2026
19c8cb5
feat: Updates workflows to use hidden API key values.
willum070 Jun 23, 2026
f414fe6
feat: Updates workflows to use hidden API key values.
willum070 Jun 23, 2026
2c08133
feat: Updates workflows to use hidden API key values.
willum070 Jun 23, 2026
9fd7c62
feat: migrate all samples to dynamically injected API keys
willum070 Jun 23, 2026
a182feb
chore: lock down API key scope in test workflow
willum070 Jun 23, 2026
d38b1bd
fix: apply API key injection to JS/TS files in Vite
willum070 Jun 24, 2026
92872b0
chore: remove redundant project-level vite configs
willum070 Jul 10, 2026
729931c
fix: explicitly pass root vite config path in sample package.json scr…
willum070 Jul 10, 2026
41e0831
fixes incorrect init statement
willum070 Jul 10, 2026
62fdb2c
fix: Enable e2e tests and rename prod api key
willum070 Jul 13, 2026
0ccb1f0
chore: Rename development API key secret to JS_MAPS_DEV_KEY
willum070 Jul 13, 2026
32bd558
fix: replace hardcoded api key with placeholder in map-drawing-terradraw
willum070 Jul 13, 2026
1865491
Merge branch 'main' into update-vite-config-apikeys
willum070 Jul 13, 2026
08affd4
Merge remote-tracking branch 'origin/main' into update-vite-config-ap…
willum070 Jul 13, 2026
28a1538
Merge branch 'main' into update-vite-config-apikeys
willum070 Jul 15, 2026
355d221
chore: enforce GOOGLE_MAPS_API_KEY placeholder in build-single.sh
willum070 Jul 15, 2026
0bd7aab
chore: require exact GOOGLE_MAPS_API_KEY placeholder
willum070 Jul 15, 2026
f7bbae2
Merge remote-tracking branch 'origin/update-vite-config-apikeys' into…
willum070 Jul 15, 2026
6f12da8
chore: add 39-character regex check for raw API keys
willum070 Jul 15, 2026
f67b475
fix: refine 39-character regex to avoid base64 SVGs
willum070 Jul 15, 2026
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 .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
contents: write
id-token: write
env:
GOOGLE_MAPS_JS_SAMPLES_KEY: "${{ secrets.GOOGLE_MAPS_JS_SAMPLES_KEY }}"
GOOGLE_MAPS_API_KEY: "${{ secrets.JS_MAPS_PROD_KEY }}"
steps:
- name: Checkout main
uses: actions/checkout@v4
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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_KEY }}"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -149,6 +150,7 @@ jobs:
done
env:
STEPS_GET_WORKSPACES_OUTPUTS_CHANGED_WORKSPACES: ${{ steps.get_workspaces.outputs.changed_workspaces }}
GOOGLE_MAPS_API_KEY: "${{ secrets.JS_MAPS_DEV_KEY }}"

- name: Generate Index (Run Once After Builds)
run: bash samples/generate-index.sh
Expand All @@ -163,6 +165,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_KEY }}"

- name: Upload Test Report Artifact
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -215,6 +218,8 @@ jobs:

- name: Build All Projects
run: npm run build-all
env:
GOOGLE_MAPS_API_KEY: "${{ secrets.JS_MAPS_DEV_KEY }}"

- name: Generate Index (Run Once After Full Builds)
run: bash samples/generate-index.sh
Expand All @@ -228,6 +233,7 @@ jobs:
env:
CI: true
TEST_ALL_SAMPLES: "true"
GOOGLE_MAPS_API_KEY: "${{ secrets.JS_MAPS_DEV_KEY }}"

- name: Upload Test Report Artifact
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion dist/samples/map-drawing-terradraw/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<script>
// 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"
});
</script>
</head>
Expand Down
6 changes: 3 additions & 3 deletions dist/samples/map-drawing-terradraw/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"scripts": {
"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"
"start": "tsc && vite build --config ../../vite.config.js --base './' && vite --config ../../vite.config.js",
"build:vite": "vite build --config ../../vite.config.js --base './'",
"preview": "vite preview --config ../../vite.config.js"
},
"dependencies": {
"terra-draw": "latest",
Expand Down
2 changes: 1 addition & 1 deletion dist/samples/map-drawing-terradraw/docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<script>
// 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"
});
</script>
</head>
Expand Down
2 changes: 1 addition & 1 deletion dist/samples/map-drawing-terradraw/jsfiddle/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<script>
// 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"
});
</script>
</head>
Expand Down
2 changes: 1 addition & 1 deletion dist/samples/routes-compute-routes/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<script>
// 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"
});
</script>
</head>
Expand Down
9 changes: 3 additions & 6 deletions dist/samples/routes-compute-routes/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
"scripts": {
"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": {

"start": "tsc && vite build --config ../../vite.config.js --base './' && vite --config ../../vite.config.js",
"build:vite": "vite build --config ../../vite.config.js --base './'",
"preview": "vite preview --config ../../vite.config.js"
}
}
2 changes: 1 addition & 1 deletion dist/samples/routes-compute-routes/docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<script>
// 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"
});
</script>
</head>
Expand Down
2 changes: 1 addition & 1 deletion dist/samples/routes-compute-routes/jsfiddle/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<script>
// 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"
});
</script>
</head>
Expand Down
41 changes: 17 additions & 24 deletions e2e/samples.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@
*/

// /* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-argument */

// import { test, expect } from '@playwright/test';
import { test, expect } from '@playwright/test';
import fs from 'node:fs';
import path from 'node:path';
import childProcess, { execSync } from 'child_process';
import { execSync, spawn } from 'child_process';

const samplesDir = path.join(__dirname, '..', 'samples');

Expand Down Expand Up @@ -132,41 +129,38 @@
};

// Get changed folders, filtering out excluded ones.
// const foldersToTest = getChangedSampleFolders();
const foldersToTest = getChangedSampleFolders();

if (foldersToTest.length === 0) {
console.log('No sample folders found.');
} else {
console.log(
// `Will run tests for the following folders: ${foldersToTest.join(', ')}`
'IMPORTANT: Tests are temporarily disabled while we work on getting a dev key working for testing samples.'
`Will run tests for the following folders: ${foldersToTest.join(', ')}`
);
}

import { test, expect } from '@playwright/test';

test('Placeholder test', () => {
// Tests are temporarily disabled, this placeholder prevents Playwright from failing with "No tests found"
expect(true).toBe(true);
});

// Iterate through samples and run the same test for each one.
/**
foldersToTest.forEach((sampleFolder) => {
test(`test ${sampleFolder}`, async ({ page }) => {
// START run the preview
// Get an available port
const port = 8080;
const url = `http://localhost:${port}/`;

Check warning on line 148 in e2e/samples.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright PR/Push Tests

Invalid type "8080" of template literal expression

const viteProcess = childProcess.spawn(
const vitePath = path.join(
__dirname,
'..',
'node_modules',
'vite',
['preview', `--port=${port}`],
'bin',
'vite.js'
);
const viteProcess = spawn(
'node',
[vitePath, 'preview', '--port', port.toString()],
{
cwd: path.join(samplesDir, sampleFolder),
stdio: 'inherit',
detached: true, // Allows parent to exit independently, though we kill it in finally
}
);

Expand Down Expand Up @@ -202,6 +196,7 @@
'Falling back to Raster',
'Attempted to load a 3D Map, but failed.',
'The map is not a vector map',
'404 (Not Found)',
];
const criticalErrors = consoleErrors.filter(
(error) =>
Expand All @@ -224,7 +219,7 @@
// Wait for Google Maps to load.
await page.waitForFunction(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
() => (window as any).google?.maps,
() => !!(window as any).google?.maps,

Check warning on line 222 in e2e/samples.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright PR/Push Tests

Unsafe member access .google on an `any` value
{ timeout: 500 }
);

Expand All @@ -236,13 +231,12 @@
const hasGoogleMaps = await page.evaluate(() => {
return (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
typeof (window as any).google !== 'undefined' &&

Check warning on line 234 in e2e/samples.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright PR/Push Tests

Unsafe member access .google on an `any` value
// eslint-disable-next-line @typescript-eslint/no-explicit-any
typeof (window as any).google.maps !== 'undefined'

Check warning on line 236 in e2e/samples.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright PR/Push Tests

Unsafe member access .google on an `any` value
);
});
expect(hasGoogleMaps).toBeTruthy();

} finally {
if (viteProcess.pid) {
try {
Expand All @@ -250,14 +244,13 @@
process.kill(viteProcess.pid, 'SIGINT');
} catch (error) {
console.warn(
`Failed to kill Vite process for ${sampleFolder} (PID: ${viteProcess.pid}):`,

Check warning on line 247 in e2e/samples.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright PR/Push Tests

Invalid type "number" of template literal expression
error
);
}
}
// 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));
}
});
});
*/
2 changes: 1 addition & 1 deletion samples/3d-accessibility-features/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<script>
// 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"
});
</script>
</head>
Expand Down
9 changes: 3 additions & 6 deletions samples/3d-accessibility-features/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
"scripts": {
"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": {

"start": "tsc && vite build --config ../../vite.config.js --base './' && vite --config ../../vite.config.js",
"build:vite": "vite build --config ../../vite.config.js --base './'",
"preview": "vite preview --config ../../vite.config.js"
}
}
2 changes: 1 addition & 1 deletion samples/3d-camera-boundary/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<script>
// 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"
});
</script>
</head>
Expand Down
9 changes: 3 additions & 6 deletions samples/3d-camera-boundary/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
"scripts": {
"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": {

"start": "tsc && vite build --config ../../vite.config.js --base './' && vite --config ../../vite.config.js",
"build:vite": "vite build --config ../../vite.config.js --base './'",
"preview": "vite preview --config ../../vite.config.js"
}
}
2 changes: 1 addition & 1 deletion samples/3d-camera-center/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<script>
// 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"
});
</script>
</head>
Expand Down
6 changes: 3 additions & 3 deletions samples/3d-camera-center/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"scripts": {
"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"
"start": "tsc && vite build --config ../../vite.config.js --base './' && vite --config ../../vite.config.js",
"build:vite": "vite build --config ../../vite.config.js --base './'",
"preview": "vite preview --config ../../vite.config.js"
}
}
2 changes: 1 addition & 1 deletion samples/3d-camera-position/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<script>
// 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"
});
</script>
</head>
Expand Down
4 changes: 2 additions & 2 deletions samples/3d-camera-position/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
// [START maps_3d_camera_position]
async function initMap(): Promise<void> {
async function init(): Promise<void> {
// Declare the needed libraries.
await google.maps.importLibrary('maps3d');

Expand Down Expand Up @@ -68,7 +68,7 @@
lngSlider.value = lng;
altitudeVal.textContent = alt;

codeElem.textContent = `<gmp-map-3d center="${lat},${lng},${alt}" mode="${mode}" tilt="${tilt}" range="${range}" heading="${heading}" fov="${fov}" roll="${roll}"></gmp-map-3d>`;

Check warning on line 71 in samples/3d-camera-position/index.ts

View workflow job for this annotation

GitHub Actions / Playwright PR/Push Tests

Invalid type ""HYBRID" | "ROADMAP" | "SATELLITE" | null" of template literal expression

Check warning on line 71 in samples/3d-camera-position/index.ts

View workflow job for this annotation

GitHub Actions / Playwright PR/Push Tests

Invalid type ""HYBRID" | "ROADMAP" | "SATELLITE" | null" of template literal expression
}
};

Expand Down Expand Up @@ -126,7 +126,7 @@
map3DElement.fov = Math.min(80, Math.max(5, val));
} else {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(map3DElement as any)[prop] = val;

Check warning on line 129 in samples/3d-camera-position/index.ts

View workflow job for this annotation

GitHub Actions / Playwright PR/Push Tests

Unsafe member access [prop] on an `any` value

Check warning on line 129 in samples/3d-camera-position/index.ts

View workflow job for this annotation

GitHub Actions / Playwright PR/Push Tests

Unsafe member access [prop] on an `any` value
}
updateUI();
});
Expand All @@ -148,5 +148,5 @@
setTimeout(updateUI, 500);
}

void initMap();
void init();
// [END maps_3d_camera_position]
11 changes: 5 additions & 6 deletions samples/3d-camera-position/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {}
"start": "tsc && vite build --config ../../vite.config.js --base './' && vite --config ../../vite.config.js",
"build:vite": "vite build --config ../../vite.config.js --base './'",
"preview": "vite preview --config ../../vite.config.js"
}
}
2 changes: 1 addition & 1 deletion samples/3d-camera-to-around/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<script>
// 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"
});
</script>
</head>
Expand Down
9 changes: 3 additions & 6 deletions samples/3d-camera-to-around/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
"scripts": {
"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": {

"start": "tsc && vite build --config ../../vite.config.js --base './' && vite --config ../../vite.config.js",
"build:vite": "vite build --config ../../vite.config.js --base './'",
"preview": "vite preview --config ../../vite.config.js"
}
}
Loading
Loading