Skip to content

Commit 8771fa8

Browse files
Update dist folder [skip ci] (#1323)
1 parent 8d4308c commit 8771fa8

21 files changed

Lines changed: 445 additions & 0 deletions

dist/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ <h1>Maps JSAPI Samples</h1>
9090
<li><a href='/samples/geocoding-reverse/dist'>geocoding-reverse</a></li>
9191
<li><a href='/samples/geocoding-simple/dist'>geocoding-simple</a></li>
9292
<li><a href='/samples/hiding-features/dist'>hiding-features</a></li>
93+
<li><a href='/samples/infowindow-simple/dist'>infowindow-simple</a></li>
9394
<li><a href='/samples/js-api-loader-map/dist'>js-api-loader-map</a></li>
9495
<li><a href='/samples/layer-data-event/dist'>layer-data-event</a></li>
9596
<li><a href='/samples/layer-data-quakes-red/dist'>layer-data-quakes-red</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+
## infowindow-simple
4+
5+
This sample demonstrates how to create a simple info window on a map.
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/infowindow-simple`
16+
`npm start`
17+
18+
### Build an individual example
19+
20+
`cd samples/infowindow-simple`
21+
`npm run build`
22+
23+
From 'samples':
24+
25+
`npm run build --workspace=infowindow-simple/`
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/infowindow-simple`
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: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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_infowindow_simple] -->
8+
<html>
9+
<head>
10+
<title>Info Windows</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 center="-25.363,131.044" zoom="4" map-id="DEMO_MAP_ID"></gmp-map>
20+
</body>
21+
</html>
22+
<!-- [END maps_infowindow_simple] -->
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/**
2+
* @license
3+
* Copyright 2026 Google LLC. All Rights Reserved.
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
// [START maps_infowindow_simple]
8+
// This example displays a marker at the center of Australia.
9+
// When the user clicks the marker, an info window opens.
10+
11+
async function initMap(): Promise<void> {
12+
await google.maps.importLibrary("maps");
13+
await google.maps.importLibrary("marker");
14+
15+
const uluru = { lat: -25.363, lng: 131.044 };
16+
const mapElement = document.querySelector('gmp-map') as google.maps.MapElement;
17+
const innerMap = mapElement.innerMap;
18+
19+
const heading = document.createElement("h1");
20+
heading.textContent = "Uluru (Ayers Rock)";
21+
22+
const content = document.createElement("div");
23+
24+
const p1 = document.createElement("p");
25+
p1.textContent = "Uluru, also referred to as Ayers Rock, is a large sandstone rock formation in the southern part of the Northern Territory, central Australia. It lies 335 km (208 mi) south west of the nearest large town, Alice Springs; 450 km (280 mi) by road. Kata Tjuta and Uluru are the two major features of the Uluru - Kata Tjuta National Park. Uluru is sacred to the Pitjantjatjara and Yankunytjatjara, the Aboriginal people of the area. It has many springs, waterholes, rock caves and ancient paintings. Uluru is listed as a World Heritage Site.";
26+
content.appendChild(p1);
27+
28+
const a = document.createElement("a");
29+
a.href = "https://en.wikipedia.org/w/index.php?title=Uluru";
30+
a.textContent = "https://en.wikipedia.org/w/index.php?title=Uluru";
31+
a.target = "_blank";
32+
content.appendChild(a);
33+
34+
const infowindow = new google.maps.InfoWindow({
35+
headerContent: heading,
36+
content: content,
37+
ariaLabel: "Uluru",
38+
maxWidth: 500, // Set max width (optional).
39+
});
40+
41+
const marker = new google.maps.marker.AdvancedMarkerElement({
42+
position: uluru,
43+
map: innerMap,
44+
title: "Uluru (Ayers Rock)",
45+
gmpClickable: true,
46+
});
47+
48+
marker.addEventListener("gmp-click", () => {
49+
infowindow.open({
50+
anchor: marker,
51+
map: innerMap,
52+
});
53+
});
54+
}
55+
56+
initMap();
57+
// [END maps_infowindow_simple]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "@js-api-samples/infowindow-simple",
3+
"version": "1.0.0",
4+
"scripts": {
5+
"build": "tsc && bash ../jsfiddle.sh infowindow-simple && bash ../app.sh infowindow-simple && bash ../docs.sh infowindow-simple && npm run build:vite --workspace=. && bash ../dist.sh infowindow-simple",
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: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* @license
3+
* Copyright 2026 Google LLC. All Rights Reserved.
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
/* [START maps_infowindow_simple] */
7+
8+
/*
9+
* Optional: Makes the sample page fill the window.
10+
*/
11+
html,
12+
body {
13+
height: 100%;
14+
margin: 0;
15+
padding: 0;
16+
}
17+
18+
/* [END maps_infowindow_simple] */
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"rootDir": "."
5+
},
6+
"include": [
7+
"./*.ts",
8+
]
9+
}

dist/samples/infowindow-simple/dist/assets/index-0RrE2FoA.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.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
html,body{height:100%;margin:0;padding:0}

0 commit comments

Comments
 (0)