react-google-map-wrapper
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

react-google-map-wrapper is a React component library for rendering Google Maps.

You can see an example here.

import { Suspense } from 'react';
import { GoogleMap, GoogleMapApiLoader, Marker } from 'react-google-map-wrapper';

function Map() {
  return (
    <GoogleMap className='h-[400px]' zoom={17} center={{ lat: 37.5709413, lng: 126.977787 }}>
      <Marker lat={37.5709413} lng={126.977787} />
    </GoogleMap>
  );
}

function App() {
  return (
    <Suspense fallback={<Fallback />}>
      {/* Load the google map api */}
      <GoogleMapApiLoader apiKey='YOUR_API_KEY' suspense>
        <Map />
      </GoogleMapApiLoader>
    </Suspense>
  );
}

Installation

npm install react-google-map-wrapper # or yarn add react-google-map-wrapper or pnpm add react-google-map-wrapper

Documentation

You can find the documentation on the website.

Check out the Getting Started page for a quick overview.

License

react-google-map-wrapper is MIT licensed.

Package Sidebar

Install

npm i react-google-map-wrapper

Weekly Downloads

141

Version

1.0.5

License

MIT

Unpacked Size

89.3 kB

Total Files

6

Last publish

Collaborators

  • pyjun01