Coder Social home page Coder Social logo

reside-eng / material-ui-places Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ydeshayes/googleplaceautocomplete

0.0 6.0 1.0 1.11 MB

Wrapper on top of the material-ui AutoComplete component that use google place api

Home Page: https://ydeshayes.github.io/googlePlaceAutocomplete/

JavaScript 100.00%

material-ui-places's Introduction

Build Status

material-ui-places component for ReactJS

Wrapper on top of the material-ui AutoComplete component that use google place api

Installation

Add this script to your html page:

<head>
  <script src="https://maps.googleapis.com/maps/api/js?libraries=places"></script>
</head>

Material-ui is required:

  npm install material-ui
  npm install material-ui-places

Features

  • AutoComplete that auto-load google places

Getting started

<GooglePlaceAutocomplete
  searchText={'paris'}
  onChange={onAutoCompleteInputChangeFct}
  onNewRequest={onClickLocationFct}
  name={'location'}
/>

Props:

  • Same as AutoComplete material-ui component

  • onNewRequest: function -> (selectedData, searchedText, selectedDataIndex)

  • location: {lat: latitude, lng: longitude}, default: {lat: 0, lng: 0} see LatLng

  • radius: number, default: 0

  • bounds: object, {sw: southWest, ne: northEast} for LatLngBounds or {south: south, east: east, north: north, west: west} for LatLngBoundsLiteral default: undefined

  • getRef: function -> (ref)

  • types: Array, The types of predictions to be returned. Four types are supported: 'establishment' for businesses, 'geocode' for addresses, '(regions)' for administrative regions and '(cities)' for localities. If nothing is specified, all types are returned., default undefined

  • restrictions: country: Array|String, { country: [ 'fr', 'gb'] | 'gb' } Restricts predictions to the specified country (ISO 3166-1 Alpha-2 country code, case insensitive). E.g., us, br, au. You can provide a single one, or an array of up to 5 country code strings. See ComponentRestrictions

Development

  • npm run build - produces production version
  • npm run dev - produces development version
  • npm test - run the tests

material-ui-places's People

Contributors

jackgardner avatar ydeshayes avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.