Google Maps React Wrapper
Created on .
Read in 1 minute.
The package @googlemaps/react-wrapper is a wrapper component that helps load the Google Maps JavaScript API. Below is a short snippet demonstrating usage.
import { Wrapper, Status } from "@googlemaps/react-wrapper";
const render = (status: Status): ReactElement => {
if (status === Status.LOADING) return <Spinner />;
if (status === Status.FAILURE) return <ErrorComponent />;
return null;
};
const MyApp = () => (
<Wrapper apiKey={"YOUR_API_KEY"} render={render}>
<MyMapComponent />
</Wrapper>
);
Recently I livecoded its usage and created google.maps.Map
and google.maps.Marker
components.
If you have any questions about its usage, please feel free to open an issue on GitHub.
Next
2021 Mogollon Monster 100 Mile Race Report
Previous
Molas Lake to Vallecito Reservoir
Related
- WMS Layer on Google Maps
- What is DevRel?
- Using Google Container Registry, Docker Buildx, and GitHub Actions
- Microservice Usage Logging with Openresty and Google BigQuery
- Automatically Archiving Dependabot and Semantic Release Emails
- Strongly Typed Yup Schema in TypeScript