@arenarium/maps 1.0.183 → 1.0.185
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/dist/api.cjs.js +1 -1
- package/dist/api.es.js +2 -2
- package/dist/index.d.ts +7 -7
- package/dist/index.js +2 -2
- package/dist/main.cjs.js +2 -2
- package/dist/main.d.ts +7 -7
- package/dist/main.es.js +427 -416
- package/dist/{states-CxxqUf8M.js → states-CqXqpk4z.js} +1 -1
- package/dist/{states-O4d3qSXC.cjs → states-D6BEdwDG.cjs} +1 -1
- package/package.json +1 -1
package/dist/api.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var E=Object.defineProperty;var v=(l,o,n)=>o in l?E(l,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):l[o]=n;var h=(l,o,n)=>v(l,typeof o!="symbol"?o+"":o,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./states-
|
|
1
|
+
"use strict";var E=Object.defineProperty;var v=(l,o,n)=>o in l?E(l,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):l[o]=n;var h=(l,o,n)=>v(l,typeof o!="symbol"?o+"":o,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./states-D6BEdwDG.cjs");class B{constructor(o,n,i){h(this,"x");h(this,"y");h(this,"width");h(this,"height");h(this,"zoom");h(this,"angles");h(this,"expanded");h(this,"angle");h(this,"bounds");const c=f.Mercator.project(n.lat,n.lng,o.mapSize);this.x=c.x,this.y=c.y,this.width=n.width+2*n.margin,this.height=n.height+2*n.margin,this.zoom=i[0],this.angles=i[1].map(g=>[g[0],f.Angles.DEGREES[g[1]]]),this.expanded=!1,this.angle=0,this.bounds=void 0}getBounds(o,n){let{offsetX:i,offsetY:c}=f.Rectangle.getOffsets(this.width,this.height,n),g=-i,u=this.width-g,b=-c,e=this.height-b;return{x:this.x,y:this.y,left:g/o,right:u/o,top:b/o,bottom:e/o}}}function M(l,o,n){var b;if(o.length!=n.length)throw new Error("Data and states length must be the same");const i=new Array(o.length);for(let e=0;e<o.length;e++){const a=n[e];if(isNaN(a[0]))throw new Error("State zoom is not a number");if(a[1]==null||a[1].length==0)throw new Error("State angles is empty");if(a[0]!=a[1][0][0])throw new Error("State expand zoom and start angles zoom are not the same");const d=new B(l,o[e],n[e]);i[e]=d}const c=l.zoomMin,g=l.zoomMax,u=1/l.zoomScale;for(let e=c;e<=g;e+=u){const a=Math.pow(2,e);for(let d=0;d<i.length;d++){const t=i[d];if(t.expanded=t.zoom<e,t.expanded==!1)continue;const r=(b=t.angles.findLast(s=>s[0]<e))==null?void 0:b[1];if(r==null)throw new Error("Angle not found");t.angle=r,t.bounds=t.getBounds(a,r)}for(let d=0;d<i.length;d++){const t=i[d];if(t.bounds!=null)for(let r=d+1;r<i.length;r++){const s=i[r];if(s.bounds!=null&&f.Bounds.areOverlaping(t.bounds,s.bounds)){console.log("OVERLAP",e,o[d],o[r],t.angle,s.angle);const m=t.bounds.x-t.bounds.left,w=t.bounds.y-t.bounds.top,x=t.bounds.x+t.bounds.right,y=t.bounds.y+t.bounds.bottom;console.log(`B1: (${m}, ${w}), (${m}, ${y}), (${x}, ${w}), (${x}, ${y})`);const z=s.bounds.x-s.bounds.left,S=s.bounds.y-s.bounds.top,$=s.bounds.x+s.bounds.right,p=s.bounds.y+s.bounds.bottom;throw console.log(`B2: (${z}, ${S}), (${z}, ${p}), (${$}, ${S}), (${$}, ${p})`),new Error("Bounds overlaping")}}}}}exports.getStates=f.getStates;exports.testStates=M;
|
package/dist/api.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var E = Object.defineProperty;
|
|
2
2
|
var S = (l, o, n) => o in l ? E(l, o, { enumerable: !0, configurable: !0, writable: !0, value: n }) : l[o] = n;
|
|
3
3
|
var d = (l, o, n) => S(l, typeof o != "symbol" ? o + "" : o, n);
|
|
4
|
-
import { B as v, M as B, A, R as M } from "./states-
|
|
5
|
-
import { g as G } from "./states-
|
|
4
|
+
import { B as v, M as B, A, R as M } from "./states-CqXqpk4z.js";
|
|
5
|
+
import { g as G } from "./states-CqXqpk4z.js";
|
|
6
6
|
class R {
|
|
7
7
|
constructor(o, n, i) {
|
|
8
8
|
d(this, "x");
|
package/dist/index.d.ts
CHANGED
|
@@ -36,14 +36,14 @@ declare const mapConfigurationSchema: z.ZodObject<{
|
|
|
36
36
|
}>>;
|
|
37
37
|
api: z.ZodOptional<z.ZodObject<{
|
|
38
38
|
states: z.ZodOptional<z.ZodObject<{
|
|
39
|
-
url: z.ZodString
|
|
39
|
+
url: z.ZodOptional<z.ZodString>;
|
|
40
40
|
key: z.ZodString;
|
|
41
41
|
}, "strip", z.ZodTypeAny, {
|
|
42
|
-
url: string;
|
|
43
42
|
key: string;
|
|
43
|
+
url?: string | undefined;
|
|
44
44
|
}, {
|
|
45
|
-
url: string;
|
|
46
45
|
key: string;
|
|
46
|
+
url?: string | undefined;
|
|
47
47
|
}>>;
|
|
48
48
|
log: z.ZodOptional<z.ZodObject<{
|
|
49
49
|
enabled: z.ZodBoolean;
|
|
@@ -54,16 +54,16 @@ declare const mapConfigurationSchema: z.ZodObject<{
|
|
|
54
54
|
}>>;
|
|
55
55
|
}, "strip", z.ZodTypeAny, {
|
|
56
56
|
states?: {
|
|
57
|
-
url: string;
|
|
58
57
|
key: string;
|
|
58
|
+
url?: string | undefined;
|
|
59
59
|
} | undefined;
|
|
60
60
|
log?: {
|
|
61
61
|
enabled: boolean;
|
|
62
62
|
} | undefined;
|
|
63
63
|
}, {
|
|
64
64
|
states?: {
|
|
65
|
-
url: string;
|
|
66
65
|
key: string;
|
|
66
|
+
url?: string | undefined;
|
|
67
67
|
} | undefined;
|
|
68
68
|
log?: {
|
|
69
69
|
enabled: boolean;
|
|
@@ -82,8 +82,8 @@ declare const mapConfigurationSchema: z.ZodObject<{
|
|
|
82
82
|
} | undefined;
|
|
83
83
|
api?: {
|
|
84
84
|
states?: {
|
|
85
|
-
url: string;
|
|
86
85
|
key: string;
|
|
86
|
+
url?: string | undefined;
|
|
87
87
|
} | undefined;
|
|
88
88
|
log?: {
|
|
89
89
|
enabled: boolean;
|
|
@@ -102,8 +102,8 @@ declare const mapConfigurationSchema: z.ZodObject<{
|
|
|
102
102
|
} | undefined;
|
|
103
103
|
api?: {
|
|
104
104
|
states?: {
|
|
105
|
-
url: string;
|
|
106
105
|
key: string;
|
|
106
|
+
url?: string | undefined;
|
|
107
107
|
} | undefined;
|
|
108
108
|
log?: {
|
|
109
109
|
enabled: boolean;
|