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

Fix #9025 WMS caching with custom scales (custom resolutions strategy from WMTS) #9184

Merged
merged 5 commits into from
May 25, 2023

Conversation

allyoucanmap
Copy link
Contributor

Description

This PR adds the possibility to apply custom tile grids to WMS layer through a request to a WMTS endpoint generated from a GeoServer WMS layer url. The PR includes following changes:

  • add logic to WMS Layer for the OpenLayer implementation to support custom tileGrids
  • add two new properties to wms layer configuration: tileGrids and tileGridStrategy
  • add two new icons: grid-regular and grid-custom
  • add buttons and information inline with the WMS cache options setting to toggle the custom strategy

UI Changes:

  • Button to enable custom strategy

image

  • Info icon shows information about tile grids and highlight the one in use (automatically selected)

image

  • Info icon shows information about tile grids with warning if it's not possible to find a tile grid that matches the map projection and selected tile size

image

  • warning when there isn't a tile grid available that matches the available projections in MapStore

image

  • error message when is not possible to connect to the WMTS endpoint generated from the WMS layer

image

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Feature

Issue

What is the current behavior?

#9025

What is the new behavior?

It is possible to apply custom grid set configured server side to GeoServer WMS layers

Breaking change

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • No

Other useful information

@allyoucanmap allyoucanmap added this to the 2023.02.00 milestone May 18, 2023
@allyoucanmap allyoucanmap self-assigned this May 18, 2023
@tdipisa tdipisa requested a review from offtherailz May 19, 2023 07:14
Copy link
Member

@offtherailz offtherailz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I noticed that also the format and the styles may be provided. In fact if format or style do not match, you have a green light, but the tile cache misses with message "not a tile cache for requested format" ( I suppose the same for style )
    The WMTS provides this list:
<Format>image/png</Format>
<Format>image/jpeg</Format>
<Format>image/png8</Format>

So maybe we canevaluate to check also this, what do you think?

Instead style may be more complicated, you can evaluate to skip this checks.

  • I suggested to simplify the messages, avoiding to talk about strategies. More information can stay in user documentation, I think. Take into accoun that if you consider also formats and/or styles, the strings change.

@tdipisa we we should not forget in doc to mention that

  • MapStore automatically follow the same algorithm of GeoServer to generate the tile grids and use the cache, so most of the cases creating the tile grids with default bounding box and resolution for the tilesizes and the projections used is enough to activate caching.
  • In case you are using custom tilegrids, activating the button will fetch the tilegrids and MapStore will automatically select the best tilegrid if available.

web/client/translations/data.en-US.json Outdated Show resolved Hide resolved
web/client/translations/data.en-US.json Outdated Show resolved Hide resolved
web/client/translations/data.en-US.json Outdated Show resolved Hide resolved
web/client/translations/data.en-US.json Outdated Show resolved Hide resolved
web/client/translations/data.en-US.json Outdated Show resolved Hide resolved
web/client/translations/data.it-IT.json Outdated Show resolved Hide resolved
@tdipisa
Copy link
Member

tdipisa commented May 19, 2023

@tdipisa we we should not forget in doc to mention that

@ElenaGallo remember to open an issue for the update of the user guide.

@allyoucanmap allyoucanmap requested a review from offtherailz May 22, 2023 09:52
@tdipisa tdipisa linked an issue May 22, 2023 that may be closed by this pull request
2 tasks
Copy link
Member

@offtherailz offtherailz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • bug: Can't turn off the custom tile grid anymore once activated:
custom_tile_grid.webm
  • One inline comment about JSDoc to update.
  • Showing also the list of formats supported by the tile grid is a plus

About user experience, one thing I noticed:

Now we have a feedback of cache match only in case of custom gridset, but we do not have anything in case of standard gridset, that looks a little strange
It could make sense to check if the default strategy meets the remote gridset. Maybe the refresh button may be a check button that tells if the default strategy fits.

A more rational workflow could tell the user (if clicks on a proper button) if the standard setup works or no, and if it doesn't, he can decide to use a custom on. A workflow like this looks more rational to me, instead of having
Use cache with no feedback, and then turn on custom and see that it works or it doesn't.

@allyoucanmap allyoucanmap requested a review from offtherailz May 25, 2023 08:14
Copy link
Member

@offtherailz offtherailz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. We can discuss about my last comment later.

@allyoucanmap allyoucanmap merged commit 29822e1 into geosolutions-it:master May 25, 2023
@allyoucanmap
Copy link
Contributor Author

@ElenaGallo please test this enhancement on dev, thanks

@ElenaGallo
Copy link
Contributor

ElenaGallo commented May 26, 2023

@allyoucanmap from dashboard and geostory settings panel, the 'Available tile grids' popup always reports that it's not possible to find a tile grid that matches the map projection and selected tile size.
(Use this dashboard)

aaS.mov

allyoucanmap added a commit to allyoucanmap/MapStore2 that referenced this pull request Jun 14, 2023
…utions strategy from WMTS) (geosolutions-it#9184)

---------

Co-authored-by: Lorenzo Natali <lorenzo.natali@geosolutionsgroup.com>
offtherailz added a commit that referenced this pull request Jun 15, 2023
…scales (#9222)

* #9025 WMS caching with custom scales (projection resolutions strategy) (#9168)

* Fix #9025 WMS caching with custom scales (custom resolutions strategy from WMTS) (#9184)

---------

Co-authored-by: Lorenzo Natali <lorenzo.natali@geosolutionsgroup.com>

* Fix #9025 Available tile grids popup always reports mismatch in geostories and dashboards (#9196)

* Fix #9193 Add a cache options checks/info also for default WMS tile grid (#9195)

* Fix #9193 failing test (#9207)

* #9025 add caching options to wms background settings (#9213)

* fix failing tests

---------

Co-authored-by: Lorenzo Natali <lorenzo.natali@geosolutionsgroup.com>
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.

WMS caching with custom scales
4 participants