Skip to content

Turns polygons to placemarkers as the map zooms out

Jonathan Cooper requested to merge EMC-120-map-polygon-scaling into develop

When viewing documents with a single polygon feature, zooming out the map will replace the polygon with placemarker to prevent the polygon being hard or impossible to see as it is so small compared to the background. This placemarker is simply the centre of the polygon's bounding box.

This implementation only affects geojson features that are of type 'polygon', so points features are not affected.

To see the polygon turn to a point, open a document with a polygon feature, press the zoom out button 4 times - on the 4th one a placemarker will replace the polygon. Zoom in and the polygon re-appears. This gives a predictable and intuitive interaction that is related to the size of the polygon, rather than a zoom threshold that is applied independently across any sized polygon.

Reviewer's tip: do this merge request after !608 (merged) - since this has better testing.

Closes EMC-120

Merge request reports

Loading