maplibre-gl-raster 0.8.0 → 0.9.0
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.
|
@@ -19136,8 +19136,8 @@ var PixelInspector = class {
|
|
|
19136
19136
|
//#region src/lib/ui/AddDataSection.ts
|
|
19137
19137
|
/**
|
|
19138
19138
|
* "Add data" section: URL input + Load button, plus a drop zone that accepts
|
|
19139
|
-
* `.tif` / `.tiff` files via click-to-browse
|
|
19140
|
-
* cog-viewer's EmptyState.
|
|
19139
|
+
* one or more `.tif` / `.tiff` files via click-to-browse (multi-select) or
|
|
19140
|
+
* drag-and-drop. Ported from cog-viewer's EmptyState.
|
|
19141
19141
|
*/
|
|
19142
19142
|
var AddDataSection = class {
|
|
19143
19143
|
/** Root element to insert into the panel. */
|
|
@@ -19149,6 +19149,11 @@ var AddDataSection = class {
|
|
|
19149
19149
|
*/
|
|
19150
19150
|
constructor(options) {
|
|
19151
19151
|
const isTiff = (file) => /\.tiff?$/i.test(file.name);
|
|
19152
|
+
const addFiles = (files) => {
|
|
19153
|
+
if (!files) return;
|
|
19154
|
+
const beforeId = currentBeforeId();
|
|
19155
|
+
for (const file of Array.from(files)) if (isTiff(file)) options.onAddFile(file, beforeId);
|
|
19156
|
+
};
|
|
19152
19157
|
const input = el("input", {
|
|
19153
19158
|
className: "mlr-input",
|
|
19154
19159
|
type: "text",
|
|
@@ -19250,17 +19255,19 @@ var AddDataSection = class {
|
|
|
19250
19255
|
const fileInput = el("input", {
|
|
19251
19256
|
type: "file",
|
|
19252
19257
|
ariaLabel: "raster-file",
|
|
19253
|
-
attrs: {
|
|
19258
|
+
attrs: {
|
|
19259
|
+
accept: ".tif,.tiff",
|
|
19260
|
+
multiple: ""
|
|
19261
|
+
}
|
|
19254
19262
|
});
|
|
19255
19263
|
fileInput.style.display = "none";
|
|
19256
19264
|
fileInput.addEventListener("change", () => {
|
|
19257
|
-
|
|
19258
|
-
if (f && isTiff(f)) options.onAddFile(f, currentBeforeId());
|
|
19265
|
+
addFiles(fileInput.files);
|
|
19259
19266
|
fileInput.value = "";
|
|
19260
19267
|
});
|
|
19261
19268
|
const dropZone = el("div", {
|
|
19262
19269
|
className: "mlr-drop-zone",
|
|
19263
|
-
text: "Drop
|
|
19270
|
+
text: "Drop .tif files here, or click to browse",
|
|
19264
19271
|
attrs: {
|
|
19265
19272
|
role: "button",
|
|
19266
19273
|
tabindex: "0"
|
|
@@ -19283,8 +19290,7 @@ var AddDataSection = class {
|
|
|
19283
19290
|
dropZone.addEventListener("drop", (e) => {
|
|
19284
19291
|
e.preventDefault();
|
|
19285
19292
|
dropZone.classList.remove("dragover");
|
|
19286
|
-
|
|
19287
|
-
if (f && isTiff(f)) options.onAddFile(f, currentBeforeId());
|
|
19293
|
+
addFiles(e.dataTransfer?.files);
|
|
19288
19294
|
});
|
|
19289
19295
|
this.el = el("div", { className: "mlr-section mlr-add-data" }, el("div", {
|
|
19290
19296
|
className: "mlr-section-title",
|
|
@@ -21424,4 +21430,4 @@ var RasterControl = class {
|
|
|
21424
21430
|
//#endregion
|
|
21425
21431
|
export { statsForBand as A, COLORMAP_NAMES as C, colormaps_default as D, colormapDisplayName as E, createResilientEpsgResolver as F, computeAutoStats as M, percentileFromHistogram as N, DEFAULT_INDEX_RANGE as O, readBandNames as P, COLORMAP_DISPLAY_NAMES as S, COLORMAP_ROW_COUNT as T, debounce as _, NORMALIZED_DIFFERENCE_INDICES as a, throttle as b, readPixelValues as c, PALETTE_COLORMAP as d, isKnownColormap as f, classNames as g, clamp as h, CUSTOM_NORMALIZED_DIFFERENCE as i, MAX_SAMPLE_TILES as j, autoRangeFor as k, DEFAULT_ENGINE as l, sampleColormapStops as m, Colorbar as n, guessBandForRole as o, loadColormapSprite as p, CUSTOM_INDEX_ID as r, indexById as s, RasterControl as t, LayerManager as u, formatNumericValue as v, COLORMAP_OPTIONS as w, loadGeoTIFF as x, generateId as y };
|
|
21426
21432
|
|
|
21427
|
-
//# sourceMappingURL=RasterControl-
|
|
21433
|
+
//# sourceMappingURL=RasterControl-BfTDWAnW.js.map
|