@longline/aqua-ui 1.0.291 → 1.0.292
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.
|
@@ -87,13 +87,23 @@ var HtmlMarkerLayerBase = function (_a) {
|
|
|
87
87
|
return marker;
|
|
88
88
|
}, [idField, map]);
|
|
89
89
|
var updateMarkers = React.useCallback(function () {
|
|
90
|
-
var _a;
|
|
90
|
+
var _a, _b;
|
|
91
91
|
if (!map.getSource(sourceId))
|
|
92
92
|
return;
|
|
93
93
|
if (!map.isSourceLoaded(sourceId))
|
|
94
94
|
return;
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
// If outside zoom range, remove ALL markers:
|
|
96
|
+
var zoom = map.getZoom();
|
|
97
|
+
if (zoom < minZoom || zoom > maxZoom) {
|
|
98
|
+
for (var id in visibleRef.current) {
|
|
99
|
+
visibleRef.current[id].remove();
|
|
100
|
+
(_a = rootsRef.current[id]) === null || _a === void 0 ? void 0 : _a.unmount();
|
|
101
|
+
delete markersRef.current[id];
|
|
102
|
+
delete rootsRef.current[id];
|
|
103
|
+
}
|
|
104
|
+
visibleRef.current = {};
|
|
105
|
+
return; // Nothing else to do
|
|
106
|
+
}
|
|
97
107
|
var seen = {};
|
|
98
108
|
var features = map.querySourceFeatures(sourceId).filter(function (f) {
|
|
99
109
|
var _a;
|
|
@@ -114,7 +124,7 @@ var HtmlMarkerLayerBase = function (_a) {
|
|
|
114
124
|
for (var id in visibleRef.current) {
|
|
115
125
|
if (!newVisible[id]) {
|
|
116
126
|
visibleRef.current[id].remove();
|
|
117
|
-
(
|
|
127
|
+
(_b = rootsRef.current[id]) === null || _b === void 0 ? void 0 : _b.unmount();
|
|
118
128
|
delete markersRef.current[id];
|
|
119
129
|
delete rootsRef.current[id];
|
|
120
130
|
}
|