Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPSG:3857 doesn't render the map correctly. #7

Closed
edigiacomo opened this issue Sep 16, 2019 · 6 comments
Closed

EPSG:3857 doesn't render the map correctly. #7

edigiacomo opened this issue Sep 16, 2019 · 6 comments

Comments

@edigiacomo
Copy link
Contributor

With EPSG:4326 the map is not rendered correctly. I think that the bounding box should be converted to lat/lon before passing it to macro.mmap. I'll file a PR soon to show a possible fix using pyproj.

@sylvielamythepaut
Copy link
Contributor

sylvielamythepaut commented Sep 16, 2019

I am not familiar with leaflet, then I had difficulty to try the projection .. Magics can understand projection coordinates .. I think I have just forgotten to set it in case of 3857 .. I will check that, not need for pyproj yet ! ( just trying to keep the dependancies minimum)

@sylvielamythepaut
Copy link
Contributor

Can you show me how you set the projection in leaflet ? I am not sure I got it right !

@edigiacomo
Copy link
Contributor Author

In this patch you can see how to explicitly set the projection in leaflet:

diff --git a/skinnywms/templates/leaflet_demo.html b/skinnywms/templates/leaflet_demo.html
index 0c22de5..f6f02b8 100644
--- a/skinnywms/templates/leaflet_demo.html
+++ b/skinnywms/templates/leaflet_demo.html
@@ -29,7 +29,7 @@
       let mymap = L.map('mapid', {
         center: [0, 0],
         zoom: 2,
-        crs: L.CRS.EPSG4326,
+        crs: L.CRS.EPSG3857
       });
 
       let background = L.tileLayer.wms('/wms?', {
@@ -37,7 +37,8 @@
           format: 'image/png',
           transparent: 'TRUE',
           attribution: '',
-          version: '1.3.0'
+          crs: L.CRS.EPSG3857,
+          version: '1.1.1'
         }).addTo(mymap);
 
       let layers = {};
@@ -47,7 +48,8 @@
           format: 'image/png',
           transparent: 'TRUE',
           attribution: '',
-          version: '1.3.0'
+          crs: L.CRS.EPSG3857,
+          version: '1.1.1'
         });
       });

@sylvielamythepaut
Copy link
Contributor

Great, Thanks..

I will try now ..
Hoping to fix it without to have to use pyproj .

I think I will also try to improve the leaflet demo then we can do more manual tests with projection, and version .

Sylvie

@sylvielamythepaut
Copy link
Contributor

Should be OK now ..

@edigiacomo
Copy link
Contributor Author

Thank you, I tested it works fine now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants