Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

177
Vistas
leafletjs easyPrint Plugin Tainted canvases may not be exported

I'd like to use the easyPrint leaflet plugin (from here: http://rowanwins.github.io/leaflet-easyPrint/) to export a map to image. All says this is best and will work but I have to struggle with following error message:

Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.

Seems I'm the only one with this problem. My code is pretty straight forward like the examples.

var map = L.map('map', {
        center: bounds.getCenter(),
        minZoom: current_map.min_zoom,
        maxZoom: current_map.max_zoom,
        maxBounds: bounds,
        maxBoundsViscosity: 0.75,
    }
);

Tiles from https://tile.openstreetmap.org

Printing like this:

var printer = L.easyPrint({
    tileLayer: tiles,
    sizeModes: ['Current', 'A4Landscape', 'A4Portrait'],
    filename: 'myMap',
    exportOnly: true,
    hideControlContainer: true
}).addTo(map);

Is there anyone with a little help?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda