Skip to content

Commit

Permalink
- Bump to version 2.0.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
afabiani committed Jun 29, 2020
1 parent 5610f06 commit da54f54
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
5 changes: 3 additions & 2 deletions mapstore2_adapter/plugins/geonode.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,9 @@ def viewer_json(self, viewer, request):
output: GeoNode JSON Gxp Config
"""
# MapStore uses x0,y0,x1,y1 ordering of bbox coords
if viewer.get('map', None) and viewer['map'].get('bbox'):
viewer = to_json(viewer)
if viewer.get('map', None) and viewer['map'].get('bbox', None):
ms2_bbox = viewer['map'].get('bbox')
config_bbox = [ms2_bbox[0], ms2_bbox[2], ms2_bbox[1], ms2_bbox[3]]
viewer['map']['bbox'] = config_bbox
return to_json(viewer)
return viewer
12 changes: 5 additions & 7 deletions mapstore2_adapter/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,9 @@ def get_valid_number(number, default=None, complementar=False):

def to_json(config):
try:
basestring # noqa
except NameError:
# Python 3 does not declare basetring anymore
basestring = str

if isinstance(config, basestring):
return json.loads(config)
return config
except Exception:
try:
return json.loads(config.decode())
except Exception:
return config
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = django-mapstore-adapter
version = 2.0.4.3
version = 2.0.4.4
description = Django MapStore2 Adapter
author = Alessio Fabiani
author_email = [email protected]
Expand Down

0 comments on commit da54f54

Please sign in to comment.