Skip to content

Commit f28a5e8

Browse files
authored
Merge branch 'main' into refactor-3d-accessibility-features
2 parents fc5514a + b9ce0ca commit f28a5e8

1,528 files changed

Lines changed: 12249 additions & 9893 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/dist-pr.yml

Lines changed: 59 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
name: Create release PR for dist
15+
name: Create, approve, and merge release PR for dist
1616

1717
on:
1818
workflow_dispatch:
@@ -23,30 +23,82 @@ on:
2323
type: string
2424

2525
jobs:
26-
create-pr:
26+
create-approve-merge-pr:
2727
runs-on: ubuntu-latest
2828
permissions:
2929
pull-requests: write
3030
contents: write
31+
3132
steps:
3233
- name: Checkout code
33-
uses: actions/checkout@v3
34+
uses: actions/checkout@v4
3435
with:
3536
token: ${{ secrets.GH_MERGE_TOKEN }}
36-
fetch-depth: 0 # Fetch all history
37+
fetch-depth: 0
3738

3839
- name: Set Git Identity
3940
run: |
4041
git config --global user.name 'googlemaps-bot'
4142
git config --global user.email 'googlemaps-bot@google.com'
4243
44+
- name: Ensure temp branch exists on origin
45+
run: |
46+
git fetch origin temp-build-branch:temp-build-branch
47+
git ls-remote --exit-code --heads origin temp-build-branch
48+
49+
- name: Find existing PR
50+
id: find_pr
51+
env:
52+
GH_TOKEN: ${{ secrets.GH_MERGE_TOKEN }}
53+
run: |
54+
PR_URL="$(gh pr list \
55+
--base main \
56+
--head temp-build-branch \
57+
--state open \
58+
--json url \
59+
--jq '.[0].url')"
60+
61+
if [ -n "$PR_URL" ] && [ "$PR_URL" != "null" ]; then
62+
echo "pr_url=$PR_URL" >> "$GITHUB_OUTPUT"
63+
echo "pr_exists=true" >> "$GITHUB_OUTPUT"
64+
else
65+
echo "pr_exists=false" >> "$GITHUB_OUTPUT"
66+
fi
67+
4368
- name: Create Pull Request
69+
id: create_pr
70+
if: steps.find_pr.outputs.pr_exists != 'true'
71+
env:
72+
GH_TOKEN: ${{ secrets.GH_MERGE_TOKEN }}
4473
run: |
45-
gh pr create \
74+
PR_URL="$(gh pr create \
4675
--base main \
4776
--head temp-build-branch \
4877
--title "chore: automated output update (dist)" \
4978
--body "This PR contains updated build output from the dist branch." \
50-
--label "automated pr,dist-update"
79+
--label "automated pr" \
80+
--label "dist-update")"
81+
echo "pr_url=$PR_URL" >> "$GITHUB_OUTPUT"
82+
83+
- name: Determine PR URL
84+
id: pr
85+
run: |
86+
if [ "${{ steps.find_pr.outputs.pr_exists }}" = "true" ]; then
87+
echo "pr_url=${{ steps.find_pr.outputs.pr_url }}" >> "$GITHUB_OUTPUT"
88+
else
89+
echo "pr_url=${{ steps.create_pr.outputs.pr_url }}" >> "$GITHUB_OUTPUT"
90+
fi
91+
92+
- name: Approve PR
5193
env:
52-
GH_TOKEN: ${{ secrets.GH_MERGE_TOKEN }}
94+
PR_URL: ${{ steps.pr.outputs.pr_url }}
95+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96+
run: |
97+
gh pr review --approve "$PR_URL"
98+
99+
- name: Enable auto-merge
100+
env:
101+
PR_URL: ${{ steps.pr.outputs.pr_url }}
102+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103+
run: |
104+
gh pr merge --auto --squash --delete-branch "$PR_URL"

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,6 @@ jobs:
130130
uses: benc-uk/workflow-dispatch@v1
131131
with:
132132
workflow: dist-pr.yml
133-
ref: "temp-build-branch"
133+
ref: "main"
134134
token: ${{ secrets.GH_APPROVER_TOKEN }} # Use the same token that pushed, it needs 'workflows: write' permissions
135135
inputs: '{ "source_run_id": "${{ github.run_id }}" }' # Optional: Pass the run ID for traceability

