https://github.com/googlemaps/js-samples
Samples for the Google Maps JavaScript v3 API
https://github.com/googlemaps/js-samples
google-maps googlemaps javascript js-samples maps samples typescript
Last synced: about 1 month ago
JSON representation
Samples for the Google Maps JavaScript v3 API
- Host: GitHub
- URL: https://github.com/googlemaps/js-samples
- Owner: googlemaps
- License: other
- Created: 2015-08-05T01:08:09.000Z (almost 10 years ago)
- Default Branch: main
- Last Pushed: 2025-04-14T17:15:32.000Z (2 months ago)
- Last Synced: 2025-04-21T08:14:06.403Z (2 months ago)
- Topics: google-maps, googlemaps, javascript, js-samples, maps, samples, typescript
- Language: TypeScript
- Homepage: https://developers.google.com/maps/documentation/javascript/
- Size: 50.8 MB
- Stars: 778
- Watchers: 51
- Forks: 825
- Open Issues: 53
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
- jimsghstars - googlemaps/js-samples - Samples for the Google Maps JavaScript v3 API (TypeScript)
README




[](https://discord.gg/jRteCzP)# js-samples
## Description
Samples for the Google Maps JavaScript API.
The samples can be demoed at the [official documentation site](https://developers.google.com/maps/documentation/javascript/examples).
## Development
### Build
1. `npm i` Install dependencies.
1. `npm run build` Build all targets and update `dist/` folder.### Test
1. `npm test` Test outputs.
1. (Optional) `npm run lint` Fix lint issues with `npm run format`
1. (Optional) `npm run test:playwright:playground:update-snapshots` Update snapshots. This uses an custom env var to only to only update screenshots that differ from the previous ones (Playwright only supports `none`, `all`, or `missing`). To update all screenshots, use `npm run test:playwright:playground:update-snapshots -- --update-snapshots`. It's possible to target a single sample by using `-g `.### Run
1. Start a server with all samples using `npm start`
### Staging
For staging samples (not common), use Cloud Source Repositories which are controlled by an access control list.
1. `gcloud auth login`
2. `git config --global credential.https://source.developers.google.com.helper gcloud.sh`
3. `git remote add google https://source.developers.google.com/p/geo-devrel-javascript-samples/r/js-samples`
4. `git push google`
5. `git rev-parse --short HEAD` or visit the [bucket](https://console.cloud.google.com/storage/browser/geo-devrel-javascript-samples-staging).### Explore
All samples can be explored at https://googlemaps.github.io/js-samples/.
## Other resources
- [Google Maps JavaScript API Documentation](https://developers.google.com/maps/documentation/javascript/tutorial)
- [Google Maps JavaScript API Reference Documentation](https://developers.google.com/maps/documentation/javascript/reference/)
- [Google Maps Typings](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/google.maps) - `npm i -D @types/google.maps`
- [Google Maps Utilities](https://github.com/googlemaps/v3-utility-library)## Support
These libraries are community supported. We're comfortable enough with the stability and features of
the libraries that we want you to build real production applications on it.If you find a bug, or have a feature suggestion, please [log an issue](issues). If you'd like to contribute, please read [How to Contribute](CONTRIB.md).