Skip to content
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

fix(ui-core): Fix fullscreen zoom exit, layer class label, disable zo… #2759

Merged
merged 6 commits into from
Feb 21, 2025

Conversation

jolevesq
Copy link
Member

@jolevesq jolevesq commented Feb 19, 2025

…om details, add layer id, inline plugin

Closes #2757, #2656

Description

  • Remove a condition for add layer that duplicate the id and fails the add layer panel
  • Add event listener when map is reseize after a fullscreen exit to set the previous zoom/extent the best as possible
  • Add the memo and array reconstruction to make sure useSelector hook is triggered when a child property change to set the layer single-layer class
  • Repair the details to disable checkbox and zoom button when extent is infinity if no geometry is found on query. The airborne service 21b821cf-0f1c-40ee-8925-eab12d357668 does not return any geometry
  • Add inline package config options

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes #2757, #2656

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

Test add layer - fullscreen - disable button
https://jolevesq.github.io/geoview/add-layers.html

  • Add any layers by url and now it loads
  • Add 21b821cf-0f1c-40ee-8925-eab12d357668 then click on it and see button disable on details

Test class
https://jolevesq.github.io/geoview/demos-navigator.html?config=./configs/navigator/16-esri-dynamic.json

  • Turn on/off any class visibility from layers panel and see x of x class is updating
  • Look at the console and see memoLayerDescription message only triggers for active layer

Test plugins
https://jolevesq.github.io/geoview/demos-navigator.html?config=./configs/navigator/11-package-time-slider-custom.json
https://jolevesq.github.io/geoview/demos-navigator.html?config=./configs/navigator/12-a-package-swiper.json

  • swiper is horizontal in the inline config
  • slider has custom inline description in inline config

Checklist:

  • I have build (rush build) and deploy (rush host) my PR
  • I have connected the issues(s) to this PR
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have created new issue(s) related to the outcome of this PR is needed
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

This change is Reviewable

@jolevesq jolevesq marked this pull request as ready for review February 20, 2025 13:06
Copy link
Member Author

@jolevesq jolevesq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 17 of 18 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @jolevesq)

Copy link
Member

@Alex-NRCan Alex-NRCan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 16 of 18 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @DamonU2)


packages/geoview-core/src/core/components/layers/left-panel/single-layer.tsx line 82 at r2 (raw file):

  // const layerChildren: TypeLegendLayer[] | undefined = useSelectorLayerChildren(layer.layerPath);
  // const layerItems: TypeLegendItem[] | undefined = useSelectorLayerItems(layer.layerPath);
  const layerItems: TypeLegendItem[] = useSelectorLayerItems(layer.layerPath);

Uncomment the line above instead of adding the line and keep the | undefined to remain type safe throughout.


packages/geoview-core/src/geo/map/map-viewer.ts line 913 at r2 (raw file):

      // Listen to our internal mapChangeSize event
      this.map.on('change:size', handleSizeChangeOnce);

To handle events happening only once, you should be able to use this.map.once('change:size', ...) or is it not available on map?

Copy link
Member Author

@jolevesq jolevesq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 4 of 5 files at r3.
Reviewable status: 18 of 19 files reviewed, 2 unresolved discussions (waiting on @Alex-NRCan and @DamonU2)


packages/geoview-core/src/core/components/layers/left-panel/single-layer.tsx line 82 at r2 (raw file):

Previously, Alex-NRCan (Alex) wrote…

Uncomment the line above instead of adding the line and keep the | undefined to remain type safe throughout.

Done.


packages/geoview-core/src/geo/map/map-viewer.ts line 913 at r2 (raw file):

Previously, Alex-NRCan (Alex) wrote…

To handle events happening only once, you should be able to use this.map.once('change:size', ...) or is it not available on map?

Done.

Copy link
Member

@Alex-NRCan Alex-NRCan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 4 of 5 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @DamonU2)

Copy link
Member Author

@jolevesq jolevesq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 5 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @DamonU2)

@jolevesq jolevesq merged commit 7f5adf3 into Canadian-Geospatial-Platform:develop Feb 21, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Zoom level & extent with Fullscreen (OSDP-1943)
2 participants