geosolutions-it / MapStore2

The solution to create and share maps, dashboards, geostories with 3D support on the web. And it is open-source too!
https://mapstore.geosolutionsgroup.com/
Other
515 stars 403 forks source link

#10545: Option to disable identify popup in case of no results #10557

Closed mahmoudadel54 closed 1 month ago

mahmoudadel54 commented 2 months ago

Description

In this PR, it is implemented adding an option for identify plugin called 'hidePopupIfNoResults' = true to handle hide identify popup in case of no results for 'openlayers' and 'leaflet' for 2D maps.

Please check if the PR fulfills these requirements

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

Issue

10545

What is the current behavior?

10545

What is the new behavior? If 'hidePopupIfNoResults' is added to cfg in identify plugin by true ---> the identify popup will be hidden if there is no results.

Breaking change

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

Other useful information

To test it, for desktop add 'hidePopupIfNoResults' with true for cfg in identify plugin. For mobile, you need to add the identify plugin option 'hidePopupIfNoResults' with true for cfg and edit ---> DEFAULT_VISUALIZATION_MODES_CONFIG.[VisualizationModes._2D].mobile to MapLibraries.LEAFLET in this part below

https://github.com/geosolutions-it/MapStore2/blob/6c8e85240050c2e044e075b706e3e721004889d7/web/client/utils/MapTypeUtils.js#L27-L36

tdipisa commented 1 month ago

@ElenaGallo please test this on master and let us know if we can backport.

ElenaGallo commented 1 month ago

@tdipisa @mahmoudadel54 is it correct that when 'hidePopupIfNoResults' is set as true, the marker appears instead of the popup?

Use this map and see the video attached:

https://github.com/user-attachments/assets/797df10a-b831-4757-a08d-575105015a98

mahmoudadel54 commented 1 month ago

@tdipisa @mahmoudadel54 is it correct that when 'hidePopupIfNoResults' is set as true, the marker appears instead of the popup?

Use this map and see the video attached:

identify.mp4

Yes correct @ElenaGallo

tdipisa commented 1 month ago

I'm sorry @mahmoudadel54 Where we agreed for this? I don't think it is correct. Why should we show a marked alone? Indeed, when the popup is visible the marked is not needed and it is not displayed, of course

image

Why should we forcibly display it when 'hidePopupIfNoResults' is set as true?

@ElenaGallo remember to cover also the embedded map test.

ElenaGallo commented 1 month ago

Test passed, @mahmoudadel54 please backport to 2024.02.xx. Thanks

mahmoudadel54 commented 1 month ago

Test passed, @mahmoudadel54 please backport to 2024.02.xx. Thanks

@ElenaGallo backport is done ---> https://github.com/geosolutions-it/MapStore2/pull/10624