Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

@types/leaflet

Package Overview
Dependencies
1
Maintainers
1
Versions
136
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/leaflet

TypeScript definitions for leaflet


Version published
Weekly downloads
528K
decreased by-0.13%
Maintainers
1
Install size
118 kB
Created
Weekly downloads
 

Package description

What is @types/leaflet?

@types/leaflet provides TypeScript type definitions for the Leaflet library, which is a popular open-source JavaScript library for interactive maps. These type definitions help developers use Leaflet in TypeScript projects by providing type safety and autocompletion features.

What are @types/leaflet's main functionalities?

Creating a Map

This feature allows you to create a map and set its initial view to a specific geographical point and zoom level.

const map = L.map('mapId').setView([51.505, -0.09], 13);

Adding Tile Layers

This feature allows you to add tile layers to the map, which are the visual representation of the map itself. In this example, OpenStreetMap tiles are used.

L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 19 }).addTo(map);

Adding Markers

This feature allows you to add markers to the map at specific geographical points.

const marker = L.marker([51.5, -0.09]).addTo(map);

Adding Popups

This feature allows you to bind popups to markers or other map elements, which can display additional information when clicked.

marker.bindPopup('A pretty CSS3 popup.<br> Easily customizable.').openPopup();

Drawing Shapes

This feature allows you to draw shapes like circles, polygons, and rectangles on the map.

const circle = L.circle([51.508, -0.11], { color: 'red', radius: 500 }).addTo(map);

Other packages similar to @types/leaflet

Readme

Source

Installation

npm install --save @types/leaflet

Summary

This package contains type definitions for leaflet (https://github.com/Leaflet/Leaflet).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/leaflet.

Additional Details

  • Last updated: Mon, 22 Apr 2024 14:06:56 GMT
  • Dependencies: @types/geojson

Credits

These definitions were written by Alejandro Sánchez, Arne Schubert, Michael Auer, Roni Karilkar, Vladimir Dashukevich, Henry Thasler, Colin Doig, and Hugo Sales.

FAQs

Last updated on 22 Apr 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc