V-leaflet Coordinate reference systems problem.

I’m using v-leaflet (0.61) to visualize some layers over a map.
Clicking on the map, I create a wms query to geoserver.
The query needs some parameters and one of them is the bbox.
I suppose, by default, that the bbox, returned by the map, is in CRS.Simple, a mysterious coordinate system of leaflet.

if I set EPSG3857, both on the map and the layers, it returns me something like this as bounding box :

Bound:6.0919189453125, 45.11617660357484, 11.134643554687498, 46.50217348354072

if I set EPSG4326, with the same view :

Bound:6.0919189453125, 44.81597900390625, 11.1346435546875, 46.80450439453125

Seems that only the latitude values have been changed.

I’ve tryed also to use JTSTool (jts-topology-suite) to convert from EPSG3857 to EPSG4326 and the values are :

bbox=4.0528551003362907E-4,5.4724638981914947E-5,4.1773613184440224E-4,1.0002420488398699E-4

It sounds so strange…

Can someone help me to understand the CRS used to define the bbox ? Or any way to transform them ?

This is the code, I used to transform from a CRS to another.

                CoordinateReferenceSystem sourceCRS = CRS.decode("EPSG:4326");
                CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:3857");
                MathTransform transform = CRS.findMathTransform(sourceCRS, targetCRS, false);
                GeometryFactory geometryFactory = new GeometryFactory(new PrecisionModel(), 4326);
                com.vividsolutions.jts.geom.Point point = geometryFactory.createPoint(new Coordinate(bbb.getSouthWestLon(),bbb.getSouthWestLat() ));
                com.vividsolutions.jts.geom.Point point2 = geometryFactory.createPoint(new Coordinate(bbb.getNorthEastLon(),bbb.getNorthEastLat() ));
                com.vividsolutions.jts.geom.Point targetPoint = (com.vividsolutions.jts.geom.Point) JTS.transform(point, transform);
                com.vividsolutions.jts.geom.Point targetPoint2 = (com.vividsolutions.jts.geom.Point) JTS.transform(point2, transform);

Hi,

What are you putting to your map (layers, objects)? I think CRS.Simple in Leaflet is not in use unless you explicitly say so and that is ment for raster images without any actual projection. Most probably the actual map projection is “google mercator” 900913/3857 and you are commanding the map (and vector stuff) in 4326 (aka GPS coordinates).

cheers,
matti