source: src/django_gheat/wlheatmap/feature.py@ 9596

Last change on this file since 9596 was 9596, checked in by rick, 14 years ago
  • Fixed the color and the URL locations references, to be more dynamic/logical.
  • Make the Organization do a catchall for the time beeing.
File size: 636 bytes
Line 
1from django.http import HttpResponse
2from gheat.models import Node
3
4import json
5
6
7
8def nodes_json(request):
9 geojson = []
10 for node in Node.objects.filter(**request.REQUEST):
11 item = {
12 "type": "Feature",
13 "properties": {
14 'name' : node.name,
15 'color' : 'rgb(0,255,0)',
16 },
17 "geometry": {
18 "type": "Point",
19 "coordinates": [
20 node.latitude,
21 node.longitude,
22 ]
23 }
24 }
25 geojson.append(item)
26 return HttpResponse(json.dumps({'type' : 'FeatureCollection', 'features' : geojson},indent=2), mimetype="text/plain")
Note: See TracBrowser for help on using the repository browser.