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

2608 geo core initial settings #2651

Conversation

MatthewMuehlhauserNRCan
Copy link
Member

@MatthewMuehlhauserNRCan MatthewMuehlhauserNRCan commented Dec 11, 2024

Description

Added the ability to apply initial settings to GeoCore layers. Only applies to the top most layers currently.

Fixes # 2608

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?

GeoCore Custom Inline Config - Navigator Page

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

Copy link
Member

@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 2 of 4 files at r1, all commit messages.
Reviewable status: 2 of 4 files reviewed, 1 unresolved discussion (waiting on @Alex-NRCan, @DamonU2, and @MatthewMuehlhauserNRCan)


packages/geoview-core/src/geo/layer/other/geocore.ts line 60 at r1 (raw file):

        for (let i = 0; i < response.layers.length; i++) {
          response.layers[i].initialSettings = { ...response.layers[i].initialSettings, ...layerConfig.initialSettings };
          // Need to set the initial settings of the LayerConfigs. Only applies to top layers.

We should be able to apply to any layers?

@MatthewMuehlhauserNRCan MatthewMuehlhauserNRCan marked this pull request as draft January 6, 2025 17:03
@MatthewMuehlhauserNRCan MatthewMuehlhauserNRCan force-pushed the 2608-GeoCore-Initial-Settings branch 2 times, most recently from 2f9cea0 to 751fa7e Compare January 14, 2025 14:19
@MatthewMuehlhauserNRCan MatthewMuehlhauserNRCan force-pushed the 2608-GeoCore-Initial-Settings branch from 751fa7e to 2fe333c Compare January 14, 2025 22:21
@MatthewMuehlhauserNRCan MatthewMuehlhauserNRCan marked this pull request as ready for review January 15, 2025 12:53
Copy link
Member Author

@MatthewMuehlhauserNRCan MatthewMuehlhauserNRCan 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 r2, 5 of 5 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Alex-NRCan, @DamonU2, and @jolevesq)


packages/geoview-core/src/geo/layer/other/geocore.ts line 60 at r1 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

We should be able to apply to any layers?

Done.

Copy link
Member

@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 3 of 5 files at r2, 5 of 5 files at r3, all commit messages.
Reviewable status: all files reviewed, 8 unresolved discussions (waiting on @Alex-NRCan, @DamonU2, and @MatthewMuehlhauserNRCan)


packages/geoview-core/src/geo/layer/other/geocore.ts line 4 at r3 (raw file):

import { UUIDmapConfigReader } from '@/core/utils/config/reader/uuid-config-reader';
// import { UUIDmapConfigReader } from '@/api/config/uuid-config-reader';

Do you need dead import


packages/geoview-core/public/configs/navigator/28-geocore-custom-inline-config.json line 46 at r3 (raw file):

                "hoverable": true,
                "legendCollapsed": false,
                "opacity": 0.7,

Can you put .3, .7 is hard to notice


