diff --git a/g3w-admin/qdjango/api/projects/serializers.py b/g3w-admin/qdjango/api/projects/serializers.py index c7efcba94..fbc06e57a 100644 --- a/g3w-admin/qdjango/api/projects/serializers.py +++ b/g3w-admin/qdjango/api/projects/serializers.py @@ -823,16 +823,22 @@ def to_representation(self, instance): # Patch for Proj4 > 4.9.3 version if ret["crs"] in settings.G3W_PROJ4_EPSG.keys(): - proj4 = settings.G3W_PROJ4_EPSG[ret["crs"]] + proj4 = settings.G3W_PROJ4_EPSG[ret["crs"]]['proj4'] + extent = settings.G3W_PROJ4_EPSG[ret["crs"]]['extent'] + else: proj4 = crs.toProj4() + if crs.postgisSrid() in (4326, 3857): + extent = get_crs_bbox(crs) + else: + extent = [0, 0, 8388608, 8388608] ret['crs'] = { 'epsg': crs.postgisSrid(), 'proj4': proj4, 'geographic': crs.isGeographic(), 'axisinverted': crs.hasAxisInverted(), - 'extent': get_crs_bbox(crs) + 'extent': extent } # add metadata