Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

leaflet-textbox

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leaflet-textbox

Adds a text box layer to the SVG renderer.

  • 0.1.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

Leaflet.TextBox

Add a text box to the leaflet map using the SVG renderer.

Leaflet version

The example is develped against Leaflet 1.0.

Usage

The library works by adding a setText method to the Rectangle layers.

Basic example:

// Standard leaflet map setup
var map = L.map('map').setView([50.842941, -0.131312], 13);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
    attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);

// Add the rectangle and set the text
var bounds = [[50.832941, -0.111312], [50.842941, -0.141312]];
var rectangle = L.rectangle(bounds, {color: "#ff7800", weight: 4})
rectangle.addTo(map);
rectangle.setText("Hello. This is a really long peice of text which should span multiple lines. It should not split words or overflow the box.")

Demo

See the example in example/index.html.

Changelog

0.1.0

Initial release

Licence

MIT

FAQs

Package last updated on 08 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc