-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/1252 control hajk programatically #1272
Merged
Merged
Conversation
This file contains 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
- Added an example page that embeds the locally running Hajk instance. - Added two buttons to the example. They can be used to control the zoom level. - Added a listener to App.js that will trigger onhashchange. - Implemeted changing zoom level by changing the z-value of hash string.
- In order to allow embedding parent documents to read out some values from our Hajk instance, I had to add an object to the global object of Hajk. - It's called 'hajkPublicApi', but it's not a real API (yet?). It only exposes the View's zoom limits. - This can be expanded to a real public API with executable functions, or completely removed if we see problems with this approach.
…logy, as described in #1252.
- The q paramter is updated when user types in the search bar - If the map loads with the q parameter OR the q parameter's value changes, search is invoked. - Added a debouncer to utils, can come in handy in other places too.
…ol-hajk-programatically
- AnchorModel now part of core, will get initated no matter the settings for Anchor plugin - A asynchronous debounce helper takes care of not re-creating the URL too often. - Anchor plugin needs some more work to work with the new solution. The main question that remains is: how should we treat the 'clean' parameter? If we update it in the URL immitiately, we would expect the map to get cleaned up and the Anchor view would disappear. But if we don't put 'clean' into the hash, it must be taken care of somewhere else, or else it will be overriden the next time user does something that triggers URL regeneration, so that 'clean's value will be set to false again. Fixable but we need to decide on this one.
… hash in browser's URL field.
- Search params are used only internally but removed prior return - We still support both search and hash params on init (as we merge them both in AppModel), but I see no need in generating the search params portion now, when we work with the hash portion under the hood.
- Changes to x & y trigger now View animation, just as z change does. This means we have a map that stores its' state in the URL's hash, including full compatibility with browser's history mechanism. - Added a new param: p. It is meant to store the currently visible plugin(s). With this option, app's state now also includes the most recently shown plugins. They also follow with the link, so when URL is shared, the plugin visibility is also shared.
- As usual, group layers are an issue. They toggel correctly in map, but the sublayers aren't selected correctly in LayerSwitcher. Will need to take a look into that too. - But I'm commiting now, as this has grown pretty big already. So, two things: - l and gl parameters are now respected - THIS ENTIRE FUNCTIONALITY IS NOW BEHIND A FLAG IN ADMIN: enableAppStateInHash. I think it's neccessary to make it optional at this stage.
- I think this is it. What a horrible mess… We must get rid of group layers
… next to it, fixes here.
jacobwod
added
module:client/core
Core functionality (not a plugin)
new feature
Request for adding/changing functionality
labels
Jan 24, 2023
Hallbergs
previously approved these changes
Jan 25, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found some issues regarding the zoom-change.
Zoom should be parsed as float - not int
Hallbergs
approved these changes
Jan 25, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! Works great! 🥇 🔥 🥳 💯
"Snajsigt!", as you say in Swedish. Nice work! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
module:client/core
Core functionality (not a plugin)
new feature
Request for adding/changing functionality
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.
Closes #1252
Skarminspelning.2023-01-24.kl.14.55.43.mov