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

"launchInfoPanel" option in search does not work with "showInMapPopup" #10669

Open
1 task done
tha-nordiq opened this issue Nov 13, 2024 · 0 comments
Open
1 task done
Labels

Comments

@tha-nordiq
Copy link
Contributor

tha-nordiq commented Nov 13, 2024

Description

In embedded maps i want Identify to show as a popup with
"showInMapPopup"

But the when i configure a search-service to
"launchInfoPanel" the "FEATURE_INFO_CLICK" action is fired but then a subsequent "MAP:CLEAN_POPUPS" is fired that closes the popup

How to reproduce

Here is my pluginconfiguration for identify and search

                 {
                        "name": "Identify",
                        "cfg": {
                            "showInMapPopup": true,
                            "viewerOptions": {
                                "container": "{context.ReactSwipe}"
                            }
                        }
                    },
                    {
                        "name": "Search",
                        "cfg": {
                            "showOptions": false,
                            "withToggle": true,
                            "searchOptions": {
                                "services":[
                                {
                                    "type": "nominatim",
                                    "searchTextTemplate": "${properties.display_name}",
                                    "options": {
                                        "polygon_geojson": 1,
                                        "limit": 3,
                                        "typeName": "geosolutions:points"
                                    },
                                    "launchInfoPanel": true
                                }]
                            }
                        }
                    }

Expected Result
"FEATURE_INFO_CLICK" is carried out and results are shown in a popup

Current Result
"FEATURE_INFO_CLICK" is carried out but the popup is cleared with "MAP:CLEAN_POPUPS"

  • Not browser related

Other useful information

full html example

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Page with MapStore API</title>
        <link rel="preconnect" href="https://fonts.gstatic.com">
        <link href="https://fonts.googleapis.com/css2?family=Noto+Sans&display=swap" rel="stylesheet">
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.1/leaflet.css" />
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/1.0.2/leaflet.draw.css" />
        <link rel="shortcut icon" type="image/png" href="https://cdn.jslibs.mapstore2.geo-solutions.it/leaflet/favicon.ico" />
        <script src="https://maps.google.com/maps/api/js?v=3"></script>
        <!--script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.10/proj4.js"></script-->
        <script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.1/leaflet.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/1.0.2/leaflet.draw.js"></script>
        <style>
        #container {
            position: absolute;
            top: 100px;
            left: 100px;
            right: 100px;
            bottom: 100px;
        }
        #mapstore2-embedded, #map, .fill {
            width: 100%;
            height: 100%;
        }
        </style>
    </head>
    <body onload="init()">
        <div id="container" class="ms2"></div>
        <script id="ms2-api" src="https://mapstore.geosolutionsgroup.com/mapstore/dist/ms2-api.js?v2024.02.00-stable"></script>
        <script type="text/javascript">
        function init() {
            MapStore2.create('container',{
                plugins: [
                'Map',
                    {
                        "name": "Identify",
                        "cfg": {
                            "showInMapPopup": true,
                            "viewerOptions": {
                                "container": "{context.ReactSwipe}"
                            }
                        }
                    },
                    {
                        "name": "Search",
                        "cfg": {
                            "showOptions": false,
                            "withToggle": true,
                            "searchOptions": {
                                "services":[
                                {
                                    "type": "nominatim",
                                    "searchTextTemplate": "${properties.display_name}", // text to use as searchText when an item is selected. Gets the result properties.
                                    "options": {
                                        "polygon_geojson": 1,
                                        "limit": 3,
                                        "typeName": "geosolutions:points"
                                    },
                                    "launchInfoPanel": true
                                }]
                            }
                        }
                    },
                    "OmniBar"

                ],
                configUrl: "https://mapstore.geosolutionsgroup.com/mapstore/rest/geostore/data/7903",
                originalUrl: "https://mapstore.geosolutionsgroup.com/mapstore/#/viewer/7903"
            });
        }
        </script>
    </body>
</html>
@tha-nordiq tha-nordiq added the bug label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant