mapfish-print icon indicating copy to clipboard operation
mapfish-print copied to clipboard

Center fixed scale does not provide the correct scale with EPSG:3857

Open didier-coignet-dict opened this issue 9 years ago • 3 comments

When using a center and a scale with the projection EPSG:3857 the scale is converted to a geodetic scale instead of keeping the asked for scale. For the feature to match with its real length we need to set "geodetic": true for the scalebar and the label. I think the problem come from the calculation of the bounding box in CenterScaleMapBounds.toReferencedEnvelope() , in which the the discriminant for geodetic bboxes is based on the unit of the projection (degree). But EPSG:3857 is a geodetic projection with a distance unit in meter, the calculated bounding box is then false. Setting the map attribute zoomSnapGeodetic to true or false doesn't change the outcome. You will find an example of this behaviour in https://gist.github.com/didier-coignet-dict/7c9903c0a50b6135848d

didier-coignet-dict avatar Oct 13 '15 13:10 didier-coignet-dict

Is it still the case?

pvalsecc avatar Feb 27 '19 07:02 pvalsecc

I can confirm I have exactly the same issue on my side. Are there any solutions for this?

ipasic avatar Apr 23 '20 09:04 ipasic

Does anyone have any work-arounds for this issue?

I've also encountered it while trying to configure the solution - https://gis.stackexchange.com/q/397526

gavinharriss avatar May 24 '21 09:05 gavinharriss