rowanwins / leaflet-easyPrint

A leaflet plugin which adds an icon to print the map - Demo @ http://rowanwins.github.io/leaflet-easyPrint/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Print only gray background

geo903 opened this issue · comments

Strange behavior when using Yandex maps, when using OpenStreetMap everything is fine.

var tiles=L.tileLayer( 'http://vec{s}.maps.yandex.net/tiles?l=map&v=4.55.2&z={z}&x={x}&y={y}&scale=2&lang=ru_RU', { subdomains: ['01', '02', '03', '04'], attribution: '<a http="yandex.ru" target="_blank">Яндекс</a>' } ).addTo(map);

var printer = L.easyPrint({ tileLayer: tiles, sizeModes: ['CurrentSize','A4Portrait'], filename: 'test_file', exportOnly: true, hideControlContainer:true, tileWait: 2000 }).addTo(map);

5ba9f6db79f67.pdf

Here part of the map is still displayed, but this is one file of 10 tests:

5ba9fcf53281d.pdf

Unfortunately 95% chance that this is due to CORS errors from the tile source. Someone did propose a fix here so that might be an option...