Git Product home page Git Product logo

Comments (4)

oliverheilig avatar oliverheilig commented on June 7, 2024

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.

oliverheilig avatar oliverheilig commented on June 7, 2024

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.

Poldy1705 avatar Poldy1705 commented on June 7, 2024

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.

oliverheilig avatar oliverheilig commented on June 7, 2024

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.

image

image

from leaflet.nontiledlayer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.