Closed PitWenkin closed 1 year ago
This only happens when adding at least one layer. When using MyMaps with custom click event, an empty popup is opened in addition to the popup generated by the custom click event.
This is solved in apiv4
Seems not to be fixed when having multiple layer enabled. Or depends ot the selected layers.
I have added the following layers to my map and they are enabled:
When clicking anywhere on the map the request
https://map.geoportail.lu/getfeatureinfo?&layers=147,682,685,808,1381,1713&box1=80527.82086990963,68763.1183303995,80776.20400911463,69010.864262241&box2=80645.8056779875,68880.79763218922,80658.22483494718,68893.18492878313&BBOX=678311.1618604744,6363356.649352871,689805.3799888578,6371000.352181388&WIDTH=1203&HEIGHT=800&X=975.875&Y=156.37890625&tooltip=1&lang=fr&srs=EPSG:3857&zoom=14
is triggered and returns
[{"remote_template": false, "template": "bus.html", "layer": "147", "ordered": false, "features": [], "has_profile": false, "total_features_count": 0, "features_count": 0, "tooltip": ""}, {"remote_template": false, "template": "default.html", "layer": "682", "ordered": false, "features": [], "has_profile": false, "total_features_count": 0, "features_count": 0, "tooltip": "\n"}, {"remote_template": false, "template": "default.html", "layer": "685", "ordered": false, "features": [], "has_profile": false, "total_features_count": 0, "features_count": 0, "tooltip": "\n"}, {"remote_template": false, "template": "default.html", "layer": "808", "ordered": false, "features": [], "has_profile": true, "total_features_count": 0, "features_count": 0, "tooltip": "\n"}, {"remote_template": false, "template": "default_table.html", "layer": "1381", "ordered": false, "features": [], "has_profile": false, "total_features_count": 0, "features_count": 0, "tooltip": "\n"}, {"remote_template": false, "template": "default.html", "layer": "1713", "ordered": false, "features": [], "has_profile": false, "total_features_count": 0, "features_count": 0, "tooltip": "\n"}]
All Layers except the Bus layer return \n
in their tooltip which results in a popup with 4 hr's.
https://github.com/Geoportail-Luxembourg/geoportailv3/blob/45722f46bd5e4650ed3b01b1920de3732f848186/geoportal/jsapi/src/map.js#L2639
Maybe the return should not be simply \n
or \n
should also be considered as an empty return.
https://github.com/Geoportail-Luxembourg/geoportailv3/blob/45722f46bd5e4650ed3b01b1920de3732f848186/geoportal/jsapi/src/map.js#L2713
yes you are right. The webservice returned a wrong answer. it should be ok now.
Seems to be fixed at a first glance. I will check in detail next week.
When using
showLayerInfoPopup: true
clicking anywhere on the map where no feature exists results in an empty popup e.g. https://apiv4.geoportail.lu/proj/1.0/build/apidoc/examples/#example14