-
Notifications
You must be signed in to change notification settings - Fork 32
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
Datahub: use the spatial extent of a record when it cannot be computed from a layer #794
Conversation
also added the test record from geocat.ch with various layers
All wms utils and associated tests were move to the main map utils service to simplify code
Affected libs:
|
8f71536
to
cfc3f32
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.
Thanks, @jahow ! Still having a hard time to not confuse all the extents reviewing, but AFAIK see all looks good:-) Is there a record to test the fallback to the record extent?
Note: When switching from one dataset to another, sometimes I saw the previous dataset showing up briefly on the map. I think we've already had this issue in the past and I doubt it's related to this PR though.
OnlineLinkResource, | ||
} from '@geonetwork-ui/common/domain/model/record' | ||
import { matchProtocol } from '../common/distribution.mapper' | ||
import { LangService } from '@geonetwork-ui/util/i18n' | ||
import { Geometry } from 'geojson' |
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.
This does not seem to be used.
@@ -128,8 +130,8 @@ export class MapUtilsService { | |||
/** | |||
* Will emit `null` if no extent could be computed | |||
*/ | |||
getLayerExtent(layer: MapContextLayerModel): Observable<Extent | null> { | |||
let geographicExtent: Observable<Extent> | |||
async getLayerExtent(layer: MapContextLayerModel): Promise<Extent | null> { |
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.
Is there a particular reason to keep this a Promise
here and transform it to an Observable
later in the chain?
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.
yes! using promises here made everything else so much less verbose, I figured it would be worth it. I usually consider that once "in Angular" we should use observables everywhere, but it was hard not to get the benefit of async functions here.
Thanks for the review! I linked a local record in the PR, it's the general testing record from Geocat. The "WMS Group" distribution relies on a layer in the GetCapabilities without any extent. I agree that the logic for setting up the map is still a bit convoluted for now. I hope in the near future we'll be able to more clearly separate what is about generating a map context, and what is about interpreting it.
Yes, I think we're not clearing the map while a dataset is loading. But that should be behind a loading panel right? |
Description
This PR adds:
To see it in action, open http://localhost:4200/dataset/9e1ea778-d0ce-4b49-90b7-37bc0e448300 and select the "WMS group" distribution
This PR also adds two records to the dump: one with a WMTS layer (there was none), and the generic test record from geocat.ch: https://geocat-dev.dev.bgdi.ch/geonetwork/srv/eng/catalog.search#/metadata/9e1ea778-d0ce-4b49-90b7-37bc0e448300
Quality Assurance Checklist
breaking change
labelbackport <release branch>
labelThis work is sponsored by Geocat.ch.