From cbfa24879c04c4eb08694386195dbfbd25cae04b Mon Sep 17 00:00:00 2001 From: Volker Mische Date: Thu, 7 Jul 2011 15:20:18 +0200 Subject: [PATCH] Use geometry from request. Newer versions of GeoCouch always contain the geometry, there's no need to emit it anymore. --- README.md | 3 +-- couchapp/lists/geojson.js | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9e09428..b01c8c7 100644 --- a/README.md +++ b/README.md @@ -165,8 +165,7 @@ Open a tool capable of handling KML feeds and import your query link: `http://lo #### geojson.js This function outputs a GeoJSON FeatureCollection (compatible with -OpenLayers). The geometry is stored in the `geometry` property, all -other properties in the `properties` property. +OpenLayers). Examples: diff --git a/couchapp/lists/geojson.js b/couchapp/lists/geojson.js index b72535a..965cf65 100644 --- a/couchapp/lists/geojson.js +++ b/couchapp/lists/geojson.js @@ -16,8 +16,7 @@ function(head, req) { send('{"type": "FeatureCollection", "features":['); while (row = getRow()) { - out = '{"type": "Feature", "geometry": ' + JSON.stringify(row.value.geometry); - delete row.value.geo; + out = '{"type": "Feature", "geometry": ' + JSON.stringify(row.geometry); out += ', "properties": ' + JSON.stringify(row.value) + '}'; send(sep + out);