-
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
Get config from url #2091
Get config from url #2091
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 12 files at r1, all commit messages.
Reviewable status: 10 of 12 files reviewed, 4 unresolved discussions (waiting on @ychoquet)
packages/geoview-core/public/templates/config-sandbox.html
line 198 at r1 (raw file):
// get config and test if JSON is valid // const mapConfig = cgpv.api.configApi.getMapConfig(configArea.value, langue); const returnedValue = cgpv.api.configApi.getConfigFromUrl('p=3857&z=4&c=-100,40&l=en&t=dark&b={basemapId:transport,shaded:false,labeled:true}&i=dynamic&cc=overview-map&keys=12acd145-626a-49eb-b850-0a59c9bc7506,ccc75c12-5acc-4a6a-959f-ef6f621147b9');
This can be remove, we already have a page (default-config who will implement this demo.
Or keep the old way and build a new section to generate the config from url text box
packages/geoview-core/src/api/config/config-api.ts
line 22 at r1 (raw file):
* @static @private */ static #getMapPropsFromUrlParams(urlParams: string): TypeJsonObject {
The viewer will pass the split values to the config
packages/geoview-core/src/api/config/config-api.ts
line 167 at r1 (raw file):
/** * @static
remove this param, you added it below
packages/geoview-core/src/api/config/types/config-constants.ts
line 165 at r1 (raw file):
components: ['north-arrow', 'overview-map'], appBar: { tabs: { core: ['geolocator'] } } as TypeAppBarProps, footerBar: {} as TypeFooterBarProps,
Why have you removed it? I fix my code to use it
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: 10 of 12 files reviewed, 4 unresolved discussions (waiting on @jolevesq)
packages/geoview-core/public/templates/config-sandbox.html
line 198 at r1 (raw file):
Previously, jolevesq (Johann Levesque) wrote…
This can be remove, we already have a page (default-config who will implement this demo.
Or keep the old way and build a new section to generate the config from url text box
Done.
packages/geoview-core/src/api/config/config-api.ts
line 22 at r1 (raw file):
Previously, jolevesq (Johann Levesque) wrote…
The viewer will pass the split values to the config
Done.
packages/geoview-core/src/api/config/config-api.ts
line 167 at r1 (raw file):
Previously, jolevesq (Johann Levesque) wrote…
remove this param, you added it below
Done.
packages/geoview-core/src/api/config/types/config-constants.ts
line 165 at r1 (raw file):
Previously, jolevesq (Johann Levesque) wrote…
Why have you removed it? I fix my code to use it
I removed it because if footerBar is {}, the validation detects an error because tabs is mandatory.
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 12 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @ychoquet)
be1a79e
to
2ab05dd
Compare
15af70d
into
Canadian-Geospatial-Platform:develop
Description
Add the getConfigFromUrl to the new ConfigApi. The new method accepts a string like :
p=3857&z=4&c=-100,40&l=en&t=dark&b={basemapId:transport,shaded:false,labeled:true}&i=dynamic&cc=overview-map&keys=12acd145-626a-49eb-b850-0a59c9bc7506,ccc75c12-5acc-4a6a-959f-ef6f621147b9
and create a new MapFeatureConfig
Fixes #2090
Type of change
How Has This Been Tested?
Using Chrome Devtools.
Deploy URL: https://ychoquet.github.io/GeoView/
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