Skip to content

Commit f1da71c

Browse files
Update dist folder [skip ci] (#1038)
1 parent 6fb9efe commit f1da71c

27 files changed

Lines changed: 660 additions & 1 deletion

dist/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ <h1>Maps JSAPI Samples</h1>
9191
<li><a href='/samples/routes-get-directions-panel/dist'>routes-get-directions-panel</a></li>
9292
<li><a href='/samples/routes-markers/dist'>routes-markers</a></li>
9393
<li><a href='/samples/routes-route-matrix/dist'>routes-route-matrix</a></li>
94+
<li><a href='/samples/streetview-overlays/dist'>streetview-overlays</a></li>
9495
<li><a href='/samples/test-example/dist'>test-example</a></li>
9596
<li><a href='/samples/ui-kit-customization/dist'>ui-kit-customization</a></li>
9697
<li><a href='/samples/ui-kit-place-details/dist'>ui-kit-place-details</a></li>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": [
3+
"plugin:@typescript-eslint/recommended"
4+
],
5+
"parser": "@typescript-eslint/parser",
6+
"rules": {
7+
"@typescript-eslint/ban-ts-comment": 0,
8+
"@typescript-eslint/no-this-alias": 1,
9+
"@typescript-eslint/no-empty-function": 1,
10+
"@typescript-eslint/explicit-module-boundary-types": 1,
11+
"@typescript-eslint/no-unused-vars": 1
12+
}
13+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Google Maps JavaScript Sample
2+
3+
## streetview-overlays
4+
5+
Show overlays on a StreetView panorama.
6+
7+
## Setup
8+
9+
### Before starting run:
10+
11+
`npm i`
12+
13+
### Run an example on a local web server
14+
15+
`cd samples/streetview-overlays`
16+
`npm start`
17+
18+
### Build an individual example
19+
20+
`cd samples/streetview-overlays`
21+
`npm run build`
22+
23+
From 'samples':
24+
25+
`npm run build --workspace=streetview-overlays/`
26+
27+
### Build all of the examples.
28+
29+
From 'samples':
30+
31+
`npm run build-all`
32+
33+
### Run lint to check for problems
34+
35+
`cd samples/streetview-overlays`
36+
`npx eslint index.ts`
37+
38+
## Feedback
39+
40+
For feedback related to this sample, please open a new issue on
41+
[GitHub](https://github.com/googlemaps-samples/js-api-samples/issues).
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!DOCTYPE html>
2+
<!--
3+
@license
4+
Copyright 2026 Google LLC. All Rights Reserved.
5+
SPDX-License-Identifier: Apache-2.0
6+
-->
7+
<!-- [START maps_streetview_overlays] -->
8+
<html>
9+
<head>
10+
<title>Overlays Within Street View</title>
11+
12+
<link rel="stylesheet" type="text/css" href="./style.css" />
13+
<script type="module" src="./index.js"></script>
14+
<!-- prettier-ignore -->
15+
<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))})
16+
({key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8", v: "weekly"});</script>
17+
</head>
18+
<body>
19+
<gmp-map map-id="DEMO_MAP_ID" center="40.729884, -73.990988" zoom="18">
20+
<div id="floating-panel" slot="control-inline-start-block-start">
21+
<input type="button" value="Toggle Street View" id="toggle" />
22+
</div>
23+
</gmp-map>
24+
</body>
25+
</html>
26+
<!-- [END maps_streetview_overlays] -->
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/**
2+
* @license
3+
* Copyright 2026 Google LLC. All Rights Reserved.
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
// [START maps_streetview_overlays]
8+
let panorama: google.maps.StreetViewPanorama;
9+
let innerMap: google.maps.Map;
10+
11+
async function initMap() {
12+
// Request needed libraries.
13+
const { Map } = (await google.maps.importLibrary(
14+
'maps'
15+
)) as google.maps.MapsLibrary;
16+
17+
// Set the location of Astor Place.
18+
const astorPlace = { lat: 40.729884, lng: -73.990988 };
19+
20+
const mapElement = document.querySelector(
21+
'gmp-map'
22+
) as google.maps.MapElement;
23+
24+
innerMap = mapElement.innerMap;
25+
innerMap.setOptions({
26+
mapTypeControl: false,
27+
streetViewControl: false,
28+
fullscreenControl: false,
29+
});
30+
31+
document
32+
.getElementById('toggle')!
33+
.addEventListener('click', toggleStreetView);
34+
35+
const cafeIcon = document.createElement('img');
36+
cafeIcon.src = new URL('./public/cafe_icon.svg', import.meta.url).href;
37+
38+
const dollarIcon = document.createElement('img');
39+
dollarIcon.src = new URL('./public/bank_icon.svg', import.meta.url).href;
40+
41+
const busIcon = document.createElement('img');
42+
busIcon.src = new URL('./public/bus_icon.svg', import.meta.url).href;
43+
44+
// Set up the markers on the map
45+
const cafeMarker = new google.maps.Marker({
46+
position: { lat: 40.730031, lng: -73.991428 },
47+
map: innerMap,
48+
title: 'Cafe',
49+
icon: cafeIcon.src,
50+
});
51+
52+
const bankMarker = new google.maps.Marker({
53+
position: { lat: 40.729681, lng: -73.991138 },
54+
map: innerMap,
55+
title: 'Bank',
56+
icon: dollarIcon.src,
57+
});
58+
59+
const busMarker = new google.maps.Marker({
60+
position: { lat: 40.729559, lng: -73.990741 },
61+
map: innerMap,
62+
title: 'Bus Stop',
63+
icon: busIcon.src,
64+
});
65+
66+
// We get the map's default panorama and set up some defaults.
67+
// Note that we don't yet set it visible.
68+
panorama = innerMap.getStreetView()!; // TODO fix type
69+
panorama.setPosition(astorPlace);
70+
panorama.setPov(
71+
/** @type {google.maps.StreetViewPov} */ {
72+
heading: 265,
73+
pitch: 0,
74+
}
75+
);
76+
}
77+
78+
function toggleStreetView(): void {
79+
const toggle = panorama.getVisible();
80+
81+
if (toggle == false) {
82+
panorama.setVisible(true);
83+
} else {
84+
panorama.setVisible(false);
85+
}
86+
}
87+
88+
initMap();
89+
// [END maps_streetview_overlays]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "@js-api-samples/streetview-overlays",
3+
"version": "1.0.0",
4+
"scripts": {
5+
"build": "tsc && bash ../jsfiddle.sh streetview-overlays && bash ../app.sh streetview-overlays && bash ../docs.sh streetview-overlays && npm run build:vite --workspace=. && bash ../dist.sh streetview-overlays",
6+
"test": "tsc && npm run build:vite --workspace=.",
7+
"start": "tsc && vite build --base './' && vite",
8+
"build:vite": "vite build --base './'",
9+
"preview": "vite preview"
10+
},
11+
"dependencies": {
12+
13+
}
14+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* @license
3+
* Copyright 2026 Google LLC. All Rights Reserved.
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
/* [START maps_streetview_overlays] */
7+
/*
8+
* Always set the map height explicitly to define the size of the div element
9+
* that contains the map.
10+
*/
11+
#map {
12+
height: 100%;
13+
}
14+
15+
/*
16+
* Optional: Makes the sample page fill the window.
17+
*/
18+
html,
19+
body {
20+
height: 100%;
21+
margin: 0;
22+
padding: 0;
23+
}
24+
25+
#floating-panel {
26+
position: absolute;
27+
top: 10px;
28+
left: 25%;
29+
z-index: 5;
30+
background-color: #fff;
31+
padding: 5px;
32+
border: 1px solid #999;
33+
text-align: center;
34+
font-family: "Roboto", "sans-serif";
35+
line-height: 30px;
36+
padding-left: 10px;
37+
}
38+
39+
/* [END maps_streetview_overlays] */
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"compilerOptions": {
3+
"module": "esnext",
4+
"target": "esnext",
5+
"strict": true,
6+
"noImplicitAny": false,
7+
"lib": [
8+
"es2015",
9+
"esnext",
10+
"es6",
11+
"dom",
12+
"dom.iterable"
13+
],
14+
"moduleResolution": "Node",
15+
"jsx": "preserve"
16+
}
17+
}

dist/samples/streetview-overlays/dist/assets/index-CoNxiByN.css

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/streetview-overlays/dist/assets/index-boY_cdGW.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.

0 commit comments

Comments
 (0)