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

react-leaflet-map-screenshot

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-leaflet-map-screenshot

Hook for use with react-leaflet to take screenshots of the map

  • 1.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
30
increased by3.45%
Maintainers
1
Weekly downloads
 
Created
Source

react-leaflet-map-screenshot

React Leaflet hook which takes a screenshot of a Leaflet map. Uses html-to-image.

This is influenced by leaflet-simple-map-screenshoter, in fact it takes a couple of things directly from it - waiting for interactions to finish and an array of elements to hide before taking a screenshot.

I had some issues with that addon, although I think it was mainly with dom-to-image which it used. I have created this to simplify further the process of capturing a leaflet map as a screenshot, but also using more recent libraries.

Install

npm install react-leaflet-map-screenshot --save

Usage

import useMapScreenshot from 'react-leaflet-map-screenshot'

const screenshoter = useMapScreenshot()
const screenshot = await screenshoter.takeScreenshot('png')

Keywords

FAQs

Package last updated on 24 Jul 2024

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