diff options
Diffstat (limited to 'app/projects')
-rw-r--r-- | app/projects/natparks.js | 2 | ||||
-rw-r--r-- | app/projects/shortcuts.py | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/app/projects/natparks.js b/app/projects/natparks.js index 8e4748b..8481408 100644 --- a/app/projects/natparks.js +++ b/app/projects/natparks.js @@ -3,7 +3,7 @@ function mapit(lat,lon,zoom,id) { map = L.map(document.getElementById("map-wrapper-"+id)); centerCoord = new L.LatLng(lat, lon); zoom = zoom; - L.tileLayer.provider('Esri.WorldTopoMap', {maxZoom: 18, attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Tiles © Esri and the GIS User Community'}).addTo(map); + L.tileLayer.provider('Esri.WorldTopoMap', {maxZoom: 18, attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Tiles © Esri and the GIS User Community'}).addTo(map); map.setView(centerCoord, zoom); ////get the geojson for this map $.ajax({ diff --git a/app/projects/shortcuts.py b/app/projects/shortcuts.py index d54410c..90b1bb6 100644 --- a/app/projects/shortcuts.py +++ b/app/projects/shortcuts.py @@ -1,7 +1,7 @@ from django.contrib.gis.db.models.fields import GeometryField
#from django.contrib.gis.gdal import Envelope
from django.contrib.gis.geos import Polygon
-from django.utils import simplejson
+import json
from django.http import HttpResponse
#from django.db.models.fields.related import ManyRelatedManager
@@ -192,7 +192,7 @@ def render_to_geojson(query_set, geom_field=None, geom_attribute=None, extra_att if g:
if proj_transform:
g.transform(proj_transform)
- feat['geometry'] = simplejson.loads(g.geojson)
+ feat['geometry'] = json.loads(g.geojson)
feat['properties'] = d
features.append(feat)
else:
@@ -227,9 +227,9 @@ def render_to_geojson(query_set, geom_field=None, geom_attribute=None, extra_att # Return response
response = HttpResponse()
if pretty_print:
- response.write('%s' % simplejson.dumps(collection, indent=1))
+ response.write('%s' % json.dumps(collection, indent=1))
else:
- response.write('%s' % simplejson.dumps(collection))
+ response.write('%s' % json.dumps(collection))
response['Content-length'] = str(len(response.content))
response['Content-Type'] = mimetype
- return response
\ No newline at end of file + return response
|