-
Notifications
You must be signed in to change notification settings - Fork 34
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
feat-fix(layers-event): Add getGeoJSON for vector layer, patch timing… #2382
feat-fix(layers-event): Add getGeoJSON for vector layer, patch timing… #2382
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 10 of 10 files at r1, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @DamonU2)
packages/geoview-core/src/geo/layer/geoview-layers/vector/abstract-geoview-vector.ts
line 518 at r1 (raw file):
getFeaturesAsGeoJSON(layerPath: string): JSON { // Get map projection const mapProjection: ProjectionLike = MapEventProcessor.getMapViewer(this.mapId).getProjection().getCode();
FYI
Alternatively can call this.getMapViewer()
as well if preferred.
packages/geoview-core/src/geo/layer/gv-layers/abstract-gv-layer.ts
line 594 at r1 (raw file):
const curVisible = this.getVisible(); this.getOLLayer().setVisible(layerVisibility); if (layerVisibility !== curVisible) this.#emitVisibleChanged({ layerPath: this.getLayerPath(), visible: layerVisibility });
FYI
Here, the sender
parameter, when handling the event in the handler method, would be able to do something like sender.getLayerPath()
if we want to know which layer has raised the visible changed.
There's no harm in providing it, explicitly, via the event as well if we feel it's necessary. It's just growing the event payload.
packages/geoview-core/src/geo/layer/gv-layers/vector/abstract-gv-vector.ts
line 298 at r1 (raw file):
getFeaturesAsGeoJSON(): JSON { // Get map projection const mapProjection: ProjectionLike = MapEventProcessor.getMapViewer(this.getMapId()).getProjection().getCode();
FYI
Same comment as before
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 10 of 10 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @jolevesq)
packages/geoview-core/src/api/event-processors/event-processor-children/map-event-processor.ts
line 557 at r1 (raw file):
} static setOrToggleMapLayerVisibilityState(mapId: string, curOrderedLayerInfo: TypeOrderedLayerInfo[]): void {
Should this be something more generic like setOrderedLayerInfoWithNoOrderChange? It will probably be used for other purposes going forward.
packages/geoview-core/src/geo/layer/layer.ts
line 1747 at r1 (raw file):
*/ export type LayerRemovedEvent = { // The added layer
I think I did this, but added should be removed in this comment
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 r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @jolevesq)
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 8 of 10 files at r1, 2 of 6 files at r2, 1 of 2 files at r3, all commit messages.
Reviewable status: 9 of 10 files reviewed, 2 unresolved discussions (waiting on @Alex-NRCan and @DamonU2)
packages/geoview-core/src/api/event-processors/event-processor-children/map-event-processor.ts
line 557 at r1 (raw file):
Previously, DamonU2 (Damon Ulmi) wrote…
Should this be something more generic like setOrderedLayerInfoWithNoOrderChange? It will probably be used for other purposes going forward.
Done.
packages/geoview-core/src/geo/layer/layer.ts
line 1747 at r1 (raw file):
Previously, DamonU2 (Damon Ulmi) wrote…
I think I did this, but added should be removed in this comment
Done.
packages/geoview-core/src/geo/layer/geoview-layers/vector/abstract-geoview-vector.ts
line 518 at r1 (raw file):
Previously, Alex-NRCan (Alex) wrote…
FYI
Alternatively can callthis.getMapViewer()
as well if preferred.
Done
packages/geoview-core/src/geo/layer/gv-layers/vector/abstract-gv-vector.ts
line 298 at r1 (raw file):
Previously, Alex-NRCan (Alex) wrote…
FYI
Same comment as before
Done
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 1 of 10 files at r1, 3 of 6 files at r2, 1 of 2 files at r3.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @DamonU2)
… issue with geoCoreLayer, add layerError event, add global layerVisibility event Closes Canadian-Geospatial-Platform#2338, Canadian-Geospatial-Platform#2376
ddd20bc
to
0fe720d
Compare
0408913
into
Canadian-Geospatial-Platform:develop
… issue with geoCoreLayer, add layerError event, add global layerVisibility event
Closes #2338, #2376
Description
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 [FEATURE] Utility Conversion Function ol-geoJSON #2338, [FEATURE] Event for Layer Error #2376
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Hosted July 17th, 2h30:
https://canadian-geospatial-platform.github.io/geoview/public/esri-feature.html
In the console type and see the result
cgpv.api.maps['LYR1'].layer.getGeoviewLayers()[0].getFeaturesAsGeoJSON('uniqueValueId/1')
https://jolevesq.github.io/geoview/demo-function-event.html
in the notifiaction, new event for layerError and one for visibility (use the GeoJSON layer)
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