SimpleReactMap
A Simple Web Implementation Of The Google Maps API For React. (No API Key Required!)
Installation
Make sure you have npm and node installed. Run npm install simple-react-map
to install the package.
Usage
After installing the package, you can use it by importing it into your React app.
import SimpleReactMap from 'simple-react-map';
Then use the component in your React app.
function Component() {
return (
<SimpleReactMap
zoom={14}
center={{lat: -34.397, lng: 150.644}}
className="map"
/>
);
}
Props
center: Array [lat, lng] (Default: null, Ex: [-37, -122.8])
The coordinates of the center of the map. Overrides the query string.
zoom: Number (Default: 12, Ex: 11)
The zoom level of the map.
query: String (Default: null, Ex: 'San Jose')
The query string to search for. Overrides the center prop.
...rest: Object (Default: null, Ex: {className: 'map'})
Other props that are passed to the underlying Element.
Building
You can manually build SimpleReactMap by following the instructions below:
- Make sure you have npm and node installed.
- Clone the repository to your local machine
git clone https://github.com/nekumelon/SimpleReactMap.git
- Cd into the cloned directory
cd SimpleReactMap
and runnpm install
- Run
npm build
to build the module.
LICENSE
See LICENSE for the license.