@20tab/react-leaflet-resetview 中文文档教程
react-leaflet-resetview
用于重置地图视图的 react-leaflet 控件
Installation
您可以使用 NPM 安装 react-leaflet-resetview
:
npm i @20tab/react-leaflet-resetview
或者使用 YARN:
yarn add @20tab/react-leaflet-resetview
Usage
```typescript jsx 从“react-leaflet”导入 MapContainer; 从“@20tab/react-leaflet-resetview”导入 ResetViewControl;
const 映射 = () => { 返回 (
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. |
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 (
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. |