add immoweb ui
This commit is contained in:
parent
7e8c79d3d1
commit
151da16c27
266 changed files with 264879 additions and 0 deletions
35
immoweb/node_modules/@turf/bbox/index.js
generated
vendored
Normal file
35
immoweb/node_modules/@turf/bbox/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
var each = require('@turf/meta').coordEach;
|
||||
|
||||
/**
|
||||
* Takes a set of features, calculates the bbox of all input features, and returns a bounding box.
|
||||
*
|
||||
* @name bbox
|
||||
* @param {(Feature|FeatureCollection)} geojson input features
|
||||
* @returns {Array<number>} bbox extent in [minX, minY, maxX, maxY] order
|
||||
* @addToMap features, bboxPolygon
|
||||
* @example
|
||||
* var pt1 = turf.point([114.175329, 22.2524])
|
||||
* var pt2 = turf.point([114.170007, 22.267969])
|
||||
* var pt3 = turf.point([114.200649, 22.274641])
|
||||
* var pt4 = turf.point([114.200649, 22.274641])
|
||||
* var pt5 = turf.point([114.186744, 22.265745])
|
||||
* var features = turf.featureCollection([pt1, pt2, pt3, pt4, pt5])
|
||||
*
|
||||
* var bbox = turf.bbox(features);
|
||||
*
|
||||
* var bboxPolygon = turf.bboxPolygon(bbox);
|
||||
*
|
||||
* //=bbox
|
||||
*
|
||||
* //=bboxPolygon
|
||||
*/
|
||||
module.exports = function (geojson) {
|
||||
var bbox = [Infinity, Infinity, -Infinity, -Infinity];
|
||||
each(geojson, function (coord) {
|
||||
if (bbox[0] > coord[0]) bbox[0] = coord[0];
|
||||
if (bbox[1] > coord[1]) bbox[1] = coord[1];
|
||||
if (bbox[2] < coord[0]) bbox[2] = coord[0];
|
||||
if (bbox[3] < coord[1]) bbox[3] = coord[1];
|
||||
});
|
||||
return bbox;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue