# leaflet-text

> Text support through embedded SVGs

Latest version **0.0.2** (published 2020-11-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install leaflet-text
pnpm add leaflet-text
yarn add leaflet-text
bun add leaflet-text
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2020-11-19 |
| First published | 2020-11-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 13.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Aktionskarten |
| Maintainers | aktionskarten |
| Keywords | leaflet, text |

## Links

- npm: https://www.npmjs.com/package/leaflet-text
- npm.io page: https://npm.io/package/leaflet-text

## Dependencies (1)

- [leaflet](https://npm.io/package/leaflet.md) ^1.7.1

## Alternatives

- [ext-list](https://npm.io/package/ext-list.md) — 6.3M weekly downloads
- [@lexical/selection](https://npm.io/package/@lexical/selection.md) — 3.8M weekly downloads
- [@lexical/text](https://npm.io/package/@lexical/text.md) — 3.6M weekly downloads
- [@lexical/clipboard](https://npm.io/package/@lexical/clipboard.md) — 3.0M weekly downloads
- [@tiptap/extension-mention](https://npm.io/package/@tiptap/extension-mention.md) — 3.0M weekly downloads

## Recent versions

- 0.0.2 (latest) — 2020-11-19
- 0.0.1 — 2020-11-19
- 0.0.0 — 2020-11-19

## README

# Leaflet-Text

This plugin adds support for static texts in Leaflet maps. If you want text that
does not resize on zoom in or out animation but has a fixed size, you may be
interested in this plugin. You need to provide a bounding box where you want to
place your text. Technically rendering is done through embedded texts in a SVG
element, which is then used through `L.SVGOverlay`.

## Demo

See the following examples for demonstration:

* https://aktionskarten.github.io/leaflet-text/simple.html
* https://aktionskarten.github.io/leaflet-text/geojson.html


## Install

```
$ npm install leaflet-text
```


## Quickstart

```javascript
import {svgLabelledTextBox} from 'leaflet-text'

const map = L.map('map').setView([52.5069,13.4298], 15);

//...

map.whenReady(function() {
  const label = 'Headline'
  const text = '12:00 | Alexanderplatz\n„Alle gegen Alle“'
  const bounds = L.latLngBounds([52.50998775888057,13.444347381591799],[52.50611297738362,13.427524566650392]);
  svgLabelledTextBox(bounds, label, text).addTo(map)
});
```

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