Git Product home page Git Product logo

Comments (2)

oliverheilig avatar oliverheilig commented on May 28, 2024

Hi,

i've verified the behaviour, and the implementation is correct. It's the same implemetation as in L.TileLayer.WMS. However the result is not what you may expect:

  1. The default map projection/crs for Leaflet is "Google Mercator" (EPSG:3857, image 1). All WMS layers are queried with this crs then, the code reprojects the map-bounds to this crs, and the WMS must support EPSG:3857.
  2. You can set the map crs to EPSG.4326 with (image 2)
    var map = L.map('map', { crs:L.CRS.EPSG4326 // test for Plate Carree projection });
    This means the map uses the 'EPSG:4326-projection' then, wich means all layers also must support EPSG:4326.
  3. You can set only the crs of the WMS-layer to EPSG:4326 and leave the map in Google Mecator (image 3). Then the bounds are not reprojected, it's effectively the same as in your code. But the result isn't really accurate. If the projection of the WMS image is different than the projection of the map, all individual pixels should be transformed, like here https://www.jasondavies.com/maps/raster/ . Leaflet just overlays the resulting image.

So the WMS layer works as expected, i've tested it with the meteosat WMS in the sample. But you should check if you can make your WMS "Google-Mercator" aware, because Leaflet cannot mash-up images from different projections accurately.

Google Mercator
image
Equirectangular
image
Google Mercator with Equirectangular Overlay
image

from leaflet.nontiledlayer.

k-taylor avatar k-taylor commented on May 28, 2024

Thank you so much for your quick reply!

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.