jw-google-map
A react component for google map.
Install
Static Methods
Method | Parameters | Description |
---|---|---|
setAPIKey |
api : string. |
set the API key for google map and reload the Map API script. |
Methods
Method | Parameters | Description |
---|---|---|
getMapCenter |
retrieve the lat and long of the center of the map view. | |
setMarker |
position : object consist of{ lat : number, lng : number }. |
set a marker on a given position of map. |
Props
Prop | Description |
---|---|
center (optional) |
the initial center of the map. Default: { lat: 0, lng: 0 } |
zoom (optional) |
the initial zoom of the map. Default: 0 |
Usage
;;; ; { ; const map = this; const position = map; map; } { return <Map ref= thismap = m />; } ReactDOM;