mirror of
https://github.com/l5yth/potato-mesh.git
synced 2026-07-04 08:51:51 +02:00
Reduce auto-fit padding and increase default zoom (#315)
This commit is contained in:
@@ -288,9 +288,9 @@ export function initializeApp(config) {
|
||||
const MAX_NODE_DISTANCE_KM = Number.isFinite(config.maxNodeDistanceKm) && config.maxNodeDistanceKm > 0
|
||||
? config.maxNodeDistanceKm
|
||||
: 1;
|
||||
const INITIAL_VIEW_PADDING_PX = 48;
|
||||
const AUTO_FIT_PADDING_PX = 56;
|
||||
const MAX_INITIAL_ZOOM = 12;
|
||||
const INITIAL_VIEW_PADDING_PX = 12;
|
||||
const AUTO_FIT_PADDING_PX = 12;
|
||||
const MAX_INITIAL_ZOOM = 13;
|
||||
let neighborLinesLayer = null;
|
||||
let neighborLinesVisible = true;
|
||||
let neighborLinesToggleButton = null;
|
||||
@@ -319,7 +319,7 @@ export function initializeApp(config) {
|
||||
*/
|
||||
function fitMapToBounds(bounds, options = {}) {
|
||||
if (!map || !bounds) return;
|
||||
const padding = Number.isFinite(options.paddingPx) && options.paddingPx >= 0 ? options.paddingPx : 32;
|
||||
const padding = Number.isFinite(options.paddingPx) && options.paddingPx >= 0 ? options.paddingPx : AUTO_FIT_PADDING_PX;
|
||||
const fitOptions = {
|
||||
animate: Boolean(options.animate),
|
||||
padding: [padding, padding]
|
||||
|
||||
Reference in New Issue
Block a user