All Projects → rameshsyn → react-location-picker

rameshsyn / react-location-picker

Licence: MIT License
A react component to pick a location using google maps

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to react-location-picker

QuteMap
Maps using Qt WebEngine and Qt WebChannel using PyQt5/PySide2
Stars: ✭ 27 (-30.77%)
Mutual labels:  google-maps
openui5-googlemaps
Openui5 Googlemaps library
Stars: ✭ 58 (+48.72%)
Mutual labels:  google-maps
google-maps-services-php
PHP client library(SDK) for Google Maps API Web Services
Stars: ✭ 50 (+28.21%)
Mutual labels:  google-maps
Dual-color-Polyline-Animation
This library will help to show the polyline in dual color similar as Uber.
Stars: ✭ 73 (+87.18%)
Mutual labels:  google-maps
Route-Direction-in-AR
Adding the Feature "Real World Path Direction" by tapping on Map. GoogleMap will give us the direction to that location from user location then click on "ARView" & you will get the real-world path direction. Also added "Reachability" for finding path in Google map. -- Also added .mlmodel for car-detection. Initially trained the model using Convo…
Stars: ✭ 32 (-17.95%)
Mutual labels:  google-maps
google-maps-statistics
Visualizing Geographic Statistical Data with Google Maps
Stars: ✭ 32 (-17.95%)
Mutual labels:  google-maps
LocationFetcher
Easy Location fetching for Android apps.
Stars: ✭ 33 (-15.38%)
Mutual labels:  location-picker
google-maps-at-88-mph
Google Maps keeps old satellite imagery around for a while – this tool collects what's available for a user-specified region in the form of a GIF.
Stars: ✭ 93 (+138.46%)
Mutual labels:  google-maps
android-near-by-places
Near by places using google map api
Stars: ✭ 24 (-38.46%)
Mutual labels:  google-maps
googlemaps-services
📍Ruby client library for Google Maps API Web Services
Stars: ✭ 14 (-64.1%)
Mutual labels:  google-maps
mapus
A map tool with real-time collaboration 🗺️
Stars: ✭ 2,687 (+6789.74%)
Mutual labels:  google-maps
google-streetview-images
Pull google streetview panoramic images along a route.
Stars: ✭ 45 (+15.38%)
Mutual labels:  google-maps
SimplePlacePicker
Android place picker module for searching and selecting a location on google maps
Stars: ✭ 42 (+7.69%)
Mutual labels:  google-maps
HealthCare-Scan-Nearby-Hospital-Locations
I developed this android application to help beginner developers to know how to use Google Maps API and how to convert JSON data into Java Object.
Stars: ✭ 23 (-41.03%)
Mutual labels:  google-maps
scalajs-google-maps
Type-safe and Scala-friendly library over Google Maps.
Stars: ✭ 21 (-46.15%)
Mutual labels:  google-maps
HelpOff
Providing help via offline system : Runner-Up at NMIMS Hackathon 2018
Stars: ✭ 20 (-48.72%)
Mutual labels:  google-maps
carto-react
CARTO for React packages
Stars: ✭ 17 (-56.41%)
Mutual labels:  google-maps
Google-Maps-API-with-PHP-MySQL
A Snippet of code to help you in Google Maps API. In this Script PHP Array and MySQL is used to store Latitude and Longitude. This script is made for those who needs a Map with Multiple Markers which changes it's Position Dynamically. In other words, This is made for people who need t a Map solution for Uber Like Application
Stars: ✭ 50 (+28.21%)
Mutual labels:  google-maps
carto-react-template
CARTO for React. The best way to develop Location Intelligence (LI) Apps usign CARTO platform and React
Stars: ✭ 24 (-38.46%)
Mutual labels:  google-maps
LocationAware
Set alarms for location in map
Stars: ✭ 34 (-12.82%)
Mutual labels:  google-maps

react-location-picker

A react component to pick a location using google maps.

Demo

Installation

npm install react-location-picker --save

or

yarn add react-location-picker --save

You need to include google map script in your page.
<script src="https://maps.googleapis.com/maps/api/js?key=<INSERT_API_KEY_HERE>&v=3.exp&libraries=geometry,drawing,places"></script>

Example

import React, { Component } from 'react';
import LocationPicker from 'react-location-picker';

/* Default position */
const defaultPosition = {
  lat: 27.9878,
  lng: 86.9250
};


class LocationPickerExample extends Component {
  constructor (props) {
    super(props);

    this.state = {
      address: "Kala Pattar Ascent Trail, Khumjung 56000, Nepal",
      position: {
         lat: 0,
         lng: 0
      }
    };

    // Bind
    this.handleLocationChange = this.handleLocationChange.bind(this);
  }

  handleLocationChange ({ position, address, places }) {

    // Set new location
    this.setState({ position, address });
  }

  render () {
    return (
      <div>
        <h1>{this.state.address}</h1>
        <div>
          <LocationPicker
            containerElement={ <div style={ {height: '100%'} } /> }
            mapElement={ <div style={ {height: '400px'} } /> }
            defaultPosition={defaultPosition}
            onChange={this.handleLocationChange}
          />
        </div>
      </div>
    )
  }
}

Usage

LocationPicker properties

Property Type Description
containerElement node required, A container element for map element
mapElement node required, A map element
onChange function required, A callback which gets called on every map marker position change, it is passed with one argument of type object which has location information.
defaultPosition object required, A default position for map center.
zoom number optional, Map zoom level
radius number optional, Circle radius in meter. or Pass -1 to hide it.
circleOptions object optional, https://developers.google.com/maps/documentation/javascript/3.exp/reference#CircleOptions

Development

For demo, clone this repo and run

Install all dependencies
yarn

Start
yarn start

Open http://localhost:8080 in your browser.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].