src/lib/sort_features.js
function sortFeatures(features) {
  return features.map(feature => {
    if (feature.geometry.type === Constants.geojsonTypes.POLYGON) {
      feature.area = area.geometry({
        type: Constants.geojsonTypes.FEATURE,
        property: {},
        geometry: feature.geometry
      });
    }
    return feature;
  }).sort(comparator).map(feature => {
    delete feature.area;
    return feature;
  });
}
function sortFeatures(features) {
  return features.map(feature => {
    if (feature.geometry.type === Constants.geojsonTypes.POLYGON) {
      feature.area = area.geometry({
        type: Constants.geojsonTypes.FEATURE,
        property: {},
        geometry: feature.geometry
      });
    }
    return feature;
  }).sort(comparator).map(feature => {
    delete feature.area;
    return feature;
  });
}
function sortFeatures ( features ) { return features . map ( feature => { if ( feature . geometry . type === Constants . geojsonTypes . POLYGON ) { feature . area = area . geometry ( { type : Constants . geojsonTypes . FEATURE , property : { } , geometry : feature . geometry } ) ; } return feature ; } ) . sort ( comparator ) . map ( feature => { delete feature . area ; return feature ; } ) ; }
Sort in the order above, then sort polygons by area ascending.
Sort in the order above then sort polygons by area ascending .