Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 886 Bytes

README.md

File metadata and controls

45 lines (31 loc) · 886 Bytes

React-Native-LocalSearch

React Native Module for IOS MapKit Local Search

Prerequisites

This module requires react-native-maps as a peer dependency. Run the following first if it is not an existing dependency.

npm install --save react-native-maps

Install

npm install --save react-native-localsearch

After install, also run pod install for auto linking.

cd ios/ && pod install

Usage

import { RNLocalSearch } from 'react-native-localsearch';

RNLocalSearch.searchForLocations(searchString, region, callback(err, resp) => {});

Example

import { RNLocalSearch } from 'react-native-localsearch';

const region = {
	latitude: 30.2669444,
	longitude: -97.7427778,
	latitudeDelta: 0.1,
	longitudeDelta: 0.1
};

RNLocalSearch.searchForLocations('restaurants', region, callback(err, resp) => {});