martindholmes / BreezeMap

BreezeMap is a project to create a simple user interface for interactive map and facsimile editing based on TEI XML and OpenLayers 4+.
MIT License
11 stars 3 forks source link

Feature request: pan and zoom toggle #37

Closed gtnewton closed 3 years ago

gtnewton commented 3 years ago

For projects that cover very large areas AND have timelines, panning and zooming during timeline playback can create a confusing experience. A config toggle for each of pan and zoom that allows devs to turn off the behaviour would help to mitigate this.

martindholmes commented 3 years ago

@gtnewton I've implemented two option switches that you can pass to the hol.VectorLayer instance at start-up to control pan and zoom:

timelinePan: true|false timelineZoom: true|false

Both are true by default. This work is in the branch issue_37_panzoom. Could you check out the branch and see if these are working as you need them to? The one oddity is that if there's no panning, there's obviously no point in zooming, because you'd most likely be zooming into a location which is irrelevant to what just happened on the timeline, so I've left it so that if they're both false, nothing happens; if they're both true, you get the normal behaviour; and if timelineZoom is false and timelinePan is true, the map will center on the middle of the visible features without changing the zoom. Hope that works for you.

martindholmes commented 3 years ago

This is now implemented with a single option timelinePanZoom: false|true, with default false. Closing the ticket.