From 1663f077c075c8902dbeff4acf68b1c8e0151853 Mon Sep 17 00:00:00 2001 From: stebogit Date: Fri, 7 Jul 2017 00:24:19 -0700 Subject: [PATCH] moved option definition in isobands to allow null values; fixed isobands example code; --- packages/turf-isobands/README.md | 2 +- packages/turf-isobands/index.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/turf-isobands/README.md b/packages/turf-isobands/README.md index 11dcccffe4..bade4c4b3c 100644 --- a/packages/turf-isobands/README.md +++ b/packages/turf-isobands/README.md @@ -27,7 +27,7 @@ for (var i = 0; i < pointGrid.features.length; i++) { pointGrid.features[i].properties.elevation = Math.random() * 10; } var breaks = [0, 5, 8.5]; -var isobands = turf.isobands(pointGrid, breaks, 'temp'); +var isobands = turf.isobands(pointGrid, breaks); //addToMap var addToMap = [isobands]; diff --git a/packages/turf-isobands/index.js b/packages/turf-isobands/index.js index 2c83564881..683cc6cca8 100644 --- a/packages/turf-isobands/index.js +++ b/packages/turf-isobands/index.js @@ -34,7 +34,7 @@ var featureCollection = helpers.featureCollection; * pointGrid.features[i].properties.elevation = Math.random() * 10; * } * var breaks = [0, 5, 8.5]; - * var isobands = turf.isobands(pointGrid, breaks, 'temp'); + * var isobands = turf.isobands(pointGrid, breaks); * * //addToMap * var addToMap = [isobands]; @@ -46,6 +46,7 @@ module.exports = function (pointGrid, breaks, zProperty, options) { }; collectionOf(pointGrid, 'Point', 'Input must contain Points'); if (!breaks || !Array.isArray(breaks)) throw new Error('breaks is required'); + options = options || {}; if (options.commonProperties && !isObject(options.commonProperties)) { throw new Error('commonProperties is not an Object'); } @@ -55,7 +56,6 @@ module.exports = function (pointGrid, breaks, zProperty, options) { if (zProperty && typeof zProperty !== 'string') { throw new Error('zProperty is not a string'); } zProperty = zProperty || 'elevation'; - options = options || {}; var commonProperties = options.commonProperties || {}; var isobandProperties = options.isobandProperties || [];