Welcome to the js-api-samples repository, the home of Google Maps JavaScript API documentation samples.
This repository (js-api-samples
) is the new home for the Maps JavaScript API samples.
We are currently migrating all samples from the old repository (js-samples
). During this transition,
you may find some samples are still missing or under development.
We appreciate your patience as we complete this migration. Please check back regularly for updates.
Try the examples out at Google Maps JavaScript API documentation.
Each example is one atomic unit, for which dependencies must be individually set up.
- Run
npm i
to install dependencies. You only need to do this once, and thereafter only to update dependencies. - Navigate to the top level (
samples/
).
- To build a single sample, run
npm run build --workspace=sample-name/
- To build all samples, run
npm run build-all
.
Build output is copied to the main dist/
folder. Each individual sample folder
also contains a dist/
folder, but this is only used by Vite for live preview.
- Navigate to the folder for the sample you want to run (
cd samples/sample-name
). - Run
npm start
to start a server with that sample.
- To test, navigate to project root and run
npx playwright test
. {# TODO: Expand this section. #}
Contributions are welcome! Please see contributing for more information.
This library uses Google Maps Platform services. Use of Google Maps Platform services through this library is subject to the Google Maps Platform Terms of Service.
This library is not a Google Maps Platform Core Service. Therefore, the Google Maps Platform Terms of Service (e.g. Technical Support Services, Service Level Agreements, and Deprecation Policy) do not apply to the code in this library.
This library is offered via an open source license. It is not governed by the Google Maps Platform Support Technical Support Services Guidelines, the SLA, or the Deprecation Policy (however, any Google Maps Platform services used by the library remain subject to the Google Maps Platform Terms of Service).
This library adheres to semantic versioning to indicate when backwards-incompatible changes are introduced. Accordingly, while the library is in version 0.x, backwards-incompatible changes may be introduced at any time.
If you find a bug, or have a feature request, please file an issue on GitHub. If you would like to get answers to technical questions from other Google Maps Platform developers, ask through one of our developer community channels. If you'd like to contribute, please check the Contributing guide.
You can also discuss this library on our Discord server.