diff options
author | QuentinAndre <quentin.andre@imt-atlantique.net> | 2021-07-26 20:30:30 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-09-01 12:36:46 +0200 |
commit | dccb0b5be17050731b352e8a7e422f31426cf884 (patch) | |
tree | 41bc4f6d3d87aab95fc1d4e921b26f5824d105be /ishtar_common/models_common.py | |
parent | 5f1ccd67fbeb5fc1fe69765b639ce6bddb70e988 (diff) | |
download | Ishtar-dccb0b5be17050731b352e8a7e422f31426cf884.tar.bz2 Ishtar-dccb0b5be17050731b352e8a7e422f31426cf884.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 5d1cd5d90..9b4dabf19 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): |