Skip to content

Commit 2afed97

Browse files
authored
Merge branch 'main' into pin-element-glyphs
2 parents b31ac04 + 0e267e0 commit 2afed97

File tree

27 files changed

+466
-4
lines changed

27 files changed

+466
-4
lines changed

dist/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ <h1>Maps JSAPI Samples</h1>
8383
<li><a href='/samples/ui-kit-place-search-text/dist'>ui-kit-place-search-text</a></li>
8484
<li><a href='/samples/ui-kit-place-search-text-compact/dist'>ui-kit-place-search-text-compact</a></li>
8585
<li><a href='/samples/weather-api-current-compact/dist'>weather-api-current-compact</a></li>
86+
<li><a href='/samples/web-components-map/dist'>web-components-map</a></li>
8687
</ul>
8788
</body>
8889
</html>
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: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Google Maps JavaScript Sample
2+
3+
This sample is generated from @googlemaps/js-samples located at
4+
https://github.com/googlemaps-samples/js-api-samples.
5+
6+
## Setup
7+
8+
### Before starting run:
9+
10+
`npm i`
11+
12+
### Run an example on a local web server
13+
14+
`cd samples/web-components-map`
15+
`npm start`
16+
17+
### Build an individual example
18+
19+
`cd samples/web-components-map`
20+
`npm run build`
21+
22+
From 'samples':
23+
24+
`npm run build --workspace=web-components-map/`
25+
26+
### Build all of the examples.
27+
28+
From 'samples':
29+
30+
`npm run build-all`
31+
32+
### Run lint to check for problems
33+
34+
`cd samples/web-components-map`
35+
`npx eslint index.ts`
36+
37+
## Feedback
38+
39+
For feedback related to this sample, please open a new issue on
40+
[GitHub](https://github.com/googlemaps-samples/js-api-samples/issues).
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<!DOCTYPE html>
2+
<!--
3+
@license
4+
Copyright 2019 Google LLC. All Rights Reserved.
5+
SPDX-License-Identifier: Apache-2.0
6+
-->
7+
<!-- [START maps_web_components_map] -->
8+
<html>
9+
<head>
10+
<title>Add a Map using HTML</title>
11+
12+
<link rel="stylesheet" type="text/css" href="./style.css" />
13+
<script type="module" src="./index.js"></script>
14+
</head>
15+
<body>
16+
<!-- [START maps_web_components_map_gmpmap] -->
17+
<gmp-map
18+
center="37.4220656,-122.0840897"
19+
zoom="10"
20+
map-id="DEMO_MAP_ID"
21+
style="height: 400px"
22+
></gmp-map>
23+
<!-- [END maps_web_components_map_gmpmap] -->
24+
<!--
25+
The `defer` attribute causes the script to execute after the full HTML
26+
document has been parsed. For non-blocking uses, avoiding race conditions,
27+
and consistent behavior across browsers, consider loading using Promises. See
28+
https://developers.google.com/maps/documentation/javascript/load-maps-js-api
29+
for more information.
30+
-->
31+
<script
32+
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8&libraries=maps,marker&v=weekly"
33+
defer
34+
></script>
35+
</body>
36+
</html>
37+
<!-- [END maps_web_components_map] -->
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* @license
3+
* Copyright 2019 Google LLC. All Rights Reserved.
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
// [START maps_web_components_map]
8+
// This example adds a map using web components.
9+
async function initMap(): Promise<void> {
10+
console.log('Maps JavaScript API loaded.');
11+
}
12+
13+
initMap();
14+
// [END maps_web_components_map]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "@js-api-samples/web-components-map",
3+
"version": "1.0.0",
4+
"scripts": {
5+
"build": "tsc && bash ../jsfiddle.sh web-components-map && bash ../app.sh web-components-map && bash ../docs.sh web-components-map && npm run build:vite --workspace=. && bash ../dist.sh web-components-map",
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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* @license
3+
* Copyright 2019 Google LLC. All Rights Reserved.
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
/* [START maps_web_components_map] */
7+
/* [END maps_web_components_map] */
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+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/**
2+
* @license
3+
* Copyright 2019 Google LLC. All Rights Reserved.
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/

dist/samples/web-components-map/dist/assets/index-C4v-LbEc.js

Lines changed: 5 additions & 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)