![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
react-geolocation-autosuggest
Advanced tools
React Google location auto-suggest/autocomplete to provide all possible information with fields like Country, State, City, Pin-code etc.
React Google location auto-suggest/autocomplete to provide all possible information with fields like Country, State, City, Pin-code etc.
A Node.js React package that gives Google map location api based autocomplete/autosuggest dropdown to search and select location from autosuggested places. It also give you the other useful information like Country, State, City, Pin-code with the fields as well and can be customise as per user requirment, rest information like street_number, lat, long etc can be seen in onSelect method along with above.
The package can be installed via NPM:
npm install react-geolocation-autosuggest --save
yarn add react-geolocation-autosuggest
react-geolocation-autosuggest can be imported as follows
var GeoLocation = require('react-geolocation-autosuggest');
OR
import GeoLocation from 'react-geolocation-autosuggest';
You need to include your Google map API key to you app. Somewhere in index.html.
<script src="https://maps.googleapis.com/maps/api/js?key=[YOUR_API_KEY]&libraries=places"></script>
Visit Google's API documentation to get your Google API key.
{"street_number":"2235",
"route":"5th Avenue",
"locality":"New York",
"administrative_area_level_1":"New York",
"country":"United States",
"postal_code":"10037",
"lat":40.8131697,
"lng":-73.93705539999996,
"description":"2235 5th Avenue, New York, NY, USA",
"countryFullDetail":{
"long_name":"United States",
"short_name":"US",
"types":["country","political"]
},
"stateFullDetail":{
"long_name":"New York",
"short_name":"NY",
"types":["administrative_area_level_1","political"]
},
"cityFullDetail":{
"long_name":"New York",
"short_name":"New York",
"types":["locality","political"]
}
}
import React, { Component } from 'react';
import GeoLocation from 'react-geolocation-autosuggest';
class App extends Component {
render() {
return (
<div className="App" >
<GeoLocation/>
</div>
);
}
}
export default App;
import React, { Component } from 'react';
import GeoLocation from 'react-geolocation-autosuggest';
class App extends Component {
render() {
return (
<div className="App" >
<GeoLocation
preSelectedValue={'Avenida Corrientes 2252, Buenos Aires, Argentina'}
// pass a valid address for better/exact match
/>
</div>
);
}
}
export default App;
import React, { Component } from 'react';
import GeoLocation from 'react-geolocation-autosuggest';
class App extends Component {
onSelect = (data) => {
//console.log('data after selection', data);
}
onChange = (data) => {
//console.log('data whenever change occour', data);
}
render() {
return (
<div className="App" >
<GeoLocation
onSelect={this.onSelect}
onChange={this.onChange} />
</div>
);
}
}
export default App;
import React, { Component } from 'react';
import GeoLocation from 'react-geolocation-autosuggest';
class App extends Component {
render() {
return (
<div className="App" >
<GeoLocation
showAllFields={false}
/>
</div>
);
}
}
export default App;
import React, { Component } from 'react';
import GeoLocation from 'react-geolocation-autosuggest';
class App extends Component {
render() {
return (
<div className="App" >
<GeoLocation
showAllFields={false}
isCountryVisible={true}
isStateVisible={true}
/>
</div>
);
}
}
export default App;
import React, { Component } from 'react';
import GeoLocation from 'react-geolocation-autosuggest';
class App extends Component {
render() {
return (
<div className="App" >
<GeoLocation
isAllDisabled={true}
/>
</div>
);
}
}
export default App;
import React, { Component } from 'react';
import GeoLocation from 'react-geolocation-autosuggest';
class App extends Component {
render() {
return (
<div className="App" >
<GeoLocation
isAllDisabled={false}
isCityDisabled={true}
isPinCodeDisabled={true}
/>
</div>
);
}
}
export default App;
import React, { Component } from 'react';
import GeoLocation from 'react-geolocation-autosuggest';
class App extends Component {
render() {
return (
<div className="App" >
<GeoLocation
displayInline={false}
/>
</div>
);
}
}
export default App;
import React, { Component } from 'react';
import GeoLocation from 'react-geolocation-autosuggest';
class App extends Component {
render() {
return (
<div className="App" >
<GeoLocation
errorText={}
countryLabelText={'Country'}
stateLabelText={'State'}
cityLabelText={'City'}
pincodeLabelText={'Pin code'}
key={'autosuggestAddressSearch'}
/>
</div>
);
}
}
export default App;
You can create custom fields styles using the material-ui theme creator as all the fields are of material ui so all material-ui(v3.9.2) property can be applied.
import React, { Component } from 'react';
import GeoLocation from 'react-geolocation-autosuggest';
import { MuiThemeProvider, createMuiTheme } from "@material-ui/core/styles";
const theme = createMuiTheme({
typography: {
useNextVariants: true,
},
overrides: {
MuiInput: {
underline: {
"&&&&:hover:before": {
borderBottom: "1px solid rgba(0, 0, 0, 0.42)"
},
"&&&&:after": {
borderBottom: "2px solid #2196f3"
},
// borderBottom: "1px solid #2196f3"
}
},
MuiFormLabel: {
root: {
color: "blue",
"&$focused": {
"&$focused": {
"color": "#2196f3"
}
}
},
}
}
});
class App extends Component {
render() {
return (
<div className="App" >
<MuiThemeProvider theme={theme}>
<GeoLocation/>
</MuiThemeProvider>
</div>
);
}
}
export default App;
showAllFields: true,
isAllDisabled: false,
isCountryVisible: false,
isStateVisible: false,
isCityVisible: false,
isPinCodeVisible: false,
isCountryDisabled: false,
isStateDisabled: false,
isCityDisabled: false,
isPinCodeDisabled: false,
displayInline: true,
addressLabelText: 'Search Address...',
errorText: '',
countryLabelText:'Country',
stateLabelText:'State',
cityLabelText:'City',
pincodeLabelText:'Pin code',
key:'autosuggestAddressSearch',
preSelectedValue: ''
showAllFields: Boolean,
isAllDisabled: Boolean,
isCountryVisible: Boolean,
isStateVisible: Boolean,
isCityVisible: Boolean,
isPinCodeVisible: Boolean,
isCountryDisabled: Boolean,
isStateDisabled: Boolean,
isCityDisabled: Boolean,
isPinCodeDisabled: Boolean,
displayInline: Boolean,
addressLabelText: String,
errorText: String,
countryLabelText: String,
stateLabelText: String,
cityLabelText: String,
pincodeLabelText: String,
key: String,
preSelectedValue: String,
onSelect: Function,
onChange: Function
FAQs
React Google location auto-suggest/autocomplete to provide all possible information with fields like Country, State, City, Pin-code etc.
We found that react-geolocation-autosuggest demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.