0.1.1 • Published 6 years ago

react-geo-maps v0.1.1

Weekly downloads
71
License
MIT
Repository
github
Last release
6 years ago

React Google map

A React component to integrate Google Maps

Installation

To install the stable version

yarn add react-geo-maps

or

npm install react-geo-maps --save

Google Maps marker is imported as

import { Marker } from "react-geo-maps";

Create your component

import React, { Component } from "react";
import { Marker } from "react-geo-maps";
const locations = [
  { lat: -25.363, lng: 131.044, title: "Australia" },
  { lat: 28.7041, lng: 77.1025, title: "Delhi" }
];

class App extends Component {
  render() {
    return (
      <Marker
        apikey="YOUR_API_KEY"
        zoom={2}
        center={{ lat: -28.024, lng: 140.887 }}
        locations={locations}
        height={500}
        width={500}
      />
    );
  }
}

export default App;

Props

PropTypeRequiredDescription
apikeystring:white_check_mark:Your Google Maps API Key
zoomnumber:white_check_mark:Set the map zoom level
centerobject:white_check_mark:Default Center
locationsarray:white_check_mark:Multiple Location
widthnumber:white_check_mark:Width of map
heightnumber:white_check_mark:Height of map