Add feature_json() view.
This commit is contained in:
parent
958264127a
commit
add230cd03
|
@ -57,6 +57,12 @@ def search_json(request):
|
|||
}
|
||||
return render_to_json_response(d)
|
||||
|
||||
def feature_json(request, id):
|
||||
id = str(id)
|
||||
srid = int(request.GET.get("srid",4326))
|
||||
feature = get_object_or_404_json(Feature, pk=id)
|
||||
return render_to_json_response(feature.get_geojson(srid))
|
||||
|
||||
def search_related_json(request, id):
|
||||
# id = request.GET.get("id", "0")
|
||||
id = str(id)
|
||||
|
|
|
@ -10,9 +10,9 @@ urlpatterns = patterns('',
|
|||
# Example:
|
||||
# (r'^gazetteer/', include('gazetteer.foo.urls')),
|
||||
(r'^$', 'places.views.search'),
|
||||
('^search$', 'places.views.search'),
|
||||
('^search/?$', 'places.views.search'),
|
||||
('^feature/search.json$', 'places.views.search_json'),
|
||||
# ('^search_related$', 'places.views.search_related'),
|
||||
('^feature/(?P<id>\d+).json$', 'places.views.feature_json'),
|
||||
('^feature/(?P<id>\d+)/similar.json$', 'places.views.search_related_json'),
|
||||
('^auth_record.json$', 'places.views.auth_record_json'),
|
||||
('^time_frame.json$', 'places.views.time_frame_json'),
|
||||
|
|
Loading…
Reference in New Issue
Block a user