Comments (4)
Yes, it would be possible to query an image twice the size of the actual window with a detectRetina option. However this would also require some kind of dpi parameter for the WMS. Otherwise this would also result in small and unreadable texts or icons. and i don't think there is a standard for this (i.e. WMS always assumes 96 dpi).
It would be no problem for aerial maps or if you're implementing you own rendering service. I will check this out.
from leaflet.nontiledlayer.
Found there is a parameter &format_options=dpi:xxx for WMS
https://docs.geoserver.org/latest/en/user/services/wms/vendor.html
But this doesn't seem to be used by any WMS i've tested. But i could add the size-doubling as in
https://github.com/Leaflet/Leaflet/blob/master/src/layer/tile/TileLayer.WMS.js#L83-L86
from leaflet.nontiledlayer.
Sorry about the delayed answer.
The size doubling as in TileLayer WMS is probably the solution for the problem and it would be very nice if you could add it to your code.
There would be then a parameter like detectretina?
How ist it solved by the core in leaflet or for example in the qwc2 project? https://github.com/qgis/qwc2-demo-app
from leaflet.nontiledlayer.
OK,
i have added a detectRetina option to the NonTiledLayer base class, you can set it also for the WMS layer. It just doubles the image size if the option is set and the browser is in retina mode. The issue with this option is that the reference dpi for WMS is 90, so labels and icons will be rendered way too small (see pic 1). It's not an issue for dpi invariant imagery, like satellite images (see pic 2). This is why the option is only set for the 'airmass' layer in the demo.
Afaik there is no standard WMS query parameter for dpi, the option i have mentioned in my post above seems to be specific to GeoServer. So you have to detect the 'retina mode' and set a specific url option by yourself, if you have a service that can deliver specific resolutions.
from leaflet.nontiledlayer.
Related Issues (20)
- Pane option HOT 3
- Issue when using EPSG4326 Projection HOT 11
- Version control (npm) HOT 6
- Default pane invalid HOT 2
- Error Handling
- Licence information HOT 2
- NoWrap option not available HOT 2
- bringToBack and bringToFront not working HOT 3
- Blinking in Mozilla Firefox 50.1.0 HOT 6
- Vaadin Plugin HOT 3
- WMS goes to upper left corner when zooming in HOT 7
- Replace L.Mixin.Events with L.Evented HOT 3
- Support the 'loading' event HOT 1
- WMS getImageUrl Question HOT 2
- Add TypeScript type definitions HOT 12
- Different width and height of map and NonTileyLayer HOT 1
- GetFeatureInfo HOT 3
- Event handler for end of process HOT 3
- Add your plugin to Leaflet plugins site
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.nontiledlayer.