mirror of
https://github.com/status-im/react-native-mapbox-gl.git
synced 2026-08-31 13:01:15 +00:00
27 lines
803 B
JavaScript
27 lines
803 B
JavaScript
import turfHelpers from '@turf/helpers';
|
|
|
|
export function makePoint (coordinates, properties) {
|
|
return turfHelpers.point(coordinates, properties);
|
|
}
|
|
|
|
export function makeLatLngBounds (northEastCoordinates, southWestCoordinates) {
|
|
return turfHelpers.featureCollection([
|
|
turfHelpers.point(northEastCoordinates),
|
|
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;
|
|
}
|