@chrtco/sdk 0.10.55 → 0.10.57
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/CHANGELOG.md +38 -8
- package/README.md +31 -10
- package/dist/atlas/browser.cjs +5 -21
- package/dist/atlas/browser.cjs.map +1 -1
- package/dist/atlas/browser.js +5 -21
- package/dist/atlas/browser.js.map +1 -1
- package/dist/index.cjs +347 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2467 -2173
- package/dist/index.d.ts +2467 -2173
- package/dist/index.js +326 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/atlas/browser.js
CHANGED
|
@@ -19225,7 +19225,7 @@ var PIXEL_RATIO2 = 2;
|
|
|
19225
19225
|
var DB_NAME = "chrt-s52-atlas";
|
|
19226
19226
|
var DB_VERSION = 1;
|
|
19227
19227
|
var STORE_NAME = "bitmaps";
|
|
19228
|
-
var PARAM_VERSION = "
|
|
19228
|
+
var PARAM_VERSION = "v7";
|
|
19229
19229
|
function computeAtlasVersion() {
|
|
19230
19230
|
let h = 2166136261;
|
|
19231
19231
|
const mix = (s) => {
|
|
@@ -19245,24 +19245,9 @@ var ATLAS_VERSION = /* @__PURE__ */ computeAtlasVersion();
|
|
|
19245
19245
|
function makeKey(colorTable, name) {
|
|
19246
19246
|
return `${ATLAS_VERSION}:${colorTable}:${name}`;
|
|
19247
19247
|
}
|
|
19248
|
-
function
|
|
19249
|
-
|
|
19250
|
-
|
|
19251
|
-
`width="${renderSize}" height="${renderSize}"`
|
|
19252
|
-
);
|
|
19253
|
-
}
|
|
19254
|
-
function prepareSvg2(name, rawSvg, colorTable, renderSize) {
|
|
19255
|
-
const themed = applyColorTheme(rawSvg, colorTable);
|
|
19256
|
-
if (S52_LINE_SYMBOL_NAMES.has(name)) return themed;
|
|
19257
|
-
return upsampleSvg2(applyStrokeBoost(themed, S52_STROKE_BOOST), renderSize);
|
|
19258
|
-
}
|
|
19259
|
-
function rasterSize2(name, svg2) {
|
|
19260
|
-
if (S52_LINE_SYMBOL_NAMES.has(name)) {
|
|
19261
|
-
const size = readSvgSize(svg2);
|
|
19262
|
-
if (size) return size;
|
|
19263
|
-
}
|
|
19264
|
-
const square = renderSizeFor(name);
|
|
19265
|
-
return { w: square, h: square };
|
|
19248
|
+
function s52CacheRaster(name, rawSvg, colorTable) {
|
|
19249
|
+
const svg2 = prepareSvg(name, rawSvg, colorTable, renderSizeFor(name));
|
|
19250
|
+
return { svg: svg2, size: rasterSize(name, svg2) };
|
|
19266
19251
|
}
|
|
19267
19252
|
function hasIndexedDB() {
|
|
19268
19253
|
return typeof indexedDB !== "undefined";
|
|
@@ -19380,8 +19365,7 @@ async function loadS52SymbolImagesCached(map, colorTable = "DAY", opts = {}) {
|
|
|
19380
19365
|
missing.map(async (name) => {
|
|
19381
19366
|
const rawSvg = ALL_S52_SVGS[name];
|
|
19382
19367
|
if (!rawSvg) return;
|
|
19383
|
-
const themed =
|
|
19384
|
-
const size = rasterSize2(name, themed);
|
|
19368
|
+
const { svg: themed, size } = s52CacheRaster(name, rawSvg, colorTable);
|
|
19385
19369
|
const img = await decodeSvgToImage(themed, size);
|
|
19386
19370
|
if (!img) return;
|
|
19387
19371
|
if (isMapLive(map)) addImageToMap(map, name, img);
|