packages/geoview-core/public/configs/navigator/28-geocore-custom-inline-config.json line 57 at r3 (raw file):

        "geoviewLayerType": "geoCore",
        "geoviewLayerId": "03ccfb5c-a06e-43e3-80fd-09d4f8f69703",
        "initialSettings": {

Is this section suppose to do something?


packages/geoview-core/public/configs/navigator/28-geocore-custom-inline-config.json line 71 at r3 (raw file):

              },
              "controls": {
                "highlight": false,

The control is disable on layers but not on legend. If it is a quick fix you can do. If not, please create an issue


packages/geoview-core/src/core/components/layers/left-panel/add-new-layer/add-new-layer.tsx line 887 at r3 (raw file):

        (layerEntries as TypeGeoviewLayerConfig[]).forEach((geoviewLayerConfig) => {
          if (layerName !== geoviewLayerConfig.geoviewLayerName) {
            const tempConfig = geoviewLayerConfig;

I tested this uuid cf21aa0c-b76c-4f1f-96c1-4ef4b085b647 and set a name. Instead of giving the name to the group it gave it to the first layer

image.png


packages/geoview-core/src/core/utils/config/config.ts line 58 at r3 (raw file):

        if (mapConfigLayerEntryIsGeoCore(geoviewLayerEntry)) {
          //  Skip it, because we don't validate the GeoCore configuration anymore. Not the same way as typical GeoView Layer Types at least.
          // ? Why not do GeoCore request here? Then could easily replace listOfLayerEntries and validate / process along with other layers?

Put TODO: refactor - so we will track it in the refactor


packages/geoview-core/src/geo/map/map-schema-types.ts line 412 at r3 (raw file):

  /** The layer entries to use from the GeoCore layer. */
  listOfLayerEntryConfig?: TypeLayerEntryConfig[];

This file is depecrated, we should use ma-schema type in api config

Copy link
Member

@DamonU2 DamonU2 left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 5 files at r2, 5 of 5 files at r3, all commit messages.
Reviewable status: all files reviewed, 8 unresolved discussions (waiting on @Alex-NRCan, @jolevesq, and @MatthewMuehlhauserNRCan)

Copy link
Member Author

@MatthewMuehlhauserNRCan MatthewMuehlhauserNRCan left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 8 unresolved discussions (waiting on @Alex-NRCan and @jolevesq)


packages/geoview-core/src/core/components/layers/left-panel/add-new-layer/add-new-layer.tsx line 887 at r3 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

I tested this uuid cf21aa0c-b76c-4f1f-96c1-4ef4b085b647 and set a name. Instead of giving the name to the group it gave it to the first layer

image.png

Looking at this, I think it's because of how the layers are handled. There is one layer with two indexes in the layerEntries returned from GeoCore, but there is no Group layer, so the name is applied to the first layer entry and not the created group entry. I'll look a bit closer to see if there's any way I can make the name apply to the group that is created later.


packages/geoview-core/src/core/utils/config/config.ts line 58 at r3 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

Put TODO: refactor - so we will track it in the refactor

Done.


packages/geoview-core/src/geo/layer/other/geocore.ts line 4 at r3 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

Do you need dead import

Done.


packages/geoview-core/src/geo/map/map-schema-types.ts line 412 at r3 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

This file is depecrated, we should use ma-schema type in api config

I don't think type GeoCoreLayerConfig exists in the new map-schema-types. I'm guessing it won't be necessary after the refactor? Including this use case.

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 2 of 5 files at r2, 4 of 5 files at r3, 2 of 2 files at r4, all commit messages.
Reviewable status: all files reviewed, 8 unresolved discussions (waiting on @jolevesq and @MatthewMuehlhauserNRCan)

Copy link
Member Author

@MatthewMuehlhauserNRCan MatthewMuehlhauserNRCan left a comment

Choose a reason for hiding this comment

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

Reviewable status: 6 of 8 files reviewed, 8 unresolved discussions (waiting on @Alex-NRCan, @DamonU2, and @jolevesq)


packages/geoview-core/public/configs/navigator/28-geocore-custom-inline-config.json line 46 at r3 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

Can you put .3, .7 is hard to notice

Done.


packages/geoview-core/public/configs/navigator/28-geocore-custom-inline-config.json line 57 at r3 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

Is this section suppose to do something?

I was trying to see if I could get it to highlight from the config, but it didn't seem to work.


packages/geoview-core/src/core/components/layers/left-panel/add-new-layer/add-new-layer.tsx line 887 at r3 (raw file):

Previously, MatthewMuehlhauserNRCan wrote…

Looking at this, I think it's because of how the layers are handled. There is one layer with two indexes in the layerEntries returned from GeoCore, but there is no Group layer, so the name is applied to the first layer entry and not the created group entry. I'll look a bit closer to see if there's any way I can make the name apply to the group that is created later.

This should be handled now

Copy link
Member

@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 2 of 2 files at r4, all commit messages.
Reviewable status: 6 of 8 files reviewed, 5 unresolved discussions (waiting on @Alex-NRCan, @DamonU2, and @MatthewMuehlhauserNRCan)


packages/geoview-core/public/configs/navigator/28-geocore-custom-inline-config.json line 57 at r3 (raw file):

Previously, MatthewMuehlhauserNRCan wrote…

I was trying to see if I could get it to highlight from the config, but it didn't seem to work.

Can you remove from config if itis not working


packages/geoview-core/src/geo/map/map-schema-types.ts line 409 at r5 (raw file):

  /** Initial settings to apply to the GeoCore layer at creation time. */
  initialSettings?: TypeLayerInitialSettings;

You said this is not working at the root level. Can we remove from the type file

Copy link
Member Author

@MatthewMuehlhauserNRCan MatthewMuehlhauserNRCan 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 2 files at r5.
Reviewable status: 7 of 8 files reviewed, 5 unresolved discussions (waiting on @Alex-NRCan, @DamonU2, and @jolevesq)


packages/geoview-core/public/configs/navigator/28-geocore-custom-inline-config.json line 57 at r3 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

Can you remove from config if itis not working

Done.


packages/geoview-core/public/configs/navigator/28-geocore-custom-inline-config.json line 71 at r3 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

The control is disable on layers but not on legend. If it is a quick fix you can do. If not, please create an issue

This happens with non-geocore layers too, so I'll create an issue.

@MatthewMuehlhauserNRCan
Copy link
Member Author

packages/geoview-core/src/geo/map/map-schema-types.ts line 409 at r5 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

You said this is not working at the root level. Can we remove from the type file

I just tested, it does work at the root level too, but I was testing the controls to see if maybe I needed to set it somewhere else to disable the highlight function, but it didn't seem to matter. I just tested the controls now too, and they seem to work there as well. So I guess it's just the highlight not behaving correctly in the legend.

Copy link
Member

@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 2 files at r5, 1 of 1 files at r6, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @MatthewMuehlhauserNRCan)

Copy link
Member

@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.

:lgtm:

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @MatthewMuehlhauserNRCan)

@jolevesq jolevesq merged commit c382048 into Canadian-Geospatial-Platform:develop Jan 15, 2025
5 of 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.

4 participants