It's simple component that will be use for render map with the help of getting lat and long into chidern text element
'npm install map-lat-long'
import ReactDOM from 'react-dom'
import React, { Component, PropTypes } from 'react'
import MapLatLong from 'map-lat-long'
class TestComponent extends Component {
render () {
return (
<MapLatLong
height="250px"
width="340px"
accessKey="XXXXXXXXXXXX"
renderToggleIcon="<i className='fa fa-globe'></i>"
getOnChange={(latitude,longitude) => console.log(latitude,longitude)} >
<div>
<label>latitude</label>
<input type="text" name="latitude" />
</div>
<div>
<label>longitude</label>
<input type="text" name="longitude" />
</div>
{/* here childern element you can use your own elements
with class and extra elements like label whatever but name must be latitude and longitude for there inputs elements
*/}
</MapLatLong>
)
}
}
ReactDOM.render( <TestComponent />, document.getElementById('root'))
enter google map access key id
pass icon element as string for map toggle
getOnChange(lat,long)
you will be get latitude and longitude click on map anywere and you will get.
after getting cords you can toggled map
[MIT]