Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@20tab/react-leaflet-resetview

20tab651MIT1.1.0TypeScript support: included

react-leaflet control for resetting the map view

react, leaflet, react-leaflet, react-leaflet-v3, react-leaflet-v4, react-leaflet-control, react-leaflet-resetview

readme

react-leaflet-resetview

react-leaflet control for resetting the map view

Installation

You can install react-leaflet-resetview with NPM:

npm i @20tab/react-leaflet-resetview

Or with YARN:

yarn add @20tab/react-leaflet-resetview

Usage

`typescript jsx import MapContainer from "react-leaflet"; import ResetViewControl from '@20tab/react-leaflet-resetview';

const Map = () => { return ( <MapContainer zoom={5} center={[-96.8716348, 32.8205866]}> <ResetViewControl title="Reset view" icon="url(/some/relative/path.png)" /> </MapContainer> ); }; `

Props

Name Type Default Description
position? ControlOptions "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.

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

1.1.0 - 2022-04-22

Changed

  • React v18, Leaflet v1.8, and react-leaflet v4.0 are now required as peer dependencies.