Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b219b5e
fix: Adds Prettier config, runs on everything.
willum070 Nov 19, 2025
a58f0a3
Fix address validation fetch call syntax
willum070 Nov 19, 2025
edfea62
Add importLibrary error to list of skipped error messages.
willum070 Nov 19, 2025
be6339e
Adjust timeout for Google Maps wait function
willum070 Nov 19, 2025
202b0bd
Adjust timeouts for page and Google Maps loading
willum070 Nov 19, 2025
737033f
Adjust timeout for waitForLoadState in tests
willum070 Nov 19, 2025
a1d71c6
Fix string formatting in error message
willum070 Nov 19, 2025
ae1f2d0
Implement folder exclusion for sample tests
willum070 Nov 19, 2025
d3e1bd1
Exclude specific sample folders from tests
willum070 Nov 19, 2025
db10b28
Refine comments and filter logic in samples.spec.ts
willum070 Nov 19, 2025
2833d9f
Update samples.spec.ts
willum070 Nov 19, 2025
674c33b
Rename variable for clarity in samples.spec.ts
willum070 Nov 19, 2025
af70a43
Improve handling of changed workspaces in Playwright CI
willum070 Nov 19, 2025
9f41b72
Restore playwright.yml to previous state
willum070 Nov 20, 2025
87147e0
Remove excluded folders from sample validation
willum070 Nov 20, 2025
b141bbb
Delete samples/js-api-loader-map/index.html
willum070 Nov 20, 2025
ec947af
Delete samples/js-api-loader-map/index.ts
willum070 Nov 20, 2025
e302bbd
Delete samples/js-api-loader-map/style.css
willum070 Nov 20, 2025
61e6fc7
Delete samples/map-drawing-terradraw/index.html
willum070 Nov 20, 2025
2f0ca27
Delete samples/map-drawing-terradraw/index.ts
willum070 Nov 20, 2025
db3b974
Delete samples/map-drawing-terradraw/README.md
willum070 Nov 20, 2025
443a442
Delete samples/map-drawing-terradraw/style.css
willum070 Nov 20, 2025
0c620dd
Merge branch 'main' into prettify-everything
willum070 Nov 20, 2025
ff4242e
Removes React UI Kit samples temporarily until we solve the dependenc…
willum070 Nov 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions samples/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore JSON
*.json

# Ignore dist output
dist
7 changes: 7 additions & 0 deletions samples/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": true,
"singleQuote": true,
"bracketSameLine": true
}
1 change: 0 additions & 1 deletion samples/3d-accessibility-features/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ From `samples/`:

