Skip to content

Commit

Permalink
Include geometry in query tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jfirebaugh committed May 19, 2016
1 parent a54d38b commit 43409c6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion js/util/vectortile_to_geojson.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Feature.prototype = {
toJSON: function() {
var json = {};
for (var i in this) {
if (i === '_geometry' || i === '_vectorTileFeature') continue;
if (i === '_geometry' || i === '_vectorTileFeature' || i === 'toJSON') continue;
json[i] = this[i];
}
return json;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"express": "^4.13.4",
"gl": "^2.1.5",
"istanbul": "^0.4.2",
"mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#d3dc8569b6782cfeead4a0989bf92efe1514071f",
"mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#069f121cadfd91a8bc50bcf2ae06bf7972750403",
"nyc": "^6.1.1",
"sinon": "^1.15.4",
"st": "^1.0.0",
Expand Down
10 changes: 4 additions & 6 deletions test/suite_implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,10 @@ module.exports = function(style, options, callback) {
map.remove();
gl.destroy();

callback(null, data, results.map(prepareFeatures));

function prepareFeatures(r) {
callback(null, data, results.map(function (r) {
r = r.toJSON();
delete r.layer;
r.geometry = null;
return JSON.parse(JSON.stringify(r));
}
return r;
}));
});
};

0 comments on commit 43409c6

Please sign in to comment.