Comments (4)
Hey Peter.
This is an interesting catch. I will check it out and let you know.
from leaflet.browser.print.
Hey Peter.
This is an interesting catch. I will check it out and let you know.
Thanks, so we noticed that, at least with Google and presumably OpenStreetMaps, it doesn't load tiles for satellite and hybrid view past zoom level 20. For roadmap or streetview as its called, its level 22. At level 20, it starts scaling the tiles that are loaded, but when rebuilding the map to print, it is unable to load the tiles at the specified zoom level beyond 20. I am assuming the openstreet maps has a similar limitation since it was doing the same thing in your demo. For now, our workaround was to manually set the newMapOption.maxZoom variable to 20. This allows us to still allow a higher level of zoom for our users on the map, but when they go to print, it will default to level 20 for printing purposes, if their native zoom is higher than 20, so those satellite tiles will actually get loaded in.
As you can see, around line 510 is where we had to set this hard coded instead of using the this._map.getMaxZoom so that the tiles would actually get loaded.
It would ne nice, if we could load the tiles to level 20 so they actually get loaded, and then scale it to the higher zoom to simulate what the user sees on the map if possible. If not, it may just be a limitation of the tile provider that can't be worked around. We thought about just taking a screenshot as well and printing that for the higher zoom levels. So that may be an option to get around this limitation.
I know this might be an edge case regarding printing, but we do GIS stuff with the map, and clients really want to be able to print as close as possible to show their assets hence how we came across this bug. We've been using this plugin for some time, and really appreciate the hard work you put into creating it. It's awesome and I'm surprised we are only just now noticing this.
from leaflet.browser.print.
Hey Peter.
I'm not sure about your actual tiles providers that you are using (each tile server has it's own zoom levels, based on need and infrastracture to support it) therefore not sure what is your best approach to go here.
Right now I have fixed the problem, now maxZoom will be taken from the printLayer or from the map itself. At least it fixed the use case that can be reproduced in my demo.
You can check it out, and If it's not sufficient for you, please share your demo(jsbin or something else) with reproducible issue so I can take a look.
from leaflet.browser.print.
Thanks, I haven't had a chance to mess with this yet. We are still using our fix right now of just setting the max zoom to 20 and it is working fine for us. I will take a look at it soon though and see if it fixes the issue for us by default. Thanks again for the speedy response and I will let you know how it goes!
from leaflet.browser.print.
Related Issues (20)
- L.AwesomeMarkers issue HOT 9
- Printing polygons with custom fill patterns HOT 3
- Error in documentation
- resize button heigth HOT 1
- work with React + TypeScript HOT 1
- Add dynamic contents(add new page if contents are huge), circle not printing. HOT 1
- ImageOverlay dont work
- JS error when manualMode is true HOT 1
- Printing two Leaflet instances (One only visible in printing) HOT 1
- Text of Leaflet Geoman Textlayer is not displayed HOT 2
- Offset with leaflet map position HOT 1
- Legend disappear when print ends HOT 1
- When defining custom printFunction, document.querySelector('.grid-print-container') does not include the Leaflet layers, only the container HOT 1
- package.json missing a main key HOT 2
- [Geotiff] Geotiff file on print HOT 5
- Fitting an Image as Watermark on PrintPage HOT 2
- Map breaks into two pages in smaller screens HOT 6
- Esri Vector Tile Printing? HOT 1
- Map Moves After Print Action HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leaflet.browser.print.