magicrealmsshared 0.3.23 → 0.3.24

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.
@@ -8,4 +8,5 @@ export declare const ChunkSizeLong = 0.025;
8
8
  export declare const ChunkSizeLat = 0.025;
9
9
  export declare function ChunkCoordinatesAreEqual(...chunkCoordinates: ChunkCoordinates[]): boolean;
10
10
  export declare function ChunkCoordinatesOfGEOJSONPoint(point: GeoJSON.Point): ChunkCoordinates;
11
+ export declare function ChunkBoundaries(chunkCoordinates: ChunkCoordinates): number[];
11
12
  export declare function GEOJSONPointIsInChunks(point: GeoJSON.Point, ...chunkCoordinates: ChunkCoordinates[]): boolean;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ChunkSizeLat = exports.ChunkSizeLong = void 0;
4
4
  exports.ChunkCoordinatesAreEqual = ChunkCoordinatesAreEqual;
5
5
  exports.ChunkCoordinatesOfGEOJSONPoint = ChunkCoordinatesOfGEOJSONPoint;
6
+ exports.ChunkBoundaries = ChunkBoundaries;
6
7
  exports.GEOJSONPointIsInChunks = GEOJSONPointIsInChunks;
7
8
  exports.ChunkSizeLong = 0.025;
8
9
  exports.ChunkSizeLat = 0.025;
@@ -23,6 +24,15 @@ function ChunkCoordinatesOfGEOJSONPoint(point) {
23
24
  Math.floor(point.coordinates[1] / exports.ChunkSizeLat),
24
25
  ];
25
26
  }
27
+ //Long-Min, Long-Max, Lat-Min, Lat-Max
28
+ function ChunkBoundaries(chunkCoordinates) {
29
+ return [
30
+ chunkCoordinates[0] * exports.ChunkSizeLong,
31
+ (chunkCoordinates[0] + 1) * exports.ChunkSizeLong,
32
+ chunkCoordinates[1] * exports.ChunkSizeLat,
33
+ (chunkCoordinates[1] + 1) * exports.ChunkSizeLat,
34
+ ];
35
+ }
26
36
  function GEOJSONPointIsInChunks(point, ...chunkCoordinates) {
27
37
  const chunkCoordinatesOfPoint = ChunkCoordinatesOfGEOJSONPoint(point);
28
38
  for (const cc of chunkCoordinates) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magicrealmsshared",
3
- "version": "0.3.23",
3
+ "version": "0.3.24",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {