npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-place-picker

v3.0.8

Published

Pick place with single click

Downloads

536

Readme

Features

  • [x] 🎨 Theme customization.
  • [x] 📱 UI written natively.
  • [x] 🗺️ Location reverse-geocoding (coordinate -> address).
  • [x] 🔍 Searchable (users can search for location).
  • [x] 📍 Device location.
  • [x] ⚙️ Fully configurable.
  • [x] 🏗️ Supporting Turbo Modules (New Arch) with backward compatibility.
  • [x] ⚡ Renders on top of the app (Blazing Fast).
  • [x] 📐 Well typed.
  • [x] 📦 Significantly small package.
  • [x] 🔗 No peer dependencies except React and React-Native [1].

How is it working?

This plugin is built only by create native page UIViewController for iOS or Activity for Android. and present the page in front of React Native Application without any special dependencies just native code

Installation

npm install react-native-place-picker
# or
yarn add react-native-place-picker
# or
pnpm add react-native-place-picker
# or
bun add react-native-place-picker

Expo

  • You need to add expo-dev-client and run expo run:ios or expo run:android

Info Expo managed app not supported 🚧

iOS

  • If you want to enable user current location button you have to add this to your Info.plist
<key>NSLocationWhenInUseUsageDescription</key>
<string>YOUR_PURPOSE_HERE</string>

Android ⚠️

  • Add to your AndroidManifest.xml you Google Map API Key or your application will crash
<meta-data
   android:name="com.google.android.geo.API_KEY"
   android:value="YOUR_KEY" />

Request

import { pickPlace } from "react-native-place-picker";

pickPlace({
  enableUserLocation: true,
  enableGeocoding: true,
  color: "#FF00FF",
  //...etc
})
  .then(console.log)
  .catch(console.log);

// or

pickPlace().then(console.log).catch(console.log);

Result


{
    /**
     * @description Selected coordinate.
     */
    coordinate: PlacePickerCoordinate;
    /**
     * @description Geocoded address for selected location.
     * @if `enableGeocoding: true`
     */
    address?: PlacePickerAddress;
    /**
     * @description Did cancel the place picker window without selecting.
     */
    didCancel: boolean;
}

PlacePickerOptions

| Property | Type | Description | Default | | -------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------- | | presentationStyle | PlacePickerPresentationStyle | string | Presentation style of the place picker window. iOS only | 'fullscreen' | | title | string | The title of the place picker window. | 'Choose Place' | | searchPlaceholder | string | Placeholder for the search bar in the place picker window. | 'Search...' | | color | string | Primary color of the theme (map pin, shadow, etc.). | '#FF0000' | | contrastColor | string | Contrast color for the primary color. | '#FFFFFF' | | locale | string | Locale for the returned address. | 'en-US' | | initialCoordinates | PlacePickerCoordinate | Initial map position. | { latitude: 25.2048, longitude: 55.2708 } | | enableGeocoding | boolean | geocoding for the selected address. | true | | enableSearch | boolean | search bar for searching specific positions. | true | | enableUserLocation | boolean | current user position button. Requires setup. | true | | enableLargeTitle | boolean | large navigation bar title of the UIViewController. iOS only | true | | rejectOnCancel | boolean | Reject and return nothing if the user dismisses the window without selecting a place. | true |

PlacePickerPresentationStyle

| Enum Value | Description | | ------------ | -------------------------------------- | | modal | Presentation style as a modal window. | | fullscreen | Presentation style in fullscreen mode. |

PlacePickerAddress

| Property | Type | Description | | ------------ | -------- | --------------------------- | | name | string | Name of the location. | | streetName | string | Street name of the address. | | city | string | City of the address. | | state | string | State of the address. | | zipCode | string | Zip code of the address. | | country | string | Country of the address. |

PlacePickerCoordinate

| Property | Type | Description | | ----------- | -------- | -------------------------- | | latitude | number | Latitude of the location. | | longitude | number | Longitude of the location. |

PlacePickerResults

| Property | Type | Description | | ------------ | ----------------------- | -------------------------------------------------------------- | | coordinate | PlacePickerCoordinate | Selected coordinate. | | address | PlacePickerAddress | Geocoded address for selected location (if enableGeocoding). | | didCancel | boolean | Indicates if the place picker was canceled without selecting. |

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT