Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Files

Latest commit

May 31, 2019
048496d · May 31, 2019

History

History

react-google-maps

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
May 31, 2019
Feb 24, 2019
Jun 7, 2018
May 31, 2019
May 31, 2019
Jun 7, 2018
Jun 14, 2018

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