-
Notifications
You must be signed in to change notification settings - Fork 36
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(layers): fixes geocore layers not appearing in service order #2685
fix(layers): fixes geocore layers not appearing in service order #2685
Conversation
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.
Reviewed 6 of 6 files at r1, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @jolevesq)
packages/geoview-core/src/api/event-processors/event-processor-children/legend-event-processor.ts
line 357 at r1 (raw file):
// Reorder the array so legend tab is in synch const sortedLayers = layers.sort((a, b) => MapEventProcessor.getMapIndexFromOrderedLayerInfo(mapId, a.layerPath) >
Same as other comment here
packages/geoview-core/src/api/event-processors/event-processor-children/legend-event-processor.ts
line 756 at r1 (raw file):
if (legendLayer.children.length) legendLayer.children.sort((a, b) => MapEventProcessor.getMapIndexFromOrderedLayerInfo(mapId, a.layerPath) >
Idea, an alternative and popular way of writing a sort callback would be something like:
.sort((a, b) =>
return MapEventProcessor.getMapIndexFromOrderedLayerInfo(mapId, a.layerPath) - MapEventProcessor.getMapIndexFromOrderedLayerInfo(mapId, b.layerPath);
a6b6a29
to
9d4c073
Compare
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.
Reviewable status: 5 of 6 files reviewed, all discussions resolved (waiting on @Alex-NRCan and @jolevesq)
packages/geoview-core/src/api/event-processors/event-processor-children/legend-event-processor.ts
line 357 at r1 (raw file):
Previously, Alex-NRCan (Alex) wrote…
Same as other comment here
Thanks! Changed
packages/geoview-core/src/api/event-processors/event-processor-children/legend-event-processor.ts
line 756 at r1 (raw file):
Previously, Alex-NRCan (Alex) wrote…
Idea, an alternative and popular way of writing a sort callback would be something like:
.sort((a, b) =>
return MapEventProcessor.getMapIndexFromOrderedLayerInfo(mapId, a.layerPath) - MapEventProcessor.getMapIndexFromOrderedLayerInfo(mapId, b.layerPath);
Changed!
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.
Reviewed 6 of 6 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @DamonU2)
9d4c073
to
e25ec7d
Compare
0030f48
into
Canadian-Geospatial-Platform:develop
Closes #2644
Description
Sorts geocore child layers properly, in ordered layer info and legend layers.
Type of change
How Has This Been Tested?
https://damonu2.github.io/geoview/add-layers.html
Layer: 4bece602-04cf-4520-a512-9f4d8720b683
Checklist:
I have made corresponding changes to the documentationI have added tests that prove my fix is effective or that my feature worksNew and existing unit tests pass locally with my changesThis change is