-
Notifications
You must be signed in to change notification settings - Fork 7
Add CBMS sample #847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Add CBMS sample #847
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fd715c5
Add CBMS sample
oppenheimera df8e90f
Fix region tags
oppenheimera ce71f15
Remove package-lock.json
oppenheimera af70012
Add localization sample
oppenheimera a5607fc
Change title to '3d map styling'
willum070 48fb826
Change page title to '3d localization'
willum070 3903ee7
Merge branch 'main' into cbms
willum070 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Google Maps JavaScript Sample | ||
|
|
||
| This sample is generated from @googlemaps/js-samples located at | ||
| https://github.com/googlemaps-samples/js-api-samples. | ||
|
|
||
| ## Setup | ||
|
|
||
| ### Before starting run: | ||
|
|
||
| `$npm i` | ||
|
|
||
| ### Run an example on a local web server | ||
|
|
||
| First `cd` to the folder for the sample to run, then: | ||
|
|
||
| `$npm start` | ||
|
|
||
| ### Build an individual example | ||
|
|
||
| From `samples/`: | ||
|
|
||
| `$npm run build --workspace=sample-name/` | ||
|
|
||
| ### Build all of the examples. | ||
|
|
||
| From `samples/`: | ||
| `$npm run build-all` | ||
|
|
||
| ## Feedback | ||
|
|
||
| For feedback related to this sample, please open a new issue on | ||
| [GitHub](https://github.com/googlemaps-samples/js-api-samples/issues). | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| <!doctype html> | ||
| <!-- | ||
| @license | ||
| Copyright 2025 Google LLC. All Rights Reserved. | ||
| SPDX-License-Identifier: Apache-2.0 | ||
| --> | ||
| <!-- [START maps_3d_map_styling] --> | ||
| <html> | ||
| <head> | ||
| <title>Simple Map</title> | ||
|
|
||
| <link rel="stylesheet" type="text/css" href="./style.css" /> | ||
| <script type="module" src="./index.js"></script> | ||
| </head> | ||
| <body> | ||
|
|
||
| <!-- prettier-ignore --> | ||
| <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))}) | ||
| ({key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8", v: "nightly",});</script> | ||
| </body> | ||
| </html> | ||
| <!-- [END maps_3d_map_styling] --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /* | ||
| * @license | ||
| * Copyright 2025 Google LLC. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| //@ts-nocheck | ||
| // [START maps_3d_map_styling] | ||
| async function initMap() { | ||
| const { Map3DElement } = await google.maps.importLibrary("maps3d"); | ||
|
|
||
| const map = new Map3DElement({ | ||
| center: { lat: 37.75183154601466, lng: -119.52369070507672, altitude: 2200 }, | ||
| tilt: 67.5, | ||
| heading: 108.94057782079429, | ||
| range: 6605.57279990986, | ||
| mapId: 'bcce776b92de1336e22c569f', | ||
| mode: 'HYBRID', | ||
| gestureHandling: "COOPERATIVE" | ||
| }); | ||
|
|
||
| document.body.append(map); | ||
| } | ||
|
|
||
| initMap(); | ||
| // [END maps_3d_map_styling] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
| "name": "@js-api-samples/3d-map-styling", | ||
| "version": "1.0.0", | ||
| "scripts": { | ||
| "build": "tsc && bash ../jsfiddle.sh 3d-map-styling && bash ../app.sh 3d-map-styling && bash ../docs.sh 3d-map-styling && npm run build:vite --workspace=. && bash ../dist.sh 3d-map-styling", | ||
| "test": "tsc && npm run build:vite --workspace=.", | ||
| "start": "tsc && vite build --base './' && vite", | ||
| "build:vite": "vite build --base './'", | ||
| "preview": "vite preview" | ||
| }, | ||
| "dependencies": { | ||
|
|
||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| /* | ||
| * @license | ||
| * Copyright 2025 Google LLC. All Rights Reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| /* [START maps_3d_map_styling] */ | ||
| /* * Always set the map height explicitly to define the size of the div element | ||
| * that contains the map. | ||
| */ | ||
| #gmp-map-3d { | ||
| height: 100%; | ||
| } | ||
| html, | ||
| body { | ||
| height: 100%; | ||
| margin: 0; | ||
| padding: 0; | ||
| } | ||
| /* [END maps_3d_map_styling] */ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.