-
-
Notifications
You must be signed in to change notification settings - Fork 487
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
Map / Background layer / Fix active layer on load. #7126
Conversation
Test: * Open the map * Reload page * Active background is not enabled. This was related to the fact that the search map is also affecting bgLayers. Only the main map viewer is defining the bgLayers which is used for the base switcher directive. In case of the context has no active background, use the first one (and log a warning). Reset default map : * may fail if no context defined. Add a fallback to the default one (and log a warning). * tried to use the map layer config if no context defined as it was ignored (but not working - require more work or removal of those unused ? settings)
d662c2f
to
b5acf0a
Compare
queue on context load. Context layer can contain a JSON extension which could be formatted and XML formatting may add extra space which needs to be clean up for proper JSON string: ```xml <ows-context:Layer name="surval_parametre_point" group="/Human Activities" hidden="false" opacity="1" showLayerInfo="true"> <ows:Title>Surval données par paramètre (point)</ows:Title> <ows-context:Server service="urn:ogc:serviceType:WMS" version="1.3.0"> <ows-context:OnlineResource xlink:href="https://sextant.ifremer.fr/services/wms/environnement_marin"/> </ows-context:Server> <ows-context:Extension>{"uuid":"cf5048f6-5bbf-4e44-ba74-e6f429af51ea","label":"Surval données par paramètre (point)","filters":{"qParams":{"ft_LIEU_LIBELLE_s":{"type":"terms","values":{"001-P-003 - Zuydcoote filière":true}}}},"wfsUrl":"https://sextant.ifremer.fr/services/wfs/environnement_marin"} </ows-context:Extension> </ows-context:Layer> ``` Clear map queue on load - may have side effect when loading differents maps quickly. Avoid JS error if server layer is not defined (which should not be the case unless custom context with new layer types was created).
eb37fb0
to
3335441
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.
When I go directly to http://localhost:8080/geonetwork/srv/eng/catalog.search#/map or refresh the window, the layer is selected, but the layer panel is displayed open:
web-ui/src/main/resources/catalog/components/viewer/owscontext/OwsContextDirective.js
Outdated
Show resolved
Hide resolved
When you open a map from whatever location (can be from metadata record, from URL, from map library panel, from the home page), It makes sense to open the list of layers no ? It is done with https://github.com/geonetwork/core-geonetwork/pull/7126/files#diff-9bd74fbb2a2845e3f336ce49bf2295841e725862c1813532d41c32be94b9bf3dR383 |
…tool after map load.
Added options to configure default tools. |
Configuration done in #7126
* Map / Layer manager / Add support for multilingual layer title. Metadata may be multilingual and provide multilingual layer name in the online source description field. GetCapabilities document do not provide multilingual support, so this adds the possibility to translate layer name in maps. A multilingual description in a link: ```xml <gmd:onLine> <gmd:CI_OnlineResource> <gmd:linkage> <gmd:URL>https://data.apps.fao.org/map/gsrv/gsrv1/geonetwork/ows?SERVICE=WMS&</gmd:URL> </gmd:linkage> <gmd:protocol> <gmx:MimeFileType type="">OGC:WMS</gmx:MimeFileType> </gmd:protocol> <gmd:name xsi:type="gmd:PT_FreeText_PropertyType"> <gco:CharacterString>geonetwork:basins_296</gco:CharacterString> <gmd:PT_FreeText> <gmd:textGroup> <gmd:LocalisedCharacterString locale="#EN">geonetwork:basins_296</gmd:LocalisedCharacterString> </gmd:textGroup> <gmd:textGroup> <gmd:LocalisedCharacterString locale="#FR" /> </gmd:textGroup> </gmd:PT_FreeText> </gmd:name> <gmd:description xsi:type="gmd:PT_FreeText_PropertyType"> <gco:CharacterString>Hydrological basins in Africa</gco:CharacterString> <gmd:PT_FreeText> <gmd:textGroup> <gmd:LocalisedCharacterString locale="#EN">Hydrological basins in Africa</gmd:LocalisedCharacterString> </gmd:textGroup> <gmd:textGroup> <gmd:LocalisedCharacterString locale="#FR">Bassins versants en Afrique</gmd:LocalisedCharacterString> </gmd:textGroup> </gmd:PT_FreeText> </gmd:description> </gmd:CI_OnlineResource> </gmd:onLine> ``` The description is retrieved from the metadata on load from the metadata UUID which is attached to the layer (and saved in the OWS context extension of the layer) using the service URL and the layer name. This also allows to override layer name when a group of layer (eg. `a,b,c`) is used in the online source name. * Map / When loading a map, switch to layer tool panel. * Map / Layer manager / Add support for multilingual layer title / Layer search. * Map / Layer manager / Add support for multilingual layer title / Layer filter. * Remove openTool after map load. Configuration done in #7126
web-ui/src/main/resources/catalog/components/viewer/owscontext/OwsContextService.js
Outdated
Show resolved
Hide resolved
var res = { href: "" }; | ||
if (layer.server) { | ||
var server = layer.server[0]; | ||
res = server.onlineResource[0]; |
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.
I guess server.onlineResource[0]
contains an object like { href: "XXXXX" }
?
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.
Usually yes, but it is a corner case in Sextant where the map context can define custom layer types without server.
Kudos, SonarCloud Quality Gate passed! |
Test:
This was related to the fact that the search map is also affecting bgLayers.
Only the main map viewer is defining the bgLayers which is used for the base switcher directive. In case of the context has no active background, use the first one (and log a warning). Reset default map :
Add configuration to define default active tool and active tool after map load
Fix various rare error: