npm

Check out our latest tech talk, "JavaScript Supply Chain Security" presented by VP of Security, Adam Baldwin.Watch it here »

@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

install

npm i @wapps/react-google-maps

Downloadsweekly downloads

196

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability