0.0.2 • Published 5 years ago

react-native-map-picker v0.0.2

Weekly downloads
23
License
MIT
Repository
github
Last release
5 years ago

react-native-map-picker

Simple location picker on Google Map.

Installation

Download an install the library

npm install react-native-map-picker --save

Or if you are using yarn

yarn add react-native-map-picker

This library depends upon a native libraries

  1. react-native-maps

Make sure to install them before you install react-native-location-picker

Example

import React from 'react';
import MapPicker from "react-native-map-picker";
import {View} from "react-native";


export default class SelectLocationScreen extends React.Component {
  state = {

  };

  render() {
    return(
      <View style={{flex: 1}}>
        <MapPicker
          initialCoordinate={{
            latitude: 37.78825,
            longitude: -122.4324,
          }}
          onLocationSelect={({latitude, longitude})=>console.log(longitude)}
        />
      </View>
    );
  }
}

Supported Props

PropTypeRequired
initialLocationobjectNo
buttonTextstringNo
buttonStyleobjectNo
textStyleobjectNo
onLocationSelectfunctionNo