diff options
author | QuentinAndre <quentin.andre@imt-atlantique.net> | 2021-07-26 20:30:30 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-11-16 17:04:41 +0100 |
commit | 4fd4a7ede4aecc9b77cfeb80b91bb4593c2ba026 (patch) | |
tree | 0330f26c774d5733ca1a3bc6b421e8f56f614ec0 /ishtar_common/models_common.py | |
parent | 8667a4b03d275e71f1173cb0a1c1a3c4e7051445 (diff) | |
download | Ishtar-4fd4a7ede4aecc9b77cfeb80b91bb4593c2ba026.tar.bz2 Ishtar-4fd4a7ede4aecc9b77cfeb80b91bb4593c2ba026.zip |
all in jquery and get_geo_items fixes
Diffstat (limited to 'ishtar_common/models_common.py')
-rw-r--r-- | ishtar_common/models_common.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py index 4691de69c..7ee508a00 100644 --- a/ishtar_common/models_common.py +++ b/ishtar_common/models_common.py @@ -2871,16 +2871,16 @@ class GeoItem(models.Model): dict["geometry"]["coordinates"] = list_coords else: dict["geometry"]["type"] = "Point" - if self.multi_polygon: - dict["geometry"]["coordinates"] = self.convert_coordinates( - self.multi_polygon.centroid, rounded - ) - else: + if self.point_2d: try: x, y = self.display_coordinates dict["geometry"]["coordinates"] = [x, y] except ValueError: dict["geometry"]["coordinates"] = [] + else: + dict["geometry"]["coordinates"] = self.convert_coordinates( + self.multi_polygon.centroid, rounded + ) return dict def convert_coordinates(self, point_2d, rounded): |