For feedback related to this sample, please open a new issue on
[GitHub](https://github.com/googlemaps-samples/js-api-samples/issues).

20 changes: 10 additions & 10 deletions samples/3d-accessibility-features/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
-->
<!-- [START maps_3d_accessibility_features] -->
<html>
<head>
<title>Map</title>
<head>
<title>Map</title>

<link rel="stylesheet" type="text/css" href="./style.css" />
<script type="module" src="./index.js"></script>
</head>
<body>
<div id="map"></div>
<link rel="stylesheet" type="text/css" href="./style.css" />
<script type="module" src="./index.js"></script>
</head>
<body>
<div id="map"></div>

<!-- prettier-ignore -->
<script>(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))})
<!-- prettier-ignore -->
<script>(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", v: "weekly",});</script>
</body>
</body>
</html>
<!-- [END maps_3d_accessibility_features] -->
126 changes: 65 additions & 61 deletions samples/3d-accessibility-features/index.ts
Original file line number Diff line number Diff line change
@@ -1,78 +1,82 @@
/*
* @license
* Copyright 2025 Google LLC. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
* @license
* Copyright 2025 Google LLC. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

// @ts-nocheck
// [START maps_3d_accessibility_features]
async function initMap() {
const { Map3DElement, Marker3DInteractiveElement, PopoverElement } = await google.maps.importLibrary("maps3d");
const { PinElement } = await google.maps.importLibrary("marker");
const { Map3DElement, Marker3DInteractiveElement, PopoverElement } =
await google.maps.importLibrary('maps3d');
const { PinElement } = await google.maps.importLibrary('marker');

const map = new Map3DElement({
center: { lat: 34.8405, lng : -111.7909, altitude: 1322.70 }, range: 13279.50, tilt: 67.44 ,heading: 0.01,
mode: 'SATELLITE',
gestureHandling: "COOPERATIVE"
});
const map = new Map3DElement({
center: { lat: 34.8405, lng: -111.7909, altitude: 1322.7 },
range: 13279.5,
tilt: 67.44,
heading: 0.01,
mode: 'SATELLITE',
gestureHandling: 'COOPERATIVE',
});

// Set LatLng and title text for the markers. The first marker (Boynton Pass)
// receives the initial focus when tab is pressed. Use arrow keys to move
// between markers; press tab again to cycle through the map controls.
const tourStops = [
{
position: { lat: 34.8791806, lng: -111.8265049 },
title: "Boynton Pass",
},
{
position: { lat: 34.8559195, lng: -111.7988186 },
title: "Airport Mesa",
},
{
position: { lat: 34.832149, lng: -111.7695277 },
title: "Chapel of the Holy Cross",
},
{
position: { lat: 34.823736, lng: -111.8001857 },
title: "Red Rock Crossing",
},
{
position: { lat: 34.800326, lng: -111.7665047 },
title: "Bell Rock",
},
];
// Set LatLng and title text for the markers. The first marker (Boynton Pass)
// receives the initial focus when tab is pressed. Use arrow keys to move
// between markers; press tab again to cycle through the map controls.
const tourStops = [
{
position: { lat: 34.8791806, lng: -111.8265049 },
title: 'Boynton Pass',
},
{
position: { lat: 34.8559195, lng: -111.7988186 },
title: 'Airport Mesa',
},
{
position: { lat: 34.832149, lng: -111.7695277 },
title: 'Chapel of the Holy Cross',
},
{
position: { lat: 34.823736, lng: -111.8001857 },
title: 'Red Rock Crossing',
},
{
position: { lat: 34.800326, lng: -111.7665047 },
title: 'Bell Rock',
},
];

tourStops.forEach(({ position, title }, i) => {
const pin = new PinElement({
glyphText: `${i + 1}`,
scale: 1.5,
glyphColor: "#FFFFFF"
});
const popover = new PopoverElement();
tourStops.forEach(({ position, title }, i) => {
const pin = new PinElement({
glyphText: `${i + 1}`,
scale: 1.5,
glyphColor: '#FFFFFF',
});
const popover = new PopoverElement();

const content = `${i + 1}. ${title}`;
const header = document.createElement('span');
// Include the label for screen readers.
header.ariaLabel = `This is marker ${i + 1}. ${title}`;
header.slot = 'header';
const content = `${i + 1}. ${title}`;
const header = document.createElement('span');
// Include the label for screen readers.
header.ariaLabel = `This is marker ${i + 1}. ${title}`;
header.slot = 'header';

popover.append(header);
popover.append(content);
popover.append(header);
popover.append(content);

const interactiveMarker = new Marker3DInteractiveElement({
// Include a title, used for accessibility text for use by screen readers.
title,
position,
gmpPopoverTargetElement: popover
});
const interactiveMarker = new Marker3DInteractiveElement({
// Include a title, used for accessibility text for use by screen readers.
title,
position,
gmpPopoverTargetElement: popover,
});

interactiveMarker.append(pin);
interactiveMarker.append(pin);

map.append(interactiveMarker);
map.append(popover);
});
map.append(interactiveMarker);
map.append(popover);
});

document.body.append(map);
document.body.append(map);
}

initMap();
Expand Down
8 changes: 4 additions & 4 deletions samples/3d-accessibility-features/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
*/
html,
map {
height: 100%;
height: 100%;
}
body {
height: 100%;
margin: 0;
padding: 0;
height: 100%;
margin: 0;
padding: 0;
}
/* [END maps_3d_accessibility_features] */
1 change: 0 additions & 1 deletion samples/3d-camera-boundary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ From `samples/`:

For feedback related to this sample, please open a new issue on
[GitHub](https://github.com/googlemaps-samples/js-api-samples/issues).

20 changes: 10 additions & 10 deletions samples/3d-camera-boundary/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
-->
<!-- [START maps_3d_camera_boundary] -->
<html>
<head>
<title>Map</title>
<head>
<title>Map</title>

<link rel="stylesheet" type="text/css" href="./style.css" />
<script type="module" src="./index.js"></script>
</head>
<body>
<div id="map"></div>
<link rel="stylesheet" type="text/css" href="./style.css" />
<script type="module" src="./index.js"></script>
</head>
<body>
<div id="map"></div>

<!-- prettier-ignore -->
<script>(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))})
<!-- prettier-ignore -->
<script>(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", v: "weekly",});</script>
</body>
</body>
</html>
<!-- [END maps_3d_camera_boundary] -->
14 changes: 7 additions & 7 deletions samples/3d-camera-boundary/index.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/*
* @license
* Copyright 2025 Google LLC. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
* @license
* Copyright 2025 Google LLC. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

// @ts-nocheck
// [START maps_3d_camera_boundary]
async function initMap() {
const { Map3DElement } = await google.maps.importLibrary("maps3d");
const { Map3DElement } = await google.maps.importLibrary('maps3d');

const map = new Map3DElement({
center: { lat: -36.86, lng: 174.76, altitude: 10000 },
tilt: 67.5,
mode: 'HYBRID',
bounds: {south: -48.30, west: 163.56, north: -32.86, east: -180},
gestureHandling: "COOPERATIVE"
bounds: { south: -48.3, west: 163.56, north: -32.86, east: -180 },
gestureHandling: 'COOPERATIVE',
});

document.body.append(map);
Expand Down
8 changes: 4 additions & 4 deletions samples/3d-camera-boundary/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
*/
html,
map {
height: 100%;
height: 100%;
}
body {
height: 100%;
margin: 0;
padding: 0;
height: 100%;
margin: 0;
padding: 0;
}
/* [END maps_3d_camera_boundary] */
1 change: 0 additions & 1 deletion samples/3d-camera-to-around/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ From `samples/`:

For feedback related to this sample, please open a new issue on
[GitHub](https://github.com/googlemaps-samples/js-api-samples/issues).

20 changes: 10 additions & 10 deletions samples/3d-camera-to-around/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
-->
<!-- [START maps_3d_camera_to_around] -->
<html>
<head>
<title>Map</title>
<head>
<title>Map</title>

<link rel="stylesheet" type="text/css" href="./style.css" />
<script type="module" src="./index.js"></script>
</head>
<body>
<div id="map"></div>
<link rel="stylesheet" type="text/css" href="./style.css" />
<script type="module" src="./index.js"></script>
</head>
<body>
<div id="map"></div>

<!-- prettier-ignore -->
<script>(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))})
<!-- prettier-ignore -->
<script>(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", v: "weekly",});</script>
</body>
</body>
</html>
<!-- [END maps_3d_camera_to_around] -->
Loading
Loading