Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

182
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda