Skip to content
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 / WMS dimension saved in map #7339

Merged
merged 2 commits into from
Sep 25, 2023
Merged

Map / WMS dimension saved in map #7339

merged 2 commits into from
Sep 25, 2023

Conversation

fxprunayre
Copy link
Member

@fxprunayre fxprunayre commented Sep 14, 2023

  • Save current map dimension value in the map context to be able to open a map on specific date. Follow up of Map / WMS Time and elevation. #6820
  • Save if layer is enabled in layer manager

image

To test:

  • add a layer from WMS-Time, enable layer and select a date
  • save the map
  • open the map

Information saved in layer extension:

    <ows-context:Layer name="22KGA_CHL" hidden="false" opacity="1">
      <ows-context:Server service="urn:ogc:serviceType:WMS" version="1.3.0">
        <ows-context:OnlineResource xlink:href="https://www.aquacoope.org/geoserver/c_br/ows?SERVICE=WMS&amp;"/>
      </ows-context:Server>
      <ows-context:Extension>{"timeDimensionValue":"2021-10-06T00:00:00.000Z", "enabled": true}</ows-context:Extension>
    </ows-context:Layer>

@fxprunayre fxprunayre added this to the 4.4.0 milestone Sep 14, 2023
Save current map dimension value in the map context to be able to open a
map on specific date.

Follow up of #6820
"
@sonarcloud
Copy link

sonarcloud bot commented Sep 18, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

warning The version of Java (11.0.20.1) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

@josegar74
Copy link
Member

@fxprunayre the element Extension doesn't exist for the Layer element, there is another named VendorExtension https://github.com/highsource/ogc-schemas/blob/18ce89928006eee08ed7e5a6ce6ea016436a444b/schemas/src/main/resources/ogc/owc/0.3.1/owsContext.xsd#L217

See a similar discussion in #7062 (comment)

@fxprunayre
Copy link
Member Author

the element Extension doesn't exist for the Layer element, there is another named VendorExtension

Indeed @josegar74 you're right. We have been using it for a long time and for various things.

// apply filters & processes inputs in extension if needed
var extension = {};
if (layer.get("md") && layer.get("md")._id) {
extension.uuid = layer.get("md")._id;
extension.label = layer.get("label");
}
if (layer.get("currentStyle")) {
extension.style = layer.get("currentStyle").Name;
}
if (esObj) {
var wfsUrl = esObj.config.params.wfsUrl;
if (wfsUrl) {
extension.filters = filters;
extension.wfsUrl = wfsUrl;
}
}
if (processInputs) {
extension.processInputs = processInputs;
}
if (layer.showInfo) {
extension.enabled = true; // Enabled in layer manager
}
dimensions.forEach(function (dimension) {
if (source.getParams()[dimension]) {
extension[dimension.toLowerCase() + "DimensionValue"] =
source.getParams()[dimension];
}
});
layerParams.extension = {
name: "Extension",
any: JSON.stringify(extension)
};
Maybe it is better to address this in a dedicated PR and check how to move the current Extension to VendorExtension, replace all usages and add a mechanism to not break old map context.

@josegar74
Copy link
Member

Sounds good the proposal

@fxprunayre fxprunayre merged commit 4a61c8a into main Sep 25, 2023
10 checks passed
@fxprunayre fxprunayre deleted the 4-mapcontextwithdimension branch September 25, 2023 11:37
josegar74 pushed a commit that referenced this pull request Sep 25, 2023
* Map / WMS dimension saved in map

Save current map dimension value in the map context to be able to open a
map on specific date.

Follow up of #6820
"

* Map / Layer enabled in layer manager status saved in context.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants