From 5bc74f52564593fe6e25f0f6ec3f6aaaa9732d30 Mon Sep 17 00:00:00 2001 From: Renaud Michaelis Date: Fri, 12 Jul 2024 15:41:18 +0200 Subject: [PATCH] Do not allow to click outside --- .../views/getfeatureinfo.py | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/geoportal/geoportailv3_geoportal/views/getfeatureinfo.py b/geoportal/geoportailv3_geoportal/views/getfeatureinfo.py index 851cba54b..eb8165012 100644 --- a/geoportal/geoportailv3_geoportal/views/getfeatureinfo.py +++ b/geoportal/geoportailv3_geoportal/views/getfeatureinfo.py @@ -356,21 +356,33 @@ def get_info(self, fid, coordinates_big_box, coordinates_small_box, coords = box2.split(',') the_box = box(float(coords[0]), float(coords[1]), float(coords[2]), float(coords[3])) + geometry = geojson_loads(geojson.dumps(mapping(the_box.centroid))) - f = self.to_feature(luxgetfeaturedefinition.layer, None, - geometry, - [], - [], - None) + + features = self._get_external_data( + luxgetfeaturedefinition.layer, + luxgetfeaturedefinition.rest_url, + None, + None, None, None, None, + None, + use_auth=luxgetfeaturedefinition.use_auth, + p_geometry=the_box.centroid.wkt, srs_geometry="2169") + f = [] + if len(features) > 0: + f = [self.to_feature(luxgetfeaturedefinition.layer, None, + geometry, + [], + [], + None)] results.append( self.to_featureinfo( - [f], + f, luxgetfeaturedefinition.layer, luxgetfeaturedefinition.template, is_ordered, luxgetfeaturedefinition.has_profile, luxgetfeaturedefinition.remote_template, - 1)) + len(f))) continue if (luxgetfeaturedefinition is not None and luxgetfeaturedefinition.engine_gfi is not None and