mirror of
https://github.com/status-im/react-native-mapbox-gl.git
synced 2026-08-30 20:41:08 +00:00
Updated fitBounds to also accept an array so we can control padding on each side
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user