-
Notifications
You must be signed in to change notification settings - Fork 416
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
Add ZoomToMaxExtentButton component #190
Conversation
Please, check Travis build: it's failing with this error: web/client/examples/viewer/plugins/index.jsx |
From an initial look at the code, it cannot work. Did you test that it is working in either leaflet or openlayers viewer? |
Sure I did. All looked fine to me. What is wrong with the code? |
I will checkout the code and do a direct test. I will let you know. |
|
||
// In addition to the state, 'connect' puts 'dispatch' in our props. | ||
// connect Redux store slice with map configuration | ||
module.exports = connect((state) => { |
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.
It would be preferrable to bind properties in the plugins index.js as we do for other plugins, instead of connecting directly to the store
I think it works only when maxExtent is not defined.
|
This implements a class skeleton for a button, which should be used to zoom a map to its max. extent. This is only a skeleton to integrate the UI (button) without any functionality.
This adds the ZoomToMaxExtentButton to the examples viewer instances.
In case of clicking the ZoomToMaxExtent button the map zooms to the max. extent which is defined in the map's config object. If no max. extent is defined the map will be zoomed to zoom level '1'.
- Bind properties in the plugins index.js as we do for other plugins - Call action as a property without directly calling dispatch
Okay I'll bind the actions the other way you described. What would be your favourite strategy to zoom the map by center, since
Would extending |
Hi, Christian.
Consider that my desire is to remove the bbox from the state and make it a calculated property of center and zoom, so those 2 are the important properties for map navigation. |
This ensures max. extent is set by corresponding center and zoom values which are calculated by the 'maxExtent' property of the map's config.
61064b8
to
9c3e81e
Compare
Hi @mbarto, |
Looks good. I will try to test it on monday, and then merge it. Thank you. |
Hi Christian, I did a couple of minor adjustements and merged your work. Thank you. |
…-2023" (geosolutions-it#190) * Update revision to latest master 7-12-2023 * geosolutions-it#189: update version in version.txt and package.json * geosolutions-it#189: enable details panel in dashboard by editing the localConfig.json file * geosolutions-it#189: resolve review comments: Description: - Remove all font-awesome style sheet in html files - Update localConfig based on migration guide to 2024.01.00 * geosolutions-it#189: add npmrc file to project * Update version.txt --------- Co-authored-by: Tobia Di Pisa <tobia.dipisa@geosolutionsgroup.com>
As described and discussed in #102 this PR adds a ZoomToMaxExtentButton component.