MercatorFWB = function (size) {
const proj = d3.geoProjection(function (x, y) {
const deg2rad = (x) => (Math.PI * x) / 180;
const bxl_scale = 3.5;
const bxl = {
min_x: deg2rad(4.236603),
min_y: deg2rad(50.761871),
max_x: deg2rad(4.505768),
max_y: deg2rad(50.918835),
x: deg2rad(4.371357),
y: deg2rad(50.840311)
};
if (x > bxl.min_x && x < bxl.max_x && y > bxl.min_y && y < bxl.max_y) {
x = (x - bxl.x) * bxl_scale + bxl.x - 0.013;
y = (y - bxl.y) * bxl_scale + bxl.y - 0.018;
}
return [x, Math.log(Math.tan(Math.PI / 4 + y / 2))];
});
if (size) {
return proj.fitSize(size, {
type: "Feature",
geometry: {
type: "LineString",
coordinates: [
[2.76, 49.48],
[6.44, 50.81]
]
}
});
}
return proj;
}