diff options
author | QuentinAndre <quentin.andre@imt-atlantique.net> | 2021-07-26 20:30:30 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-10-25 12:06:02 +0200 |
commit | 8eeb37c0648690e4ffca7234b710e44be4359b20 (patch) | |
tree | 338ffc42a3ec9f6a48d6289649804438380a83e8 /ishtar_common/models_common.py | |
parent | f74c43040a9ad2f7fac9cd16dc76f1bcdc533962 (diff) | |
download | Ishtar-8eeb37c0648690e4ffca7234b710e44be4359b20.tar.bz2 Ishtar-8eeb37c0648690e4ffca7234b710e44be4359b20.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): |