Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

174
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!