bajo-spatial 1.1.0 → 1.1.2

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bajo-spatial",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Spatial functions for Bajo Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -24,6 +24,7 @@
24
24
  },
25
25
  "homepage": "https://github.com/ardhi/bajo-spatial#readme",
26
26
  "dependencies": {
27
+ "@turf/turf": "^7.2.0",
27
28
  "geolib": "^3.3.4"
28
29
  }
29
30
  }
@@ -0,0 +1,16 @@
1
+ import turf from '@turf/turf'
2
+
3
+ async function factory (pkgName) {
4
+ const me = this
5
+
6
+ return class BajoSpatial extends this.lib.BajoPlugin {
7
+ constructor () {
8
+ super(pkgName, me.app)
9
+ this.alias = 'spatial'
10
+ this.config = {}
11
+ this.lib.turf = turf
12
+ }
13
+ }
14
+ }
15
+
16
+ export default factory
@@ -1,5 +1,5 @@
1
- import lngToTile from './lngToTile.js'
2
- import latToTile from './latToTile.js'
1
+ import lngToTile from './lng-to-tile.js'
2
+ import latToTile from './lat-to-tile.js'
3
3
 
4
4
  export default function (bounds, zoom, allTiles, withZ) {
5
5
  const x1 = lngToTile(bounds[0], zoom)
@@ -1,5 +1,5 @@
1
1
  async function buildBboxQuery ({ bbox, query, schema, options = {} } = {}) {
2
- const { merge, isEmpty } = this.app.bajo.lib._
2
+ const { merge, isEmpty } = this.lib._
3
3
  const props = schema.properties.map(item => item.name)
4
4
  const { bboxLatField = 'lat', bboxLngField = 'lng' } = options
5
5
  if (props.includes(bboxLatField) && props.includes(bboxLngField)) {
@@ -1,6 +1,6 @@
1
- import tileToLng from './tileToLng.js'
2
- import tileToLat from './tileToLat.js'
3
- import boundsToTiles from './boundsToTiles.js'
1
+ import tileToLng from './tile-to-lng.js'
2
+ import tileToLat from './tile-to-lat.js'
3
+ import boundsToTiles from './bounds-to-tiles.js'
4
4
 
5
5
  export default function (bounds, zoom) {
6
6
  const tiles = boundsToTiles(bounds, zoom)
@@ -1,5 +1,5 @@
1
- import tileToLng from './tileToLng.js'
2
- import tileToLat from './tileToLat.js'
1
+ import tileToLng from './tile-to-lng.js'
2
+ import tileToLat from './tile-to-lat.js'
3
3
 
4
4
  export default function (x, y, zoom) {
5
5
  const lng1 = tileToLng(x, zoom)
@@ -1,4 +1,4 @@
1
- import ddToDms from './ddToDms.js'
1
+ import ddToDms from './dd-to-dms.js'
2
2
 
3
3
  export default function (val, secPrecision) {
4
4
  const dms = ddToDms(val, secPrecision)
@@ -1,4 +1,4 @@
1
- import ddToDms from './ddToDms.js'
1
+ import ddToDms from './dd-to-dms.js'
2
2
 
3
3
  export default function (val, secPrecision) {
4
4
  const dms = ddToDms(val, secPrecision)
@@ -1,5 +1,5 @@
1
- import tileToLng from './tileToLng.js'
2
- import tileToLat from './tileToLat.js'
1
+ import tileToLng from './tile-to-lng.js'
2
+ import tileToLat from './tile-to-lat.js'
3
3
 
4
4
  export default function (x1, y1, x2, y2, zoom, extra) {
5
5
  const lng1 = tileToLng(x1, zoom)
@@ -1,4 +1,7 @@
1
1
  [{
2
2
  "prefix": "geolib",
3
- "root": "node_modules/geolib"
3
+ "root": "geolib:"
4
+ }, {
5
+ "prefix": "turf",
6
+ "root": "@turf/turf:"
4
7
  }]
package/plugin/.alias DELETED
@@ -1 +0,0 @@
1
- spatial
@@ -1 +0,0 @@
1
- {}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes