maplibre-gl-layer-control 0.19.0 → 0.19.1
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/README.md +1 -1
- package/dist/{LayerControl-BxSfUXK6.cjs → LayerControl-2Gi-t4dS.cjs} +34 -10
- package/dist/LayerControl-2Gi-t4dS.cjs.map +1 -0
- package/dist/{LayerControl-CvH3r0T2.js → LayerControl-Ccyj0y-D.js} +34 -10
- package/dist/LayerControl-Ccyj0y-D.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.mjs +1 -1
- package/dist/types/index.d.ts +15 -5
- package/package.json +1 -1
- package/dist/LayerControl-BxSfUXK6.cjs.map +0 -1
- package/dist/LayerControl-CvH3r0T2.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const LayerControl = require("./LayerControl-
|
|
3
|
+
const LayerControl = require("./LayerControl-2Gi-t4dS.cjs");
|
|
4
4
|
exports.CustomLayerRegistry = LayerControl.CustomLayerRegistry;
|
|
5
5
|
exports.LayerControl = LayerControl.LayerControl;
|
|
6
6
|
exports.clamp = LayerControl.clamp;
|
package/dist/index.mjs
CHANGED
package/dist/react.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const react = require("react");
|
|
4
|
-
const LayerControl = require("./LayerControl-
|
|
4
|
+
const LayerControl = require("./LayerControl-2Gi-t4dS.cjs");
|
|
5
5
|
function LayerControlReact({
|
|
6
6
|
map,
|
|
7
7
|
position = "top-right",
|
package/dist/react.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useRef, useEffect, useState, useCallback } from "react";
|
|
2
|
-
import { L as LayerControl, g as getLayerType, s as setLayerOpacity, p as cacheOriginalLayerStyle, q as restoreOriginalStyle, c as clamp, a as getLayerOpacity } from "./LayerControl-
|
|
2
|
+
import { L as LayerControl, g as getLayerType, s as setLayerOpacity, p as cacheOriginalLayerStyle, q as restoreOriginalStyle, c as clamp, a as getLayerOpacity } from "./LayerControl-Ccyj0y-D.js";
|
|
3
3
|
function LayerControlReact({
|
|
4
4
|
map,
|
|
5
5
|
position = "top-right",
|
package/dist/types/index.d.ts
CHANGED
|
@@ -397,6 +397,8 @@ export declare class LayerControl implements IControl {
|
|
|
397
397
|
private basemapLayerIdsProvided;
|
|
398
398
|
/** Set once onAdd has listed the map's layers (after any basemapStyleUrl fetch). */
|
|
399
399
|
private layersListed;
|
|
400
|
+
/** setLayerState calls made before the layers were listed, applied once they are. */
|
|
401
|
+
private pendingLayerStates;
|
|
400
402
|
/** Panel order set through setLayerOrder, used to order layers with nothing on the map. */
|
|
401
403
|
private layerOrderHint;
|
|
402
404
|
private widthFrame;
|
|
@@ -583,16 +585,24 @@ export declare class LayerControl implements IControl {
|
|
|
583
585
|
* Only layers the control already lists are updated, with one exception:
|
|
584
586
|
* `"Background"` adds the Background row when the control has none (a style
|
|
585
587
|
* whose basemap lives in style imports has no root basemap layers to detect,
|
|
586
|
-
* so the control would otherwise show no Background row).
|
|
587
|
-
*
|
|
588
|
-
*
|
|
589
|
-
*
|
|
588
|
+
* so the control would otherwise show no Background row).
|
|
589
|
+
*
|
|
590
|
+
* Until the control has listed the map's layers (during `onAdd`, and while a
|
|
591
|
+
* `basemapStyleUrl` fetch is in flight) the update is queued and applied
|
|
592
|
+
* once they are listed, since seeding state earlier would stop the control
|
|
593
|
+
* from detecting layers on its own.
|
|
590
594
|
*
|
|
591
595
|
* @param layerId The layer ID, or `"Background"` for the basemap row
|
|
592
596
|
* @param state The fields to change; omitted fields keep their value
|
|
593
|
-
* @returns True if a layer state was updated or
|
|
597
|
+
* @returns True if a layer state was updated, created or queued; false
|
|
598
|
+
* before the control is added to a map or for a layer it does not list
|
|
594
599
|
*/
|
|
595
600
|
setLayerState(layerId: string, state: Partial<Pick<LayerState, "visible" | "opacity" | "name">>): boolean;
|
|
601
|
+
/**
|
|
602
|
+
* Mark the map's layers as listed and apply setLayerState calls queued
|
|
603
|
+
* before then.
|
|
604
|
+
*/
|
|
605
|
+
private finishListing;
|
|
596
606
|
/**
|
|
597
607
|
* Set the order the panel lists layers in, then redraw the rows.
|
|
598
608
|
*
|