planmap-eu / storymaps

Story-maps app
https://stories.planmap.eu
GNU General Public License v3.0
1 stars 0 forks source link

how to deal with boundinb box of initial stop view #4

Closed aprossi closed 5 years ago

aprossi commented 5 years ago

currently stop view are sized with [xmin, ymin, xmax, ymax] as per v2 data model. since screens/viewports cna be different, perhaps we can either fix them with a certain aspect ration (now they are just rough and calculated over a screen) or set the initial aspect ratio form the GUI.

chbrandt commented 5 years ago

Leaflet will automatically compute/adjust the aspect ratio to contain the requested bounding-box.

When the stop view is set -- i.e., when there is a bounding-box, [xmin, ymin, xmax, ymax], defined -- we use Leaflet's "fit bounds" methods to fit the given bounding-box into its view. During the "fit bounds" Leaflet computes the current viewport and adjust its resolution to contain the requested bounding-box; In other words, we don't really control the exact corners of Leaflet map, but we are sure to have what we requested ([{x,y}{min,max}]) inside the viewport.

aprossi commented 5 years ago

ok, that seems to solve it, so we can close