Repository navigation
StandardApp: only check c URL parameter against theme extent if constrainExtent is enabled - #801
Merged
manisandro merged 1 commit intoOct 29, 2026
Conversation
…rainExtent is enabled
manisandro
reviewed
Oct 29, 2026
| // Only accept c if it is within the theme bounds | ||
| if (bounds[0] <= p[0] && p[0] <= bounds[2] && bounds[1] <= p[1] && p[1] <= bounds[3]) { | ||
| // If the map is constrained to the theme bounds, only accept c if it is within them | ||
| const constrained = ConfigUtils.getPluginConfig("Map").cfg?.mapOptions?.constrainExtent === true; |
Member
There was a problem hiding this comment.
I guess you'll also want to check for mapOptions?.constrainOnlyCenter here?
Contributor
Author
There was a problem hiding this comment.
I don't think this is needed! constrainOnlyCenter does nothing without constrainExtent since OlMap only passes the extent to the view if constrainExtent is set. With constrainExtent the center has to be inside the theme extent in both cases and without constrainOnlyCenter OL already shifts the view inwards on its own. I tested all combinations to be sure.
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #774, implementing option 2: The
cURL parameter is only checked against the theme extent ifmapOptions.constrainExtentis enabled.Because this check was also the only guard against invalid values,
cis now ignored if it does not contain two valid numbers (for examplec=412345,from a truncated link), and the theme opens at its initial extent instead of at0.