Open WCarlsson opened 3 years ago
Hi @WCarlsson! The current behaviour is that the map view zooms out to the boundary box of visible search results (i.e. all results will fit in view). In the following step, when you click on a result item, you are zoomed in even closer.
Finally, if you use the "Mark as favourite"-feature, all currently selected items will be visible (so the zoom changes depending on which features you select, to encompass all of them in the view). See the screenshot below. Feel free to check out https://karta.halmstad.se too.
Isn't this how you'd want it to work?
Yes it sounds like it is already implemented in a very satisfactory way, it looks like this is a bug or faulty configuration in our environment. In my example i have searched for an adress but when the search is made or selected from the possible results it is zoomed to the level shown below. I have tried a couple of different datasets with different settings for the search service but get the same result.
@jacobwod It looks like the zoom-level for search results is dependant on the resolutions set in the map settings. If we change the map resolutions to the same as in karta.halmstad.se we get the same nice zoom levels for search results.
However if we have a WMTS-layer in our map (which we currently have) the resolutions from the map settings seem to be overridden by the resolutions from the WMTS-layer which leads to us getting a search zoom level not desired and that can´t be changed.
The resolutions are only overridden when the WMTS-layer is active, right? If that's the case (which it should be) i guess the zoom-issue is expected, since you cannot zoom outside the resolutions set-up for the WMTS-layer without missing information from that layer, right?
Unfortunately that's not the case, even though it should be.
The following excerpt comes from WMTSLayer's constructor
, and is run as soon as the layer is constructed:
https://github.com/hajkmap/Hajk/blob/73b8b183809e7fd37fed3bf330ea29301a50edad/new-client/src/models/layers/WMTSLayer.js#L83
And here's what's going on, see especially line 93: https://github.com/hajkmap/Hajk/blob/73b8b183809e7fd37fed3bf330ea29301a50edad/new-client/src/models/layers/WMTSLayer.js#L87-L97
I´m guessing since it sets a new View a number of configurations in admin doesn´t take effect since they set as View parameters. For example extent and constrainResolution.
That's absolutely correct @WCarlsson – we're completely overriding the existing View and ignore a lot of additional settings. This is such huge bug that we must take appropriate measure until it's fixed. I can barely see any reasons for having WMTS enabled at all at this time. @Hallbergs?
@jacobwod We can still see value in having WMTS enabled unless it is possible to fix it relatively soon. It still works for us, except the things that the bug effects, and we would like to continue testing against our qgis server to see how it behaves in hajk.
With that said if you see a big problem with having it enabled since there are bugs present or if it somehow complicates the development process then feel free to do what you see is best. I then assume we can build it for ourselves and activate WMTS there
I think that we can get it sorted before we release 3.8. It would probably be enough just to make sure that we aren't changing the view completely, and instead just set the required settings when we're activating a wmts layer.
Is your feature request related to a problem? Please describe. When a search is made and you are zoomed to the object the zoom level is quite zoomed out for us which isn´t always desirable.
Describe the solution you'd like The ability to set zoom level for search services in a map for each service in order to adapt it based on object that is searched for and the intended use of the map.
Describe alternatives you've considered Set same zoom level for search results for a map so that all search services use the same level in that map.