https://github.com/20tab/react-leaflet-resetview
react-leaflet control for resetting the map view
https://github.com/20tab/react-leaflet-resetview
leaflet leaflet-control leafletjs react react-leaflet react-leaflet-control react-leaflet-resetview react-leaflet-v3 react-leaflet-v4
Last synced: 10 months ago
JSON representation
react-leaflet control for resetting the map view
- Host: GitHub
- URL: https://github.com/20tab/react-leaflet-resetview
- Owner: 20tab
- License: mit
- Created: 2021-11-18T10:44:35.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-06-07T10:49:40.000Z (over 3 years ago)
- Last Synced: 2025-04-13T16:12:40.834Z (10 months ago)
- Topics: leaflet, leaflet-control, leafletjs, react, react-leaflet, react-leaflet-control, react-leaflet-resetview, react-leaflet-v3, react-leaflet-v4
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@20tab/react-leaflet-resetview
- Size: 165 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# react-leaflet-resetview
> react-leaflet control for resetting the map view
## Installation
You can install `react-leaflet-resetview` with NPM:
```bash
npm i @20tab/react-leaflet-resetview
```
Or with YARN:
```bash
yarn add @20tab/react-leaflet-resetview
```
## Usage
```typescript jsx
import MapContainer from "react-leaflet";
import ResetViewControl from '@20tab/react-leaflet-resetview';
const Map = () => {
return (
);
};
```
## Props
| Name | Type | Default | Description |
|------------|----------------------------------------------------------------------|--------------|------------------------------------|
| position? | [ControlOptions](https://leafletjs.com/reference.html#control-position) | "topleft" | The position of the control |
| title? | string | "Reset map view" | The control title. |
| icon? | string | "\u2610" | The control icon. Can be either a path for `url()` or a unicode character. |