Skip to content

Commit fe040c1

Browse files
feat: Add 3d-mesh-flatten, 3d-marker-html, and 3d-camera-center samples
1 parent 1b981a8 commit fe040c1

19 files changed

Lines changed: 514 additions & 0 deletions

package-lock.json

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

samples/3d-camera-center/README.md

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+
## 3d-camera-center
4+
5+
Sample generated from 3d-camera-center
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/3d-camera-center`
16+
`npm start`
17+
18+
### Build an individual example
19+
20+
`cd samples/3d-camera-center`
21+
`npm run build`
22+
23+
From `samples/`:
24+
25+
`npm run build --workspace=3d-camera-center/`
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/3d-camera-center`
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: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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_3d_camera_center] -->
8+
<html>
9+
<head>
10+
<title>3D Camera Position</title>
11+
12+
<link rel="stylesheet" type="text/css" href="./style.css" />
13+
</head>
14+
<body>
15+
<gmp-map-3d
16+
center="40.7860524,-73.9634983,0"
17+
range="1500"
18+
tilt="70"
19+
heading="-150"
20+
mode="SATELLITE"
21+
gesture-handling="COOPERATIVE">
22+
<gmp-marker position="40.7860524,-73.9634983" altitude-mode="clamp-to-ground"></gmp-marker>
23+
</gmp-map-3d>
24+
25+
<script
26+
async
27+
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8&v=beta&libraries=maps3d"></script>
28+
</body>
29+
</html>
30+
<!-- [END maps_3d_camera_center] -->

samples/3d-camera-center/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
* @license
3+
* Copyright 2026 Google LLC. All Rights Reserved.
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
// @ts-nocheck
8+
// [START maps_3d_camera_center]
9+
10+
// [END maps_3d_camera_center]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "@js-api-samples/3d-camera-center",
3+
"version": "1.0.0",
4+
"scripts": {
5+
"build": "tsc && bash ../jsfiddle.sh 3d-camera-center && bash ../app.sh 3d-camera-center && bash ../docs.sh 3d-camera-center && npm run build:vite --workspace=. && bash ../dist.sh 3d-camera-center",
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+
}

samples/3d-camera-center/style.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* @license
3+
* Copyright 2026 Google LLC. All Rights Reserved.
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/* [START maps_3d_camera_center] */
8+
html,
9+
gmp-map-3d {
10+
height: 100%;
11+
}
12+
13+
html,
14+
body {
15+
height: 100%;
16+
margin: 0;
17+
padding: 0;
18+
}
19+
/* [END maps_3d_camera_center] */
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+
}

samples/3d-marker-html/README.md

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+
## 3d-marker-html
4+
5+
Sample generated from 3d-marker-html
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/3d-marker-html`
16+
`npm start`
17+
18+
### Build an individual example
19+
20+
`cd samples/3d-marker-html`
21+
`npm run build`
22+
23+
From `samples/`:
24+
25+
`npm run build --workspace=3d-marker-html/`
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/3d-marker-html`
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).

samples/3d-marker-html/index.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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_3d_marker_html] -->
8+
<html>
9+
<head>
10+
<title>3D Marker HTML</title>
11+
<link rel="stylesheet" type="text/css" href="./style.css" />
12+
</head>
13+
<body>
14+
<gmp-map-3d center="40.7489,-73.9680,0" heading="315" tilt="65" range="800" mode="SATELLITE">
15+
<gmp-marker position="40.7489,-73.9680" altitude-mode="clamp-to-ground" title="UN Headquarters">
16+
<div class="custom-marker">United Nations Secretariat Building</div>
17+
</gmp-marker>
18+
</gmp-map-3d>
19+
20+
<script
21+
async
22+
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8&v=beta&libraries=maps3d"></script>
23+
</body>
24+
</html>
25+
<!-- [END maps_3d_marker_html] -->

samples/3d-marker-html/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
* @license
3+
* Copyright 2026 Google LLC. All Rights Reserved.
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
// @ts-nocheck
8+
// [START maps_3d_marker_html]
9+
10+
// [END maps_3d_marker_html]

0 commit comments

Comments
 (0)