npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@carloschar/vue-leaflet-print

v1.0.0

Published

Control de impresión/exportación para Vue-Leaflet (Vue 3): print nativo, PNG via html-to-image y PNG via leaflet-image.

Readme

@carloschar/vue-leaflet-print

Control de impresión/exportación para Leaflet en Vue 3 (Vue-Leaflet).
Incluye 3 modos: print nativo, PNG por html-to-image, PNG por leaflet-image. Asimismo, el botón es personalizable con html (se puede usar fontawesome por ejemplo)

npm version CI

Instalación

pnpm add @carloschar/vue-leaflet-print
pnpm add vue leaflet @vue-leaflet/vue-leaflet

Uso rápido

<!-- App.vue -->
<template>
  <l-map
    ref="map"
    :zoom="13"
    :center="[-34.6037, -58.3816]"
    style="height:80vh"
    @ready="mapaListo"
  >
    <l-tile-layer
      url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
      :options="{ crossOrigin: true }"
      attribution="&copy; OSM contributors"
    />
    <!-- Solo rendereamos el control cuando ya tenemos el mapa -->
    <LPrintControl v-if="instanciaMapa" :map="instanciaMapa" mode="image" filename="demo-mapa.png" />
  </l-map>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import 'leaflet/dist/leaflet.css'
import { LMap, LTileLayer, LControl } from '@vue-leaflet/vue-leaflet'
import { LPrintControl } from '@carloschar/vue-leaflet-print'


const instanciaMapa = ref<any>(null);
const map = ref<any>(null);
const mapaListo = () => {
  instanciaMapa.value = map.value.leafletObject;
  console.log('Mapa listo:', instanciaMapa.value)
  }

</script>

Props

| Prop | Tipo | Default | Descripción | | -------------------- | ---------------------------------------------------------- | -------------------------------------------- | ---------------------------------------------------- | | map | L.Map | — (requerido) | Instancia real de Leaflet (@ready de Vue-Leaflet). | | position | "topleft" \| "topright" \| "bottomleft" \| "bottomright" | "topright" | Posición del control. | | mode | "print" \| "image" \| "image-leaflet" | "image" | Estrategia de salida. | | filename | string | "map.png" | Nombre de archivo para PNG. | | imageScale | number | 2 | Multiplica devicePixelRatio en modo image. | | includeAttribution | boolean | true | Intenta incluir atribución en la imagen. | | hideSelectors | string[] | [".leaflet-control-container",".no-print"] | Elementos a ocultar durante la captura. | | title | string | "Imprimir / Exportar" | title del botón (tooltip). | | label | string | "" | Texto visible del botón (tiene prioridad). | | iconHtml | string | "🖨️" | HTML del ícono (se usa si label es vacío). | | ariaLabel | string | derivado de label/title | Accesibilidad (lector de pantalla). |

Notas importantes

CORS de tiles: para mode="image" (html-to-image) el tile server debe permitir crossOrigin. En LTileLayer añadir :options="{ crossOrigin: true }".

image-leaflet: más robusto para rasterizar el mapa (puede ignorar overlays DOM).

Accesibilidad: el botón soporta Enter y Espacio, aria-label y title.

SSR: Solo cliente.

Eventos

El componente emite: start, success, error(err).