@wemap/geo 3.1.7 → 3.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "directory": "packages/geo"
13
13
  },
14
14
  "name": "@wemap/geo",
15
- "version": "3.1.7",
15
+ "version": "3.1.8",
16
16
  "bugs": {
17
17
  "url": "https://github.com/wemap/wemap-modules-js/issues"
18
18
  },
@@ -33,5 +33,5 @@
33
33
  "lodash.isnumber": "^3.0.3",
34
34
  "lodash.isstring": "^4.0.1"
35
35
  },
36
- "gitHead": "57ceac64e857a53046b297774286024a157a57af"
36
+ "gitHead": "9e4ca5d422005858eca036b3e98ea3f854231fd0"
37
37
  }
@@ -221,6 +221,14 @@ class BoundingBox {
221
221
  new Coordinates(bounds[1], bounds[0])
222
222
  );
223
223
  }
224
+
225
+ /**
226
+ * Returns the WSEN array
227
+ * @returns {Number[4]} the WSEN array
228
+ */
229
+ toArray() {
230
+ return [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()];
231
+ }
224
232
  }
225
233
 
226
234
  export default BoundingBox;
@@ -55,7 +55,6 @@ describe('Bounding Box', () => {
55
55
  ))).false;
56
56
  });
57
57
 
58
-
59
58
  it('bounds', () => {
60
59
  boundingBox = new BoundingBox(northEast, southWest);
61
60
  expect(boundingBox.getNorth()).equals(northEast.lat);
@@ -173,5 +172,7 @@ describe('Bounding Box', () => {
173
172
  .be.closeTo(measure, 0.05 * measure);
174
173
  });
175
174
 
176
-
175
+ it('toArray', () => {
176
+ expect(new BoundingBox(northEast, southWest).toArray()).deep.equals([-20, -5, 40, 10]);
177
+ });
177
178
  });