dist/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ <h1>Maps JSAPI Samples</h1>
1010
<li><a href='/samples/3d-accessibility-features/dist'>3d-accessibility-features</a></li>
1111
<li><a href='/samples/3d-camera-boundary/dist'>3d-camera-boundary</a></li>
1212
<li><a href='/samples/3d-camera-center/dist'>3d-camera-center</a></li>
13+
<li><a href='/samples/3d-camera-position/dist'>3d-camera-position</a></li>
1314
<li><a href='/samples/3d-camera-to-around/dist'>3d-camera-to-around</a></li>
1415
<li><a href='/samples/3d-clamp-mode/dist'>3d-clamp-mode</a></li>
1516
<li><a href='/samples/3d-coverage-map/dist'>3d-coverage-map</a></li>
1617
<li><a href='/samples/3d-label-toggle/dist'>3d-label-toggle</a></li>
1718
<li><a href='/samples/3d-localization/dist'>3d-localization</a></li>
1819
<li><a href='/samples/3d-map-45-degree/dist'>3d-map-45-degree</a></li>
20+
<li><a href='/samples/3d-map-45-degree-locked/dist'>3d-map-45-degree-locked</a></li>
1921
<li><a href='/samples/3d-map-events/dist'>3d-map-events</a></li>
2022
<li><a href='/samples/3d-map-roadmap/dist'>3d-map-roadmap</a></li>
2123
<li><a href='/samples/3d-map-styling/dist'>3d-map-styling</a></li>

dist/samples/3d-accessibility-features/app/index.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111

1212
<link rel="stylesheet" type="text/css" href="./style.css" />
1313
<script type="module" src="./index.js"></script>
14+
<script>
15+
// prettier-ignore
16+
(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))})({
17+
key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8"
18+
});
19+
</script>
1420
</head>
1521
<body>
1622
<div id="map"></div>
17-
18-
<!-- prettier-ignore -->
19-
<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))})
20-
({key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8"});
21-
</script>
2223
</body>
2324
</html>
2425
<!-- [END maps_3d_accessibility_features] -->

dist/samples/3d-accessibility-features/app/index.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@
55
*/
66

77
// [START maps_3d_accessibility_features]
8-
async function initMap() {
9-
const { Map3DElement, Marker3DInteractiveElement, PopoverElement } =
10-
await google.maps.importLibrary('maps3d');
11-
const { PinElement } = await google.maps.importLibrary('marker');
8+
async function init() {
9+
const [
10+
{ Map3DElement, Marker3DInteractiveElement, PopoverElement },
11+
{ PinElement },
12+
] = await Promise.all([
13+
google.maps.importLibrary('maps3d'),
14+
google.maps.importLibrary('marker'),
15+
]);
1216

1317
const map = new Map3DElement({
1418
center: { lat: 34.8405, lng: -111.7909, altitude: 1322.7 },
@@ -78,5 +82,5 @@ async function initMap() {
7882
document.body.append(map);
7983
}
8084

81-
initMap();
85+
void init();
8286
// [END maps_3d_accessibility_features]

dist/samples/3d-accessibility-features/dist/assets/index-CAWeQ9mC.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/samples/3d-accessibility-features/dist/assets/index-y43h04GL.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/samples/3d-accessibility-features/dist/index.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@
99
<head>
1010
<title>Map</title>
1111

12-
<script type="module" crossorigin src="./assets/index-y43h04GL.js"></script>
12+
<script>
13+
// prettier-ignore
14+
(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))})({
15+
key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8"
16+
});
17+
</script>
18+
<script type="module" crossorigin src="./assets/index-CAWeQ9mC.js"></script>
1319
<link rel="stylesheet" crossorigin href="./assets/index-BVXE32j3.css">
1420
</head>
1521
<body>
1622
<div id="map"></div>
17-
18-
<!-- prettier-ignore -->
19-
<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))})
20-
({key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8"});
21-
</script>
2223
</body>
2324
</html>
2425
<!-- [END maps_3d_accessibility_features] -->

dist/samples/3d-accessibility-features/docs/index.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111

1212
<link rel="stylesheet" type="text/css" href="./style.css" />
1313
<script type="module" src="./index.js"></script>
14+
<script>
15+
// prettier-ignore
16+
(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))})({
17+
key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8"
18+
});
19+
</script>
1420
</head>
1521
<body>
1622
<div id="map"></div>
17-
18-
<!-- prettier-ignore -->
19-
<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))})
20-
({key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8"});
21-
</script>
2223
</body>
2324
</html>
2425
<!-- [END maps_3d_accessibility_features] -->

dist/samples/3d-accessibility-features/docs/index.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@
66
*/
77

88
// [START maps_3d_accessibility_features]
9-
async function initMap() {
10-
const { Map3DElement, Marker3DInteractiveElement, PopoverElement } =
11-
await google.maps.importLibrary('maps3d');
12-
const { PinElement } = await google.maps.importLibrary('marker');
9+
async function init() {
10+
const [
11+
{ Map3DElement, Marker3DInteractiveElement, PopoverElement },
12+
{ PinElement },
13+
] = await Promise.all([
14+
google.maps.importLibrary('maps3d'),
15+
google.maps.importLibrary('marker'),
16+
]);
1317

1418
const map = new Map3DElement({
1519
center: { lat: 34.8405, lng: -111.7909, altitude: 1322.7 },
@@ -79,5 +83,5 @@ async function initMap() {
7983
document.body.append(map);
8084
}
8185

82-
initMap();
86+
void init();
8387
// [END maps_3d_accessibility_features]

0 commit comments

Comments
 (0)