I'm currently trying to display a dataset on a webapp using Leaflet. All the dataset is projected into French projection Lambert II ESPG 27572.
Instead of converting coordinates, I'm trying to setup Leaflet with this ESPG:27572. I gave it a first try using proj4leaflet :
var crs = new L.Proj.CRS('ESPG:27572',
'+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs',
{
resolutions: [
8192, 4096, 2048, 1024, 512, 256, 128,
64, 32, 16, 8, 4, 2, 1, 0.5
],
origin: [0, 0],
bounds: L.bounds([5168.43, 1730142.53], [1013247.20, 2698564.20])
}),
map = new L.Map('map', {
crs: crs,
});
L.tileLayer('https://api.geosition.com/tile/osm-bright-3006/{z}/{x}/{y}.png', {
maxZoom: 14,
minZoom: 0,
attribution: 'Map data © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap contributors</a>, Imagery © <a href="http://www.kartena.se/">Kartena</a>'
}).addTo(map);
map.setView([0,0], 2);
It returns a white map with no console message. Commenting the bounds line "did the trick", except the map is centered on South Africa instead of France.
//bounds: L.bounds([5168.43, 1730142.53], [1013247.20, 2698564.20])
I think that I'm not far from the solution, as when I insert a marker which is supposed to be in France :
L.marker([656513, 2626522]).addTo(map);
I'm getting the marker, in the sea near South Africa, but correctly positionned if France was over South Africa.