@wapps/react-google-maps

1.0.1 • Public • Published

react-google-maps

Build Status

React google maps components

Installation

npm install --save @wapps/react-google-maps

How to use

import React from 'react';
import GoogleMaps, { Map } from '@wapps/react-google-maps';

const App = () => (
  <GoogleMaps api={{ key: YOUR_googleMaps_KEY }}>
    <div style={{ height: '100vh', width: '100wh' }}>
      <Map
        center={{
          lat: 52.520008,
          lng: 13.404954,
        }}
        zoom={15}
      />
    </div>
  </GoogleMaps>
);

export default App;

Marker

...
  <Map
    center={{
      lat: 52.520008,
      lng: 13.404954,
    }}
    zoom={15}
  >
    <Marker
      position={{
        lat: 52.520008,
        lng: 13.404954,
      }}
      onClick={() => console.log('Click')}
    />
  </Map>
...

TrafficLayer

...
  <Map
    center={{
      lat: 52.520008,
      lng: 13.404954,
    }}
    zoom={15}
  >
    <TrafficLayer autoRefresh />
  </Map>
...

Live Demo

For a demo, check out https://hupe1980.github.io/wapps-components/

License

MIT

Package Sidebar

Install

npm i @wapps/react-google-maps

Weekly Downloads

13

Version

1.0.1

License

MIT

Unpacked Size

87.2 kB

Total Files

40

Last publish

Collaborators

  • hupe1980