Skip to content

Commit

Permalink
moved option definition in isobands to allow null values;
Browse files Browse the repository at this point in the history
fixed isobands example code;
  • Loading branch information
stebogit committed Jul 7, 2017
1 parent 1851c45 commit 1663f07
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/turf-isobands/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
4 changes: 2 additions & 2 deletions packages/turf-isobands/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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');
}
Expand All @@ -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 || [];

Expand Down

0 comments on commit 1663f07

Please sign in to comment.