Skip to content

satyampawar/map-lat-lng

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

map-lat-long

It's simple component that will be use for render map with the help of getting lat and long into chidern text element

Install

'npm install map-lat-long'

Usage basic

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'))

Props

accessKey (required)

enter google map access key id

renderToggleIcon

pass icon element as string for map toggle

getOnChange

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

License

[MIT] (c) Satyam pawar 2019.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published