Skip to content

Commit

Permalink
Merge pull request #161 from makinacorpus/geojson_precision_settings
Browse files Browse the repository at this point in the history
Geojson precision settings
  • Loading branch information
Gaël UTARD committed Jan 3, 2019
2 parents 445cc9c + 4736f6d commit f22816d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ CHANGELOG
4.4.5.dev0
==================

**Bug fix**
**New features**

- Geojson float precision settings.


4.4.4 (2018-11-27)
Expand Down
1 change: 1 addition & 0 deletions mapentity/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
'ACTION_HISTORY_LENGTH': 20,
'ANONYMOUS_VIEWS_PERMS': tuple(),
'GEOJSON_LAYERS_CACHE_BACKEND': 'default',
'GEOJSON_PRECISION': None,
'SERVE_MEDIA_AS_ATTACHMENT': True,
'SENDFILE_HTTP_HEADER': None,
'DRF_API_URL_PREFIX': r'^api/',
Expand Down
3 changes: 2 additions & 1 deletion mapentity/views/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from rest_framework_gis.serializers import GeoFeatureModelSerializer

from mapentity import models as mapentity_models
from ..settings import API_SRID
from ..settings import API_SRID, app_settings
from ..decorators import (view_cache_response_content, view_cache_latest,
view_permission_required)
from .. import serializers as mapentity_serializers
Expand All @@ -26,6 +26,7 @@ class MapEntityLayer(FilterListMixin, ModelViewMixin, GeoJSONLayerView):

force2d = True
srid = API_SRID
precision = app_settings.get('GEOJSON_PRECISION')

def __init__(self, *args, **kwargs):
super(MapEntityLayer, self).__init__(*args, **kwargs)
Expand Down

0 comments on commit f22816d

Please sign in to comment.