Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

what is the intended constrain behaviour? #4655

Closed
ansis opened this issue Apr 8, 2016 · 2 comments
Closed

what is the intended constrain behaviour? #4655

ansis opened this issue Apr 8, 2016 · 2 comments
Labels
Core The cross-platform C++ core, aka mbgl

Comments

@ansis
Copy link
Contributor

ansis commented Apr 8, 2016

scale_ = util::max(scale_,
static_cast<double>((rotatedNorth() ? height : width) / util::tileSize),
static_cast<double>((rotatedNorth() ? width : height) / util::tileSize));

scale_ = util::max(scale_,
                       static_cast<double>((rotatedNorth() ? height : width) / util::tileSize),
                       static_cast<double>((rotatedNorth() ? width : height) / util::tileSize));

looks like it's equivalent to

scale_ = util::max(scale_,
                       static_cast<double>(width / util::tileSize),
                       static_cast<double>(height / util::tileSize));

@1ec5 Is this the intended behaviour?

It's constraining based on the width even if the constrain mode is HeightOnly.

@1ec5
Copy link
Contributor

1ec5 commented Apr 8, 2016

Yes, I made this change in #3401, so that the only difference between the two modes is that WidthAndHeight prevents you from seeing both sides of the antimeridian at a time, while HeightOnly allows scrolling seamlessly across it. The current HeightOnly behavior matches other SDKs and avoids the situation where the same coordinate appears twice on screen. If there is a need for tiling the world multiple times, we should add another constraining mode.

@1ec5
Copy link
Contributor

1ec5 commented Apr 8, 2016

This part of #3401 was motivated by a bug in the OS X SDK, but in principle you would've seen the same thing in the iOS SDK on an iPad:

Before this change, osxapp effectively constrained the zoom level based on whether the window was shorter or taller than 512 points.

I suppose I could've fixed that issue by turning off all constraints, but we don't show anything beyond certain latitudes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core The cross-platform C++ core, aka mbgl
Projects
None yet
Development

No branches or pull requests

3 participants