@arenarium/maps 1.3.9 → 1.3.10
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/main.js +6 -3
- package/package.json +2 -2
package/dist/main.js
CHANGED
|
@@ -192,6 +192,9 @@ class ut {
|
|
|
192
192
|
const n = e.bounds, r = e.center;
|
|
193
193
|
return n.sw.lng <= r.lng && n.ne.lng <= r.lng ? { sw: { lat: n.sw.lat, lng: -180 }, ne: { lat: n.ne.lat, lng: 180 } } : n.sw.lng >= r.lng && n.ne.lng >= r.lng ? { sw: { lat: n.sw.lat, lng: -180 }, ne: { lat: n.ne.lat, lng: 180 } } : Math.abs(n.ne.lng - r.lng) + Math.abs(n.sw.lng - r.lng) > 360 ? { sw: { lat: n.sw.lat, lng: -180 }, ne: { lat: n.ne.lat, lng: 180 } } : n.ne.lng - n.sw.lng > 360 ? { sw: { lat: n.sw.lat, lng: -180 }, ne: { lat: n.ne.lat, lng: 180 } } : e.bounds;
|
|
194
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* @param viewport - The viewport of the map.
|
|
197
|
+
*/
|
|
195
198
|
static create(e) {
|
|
196
199
|
const n = this.bounds(e), r = n.sw, i = n.ne;
|
|
197
200
|
return new ut(r.lat, r.lng, i.lat, i.lng);
|
|
@@ -3312,7 +3315,7 @@ function w(...t) {
|
|
|
3312
3315
|
};
|
|
3313
3316
|
}
|
|
3314
3317
|
var ii = /* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(-90), /* @__PURE__ */ ht(90)), si = /* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(-180), /* @__PURE__ */ ht(180)), Rt = /* @__PURE__ */ B({ lat: ii, lng: si }), ai = /* @__PURE__ */ B({ sw: Rt, ne: Rt }), Ca = /* @__PURE__ */ B({ bounds: ai, center: Rt, zoom: /* @__PURE__ */ P() }), Ze = /* @__PURE__ */ ri((t) => t instanceof HTMLElement, "Must be an HTMLElement"), Ra = /* @__PURE__ */ B({ mapSize: /* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(1)), zoomMin: /* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(0)), zoomMax: /* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(0)), zoomScale: /* @__PURE__ */ yn([/* @__PURE__ */ ze(1), /* @__PURE__ */ ze(2), /* @__PURE__ */ ze(10)]) }), Da = /* @__PURE__ */ B({ inserted: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ L([])), /* @__PURE__ */ $(/* @__PURE__ */ ni())), insert: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ L([])), /* @__PURE__ */ $(/* @__PURE__ */ Oe())), remove: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ L([])), /* @__PURE__ */ $(/* @__PURE__ */ Oe())), update: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ L([/* @__PURE__ */ P()])), /* @__PURE__ */ $(/* @__PURE__ */ Oe())) }), tr = /* @__PURE__ */ yn([/* @__PURE__ */ ze("idle"), /* @__PURE__ */ ze("move"), /* @__PURE__ */ ze("click")]), za = /* @__PURE__ */ B({ getParameters: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ L([])), /* @__PURE__ */ $(Ra)), getContainer: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ L([])), /* @__PURE__ */ $(Ze)), getZoom: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ L([])), /* @__PURE__ */ $(/* @__PURE__ */ P())), getBounds: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ L([])), /* @__PURE__ */ $(ai)), getCenter: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ L([])), /* @__PURE__ */ $(Rt)), getViewport: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ L([])), /* @__PURE__ */ $(Ca)), panBy: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ L([/* @__PURE__ */ P(), /* @__PURE__ */ P()])), /* @__PURE__ */ $(/* @__PURE__ */ Oe())), createMarker: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ L([Ze, ii, si, /* @__PURE__ */ P()])), /* @__PURE__ */ $(Da)), subscribe: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ L([tr, /* @__PURE__ */ I()])), /* @__PURE__ */ $(/* @__PURE__ */ Oe())), unsubscribe: /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ L([tr, /* @__PURE__ */ I()])), /* @__PURE__ */ $(/* @__PURE__ */ Oe())) }), Kt = /* @__PURE__ */ w(/* @__PURE__ */ I(), /* @__PURE__ */ O(/* @__PURE__ */ L([/* @__PURE__ */ ge(), Ze]))), Gt = /* @__PURE__ */ w(/* @__PURE__ */ B({ width: /* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(0)), height: /* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(0)), padding: /* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(0)) }), /* @__PURE__ */ Gr((t) => Math.min(t.width, t.height) / t.padding >= 4, "Minimum of width or height must be greater than or equal to 4 * padding")), Oa = /* @__PURE__ */ B({ background: /* @__PURE__ */ T(/* @__PURE__ */ ge()), radius: /* @__PURE__ */ T(/* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(0))), shadow: /* @__PURE__ */ T(/* @__PURE__ */ ge()) }), nr = /* @__PURE__ */ B({ background: /* @__PURE__ */ T(/* @__PURE__ */ ge()), radius: /* @__PURE__ */ T(/* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(0))), filter: /* @__PURE__ */ T(/* @__PURE__ */ ge()) }), La = /* @__PURE__ */ B({ id: /* @__PURE__ */ w(/* @__PURE__ */ ge(), /* @__PURE__ */ kn(1)), rank: /* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(0)), lat: /* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(-90), /* @__PURE__ */ ht(90)), lng: /* @__PURE__ */ w(/* @__PURE__ */ P(), /* @__PURE__ */ H(-180), /* @__PURE__ */ ht(180)), tooltip: /* @__PURE__ */ B({ element: Ze, style: /* @__PURE__ */ T(nr), dimensions: /* @__PURE__ */ T(Gt), initialize: /* @__PURE__ */ T(Kt) }), pin: /* @__PURE__ */ T(/* @__PURE__ */ B({ element: /* @__PURE__ */ T(Ze), style: /* @__PURE__ */ T(Oa), dimensions: /* @__PURE__ */ T(Gt), initialize: /* @__PURE__ */ T(Kt) })), popup: /* @__PURE__ */ T(/* @__PURE__ */ B({ element: Ze, style: /* @__PURE__ */ T(nr), dimensions: /* @__PURE__ */ T(Gt), initialize: /* @__PURE__ */ T(Kt) })) }), Fa = /* @__PURE__ */ w(/* @__PURE__ */ ge(), /* @__PURE__ */ Qr(32)), $a = /* @__PURE__ */ w(/* @__PURE__ */ ge(), /* @__PURE__ */ kn(1));
|
|
3315
|
-
const Va = "1.3.
|
|
3318
|
+
const Va = "1.3.9";
|
|
3316
3319
|
class ja {
|
|
3317
3320
|
apiKey;
|
|
3318
3321
|
apiJwt;
|
|
@@ -3355,7 +3358,7 @@ class ja {
|
|
|
3355
3358
|
return i.jwt && (this.apiJwt = i.jwt), i.states;
|
|
3356
3359
|
}
|
|
3357
3360
|
}
|
|
3358
|
-
const rr = "1.3.
|
|
3361
|
+
const rr = "1.3.9", Ua = "https://maps.api.arenarium.dev/auth", Wa = "https://maps.api.arenarium.dev/log", ir = 500;
|
|
3359
3362
|
class oi {
|
|
3360
3363
|
apiKey;
|
|
3361
3364
|
mapProvider;
|
|
@@ -3381,7 +3384,7 @@ class oi {
|
|
|
3381
3384
|
}
|
|
3382
3385
|
//#region Core
|
|
3383
3386
|
static async create(e, n, r) {
|
|
3384
|
-
|
|
3387
|
+
const a = (await da(Ua, { key: e, version: rr })).jwt;
|
|
3385
3388
|
if (!a) throw new Error("Failed to get api jwt");
|
|
3386
3389
|
return new oi(e, a, n, r);
|
|
3387
3390
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arenarium/maps",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.10",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "arenarium",
|
|
6
6
|
"description": "Visualize complex map markers clearly. A JavaScript library for effective display of map markers, compatible with MapLibre, Mapbox, and Google Maps.",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"**/*.css"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@arenarium/maps-core": "1.0.
|
|
41
|
+
"@arenarium/maps-core": "1.0.18",
|
|
42
42
|
"svelte": "^5.53.5",
|
|
43
43
|
"valibot": "^1.2.0"
|
|
44
44
|
},
|