# react-places

> npm package you need to find or suggest addresses on the map

Latest version **1.3.2** (published 2023-02-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-places
pnpm add react-places
yarn add react-places
bun add react-places
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.2 |
| Published | 2023-02-16 |
| First published | 2023-02-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 15 |
| Unpacked size | 82.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Denis Lupookov |
| Maintainers | denchik_l |
| Keywords | react, autocomplete, Map, address, find, address, leaflet, react-leaflet, geo |

## Links

- npm: https://www.npmjs.com/package/react-places
- Repository: https://github.com/denislupookov/react-places
- Homepage: https://github.com/denislupookov/react-places#readme
- Issues: https://github.com/denislupookov/react-places/issues
- npm.io page: https://npm.io/package/react-places

## Dependencies (15)

- [react](https://npm.io/package/react.md) ^18.2.0
- [leaflet](https://npm.io/package/leaflet.md) ^1.9.2
- [react-dom](https://npm.io/package/react-dom.md) ^18.2.0
- [web-vitals](https://npm.io/package/web-vitals.md) ^2.1.4
- [@types/jest](https://npm.io/package/@types/jest.md) ^27.5.2
- [@types/node](https://npm.io/package/@types/node.md) ^16.18.3
- [@types/react](https://npm.io/package/@types/react.md) ^18.0.25
- [react-leaflet](https://npm.io/package/react-leaflet.md) ^4.1.0
- [react-scripts](https://npm.io/package/react-scripts.md) 5.0.1
- [@types/react-dom](https://npm.io/package/@types/react-dom.md) ^18.0.8
- [@testing-library/react](https://npm.io/package/@testing-library/react.md) ^13.4.0
- [leaflet-gesture-handling](https://npm.io/package/leaflet-gesture-handling.md) ^1.2.2
- [@testing-library/jest-dom](https://npm.io/package/@testing-library/jest-dom.md) ^5.16.5
- [@testing-library/user-event](https://npm.io/package/@testing-library/user-event.md) ^13.5.0
- [@tomtom-international/web-sdk-maps](https://npm.io/package/@tomtom-international/web-sdk-maps.md) ^6.23.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.3.2 (latest) — 2023-02-16
- 1.3.1 — 2023-02-14
- 1.3.0 — 2023-02-14
- 1.2.3 — 2023-02-14
- 1.2.2 — 2023-02-14
- 1.2.1 — 2023-02-14
- 1.2.0 — 2023-02-14
- 1.0.6 — 2023-02-07
- 1.0.5 — 2023-02-07
- 1.0.4 — 2023-02-07
- 1.0.3 — 2023-02-07
- 1.0.2 — 2023-02-07
- 1.0.1 — 2023-02-07
- 1.0.0 — 2023-02-06

## README

React-places - this is the npm package you need to find or suggest addresses on the map

#### Features

- Find addresses with drop down suggestions
- Map with functionaluty to scroll, zoom, click
- Show addresses on map
- Use Leaflet or TomTom map

#### Installation

To install the stable version

    npm install --save react-places

with Yarn:

    yarn add react-places

#### Usage

Import package as React Component

    import ReactPlaces from 'react-places'

If you want use our css styles

    import "react-places/dist/index.css";

Finally you will have:

    import ReactPlaces from 'react-places'
    import "react-places/dist/index.css";
    
    function App() {
      return (
          <ReactPlaces
            initiallyCoord={[51.505, -0.09]}
          />
      );
    }
    
    export default App;

## Props 

|  Prop | Type  | Required  | Description |
| ------------ | ------------| :------------: | ------------|
| initiallyCoord  |  array | ✅ | Coordinates for map (lat, lng)
|  inputTitle | string  |   | Title for input
|  placeholder | string  |   | Placeholder for input
|  lang | string  |   | Language of map and search text
|  country | string  |   | Country for search params (will show addresses only from this coutry )
|  zoom | number  |   | Zoom for map )
|  mapType | object (IMapType)  |   | Map Package to use ( Leaflet or TomTom )
|  getRefInput | function (data: HTMLInputElement)  |   | Get Ref of input
|  getMapData | function (data: IData)  |   | Returns selected address from map

## Interface 

    interface IMapTypes {
        type: MapsPackages
        api_key?: string
    }
    
    export enum MapsPackages {
        LEAFLET = 0,
        TOMTOM = 1
    }

---
_Source: https://npm.io/package/react-places · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
