Skip to content

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

@didier-coignet-dict

Description

@didier-coignet-dict

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions