Updated fitBounds to also accept an array so we can control padding on each side

This commit is contained in:
Nick
2017-10-23 16:41:52 -07:00
parent 33f6cffce6
commit 7b7cdbe2f5
8 changed files with 219 additions and 24 deletions
+16 -2
View File
@@ -1,7 +1,7 @@
import turfHelpers from '@turf/helpers';
export function makePoint (coordinates) {
return turfHelpers.point(coordinates);
export function makePoint (coordinates, properties) {
return turfHelpers.point(coordinates, properties);
}
export function makeLatLngBounds (northEastCoordinates, southWestCoordinates) {
@@ -10,3 +10,17 @@ export function makeLatLngBounds (northEastCoordinates, southWestCoordinates) {
turfHelpers.point(southWestCoordinates),
]);
}
export function makeFeature(geometry, properties) {
return turfHelpers.feature(geometry, properties);
}
export function makeFeatureCollection (features = []) {
return turfHelpers.featureCollection(features);
}
export function addToFeatureCollection (featureCollection, feature) {
let shallowFeatureCollection = Object.assign({}, featureCollection);
featureCollection.features.push(feature);
return featureCollection;
}