drf-react-by-schema 0.28.12 → 0.28.13
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeoThumbCell.d.ts","sourceRoot":"","sources":["../../../src/components/DataGridBySchemaEditable/GeoThumbCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAQzC,OAAO,EAAE,iBAAiB,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"GeoThumbCell.d.ts","sourceRoot":"","sources":["../../../src/components/DataGridBySchemaEditable/GeoThumbCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAQzC,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAe,MAAM,cAAc,CAAC;AAyD5E,UAAU,iBAAiB;IACzB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,QAAQ,EACR,KAAK,EACL,KAAwB,EACxB,MAAyB,GAC1B,EAAE,iBAAiB,qBAoCnB"}
|
|
@@ -44,27 +44,30 @@ const styles_1 = require("@mui/material/styles");
|
|
|
44
44
|
const leaflet_1 = __importDefault(require("leaflet"));
|
|
45
45
|
const leafletMarker_1 = require("../forms/inputs/leafletMarker");
|
|
46
46
|
const utils_1 = require("../../utils");
|
|
47
|
+
const MapGeometryPicker_1 = require("../forms/inputs/MapGeometryPicker");
|
|
47
48
|
const geoConstants_1 = require("./geoConstants");
|
|
48
49
|
// L.geoJSON point markers use L.Icon.Default; ensure it points at a servable icon.
|
|
49
50
|
(0, leafletMarker_1.applyDefaultLeafletIcon)();
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const HYBRID_SATELLITE_ATTR = 'Esri, Maxar, Earthstar Geographics, and the GIS User Community';
|
|
54
|
-
const HYBRID_LABELS_ATTR = 'Esri, TomTom, Garmin, FAO, NOAA, USGS, © OpenStreetMap';
|
|
55
|
-
/** Renders the hybrid satellite + labels base layer (static, no user interaction). */
|
|
51
|
+
/** Renders the base tile layer for the thumbnail.
|
|
52
|
+
* Reads the first entry from theme.mapLayers (same array the picker uses);
|
|
53
|
+
* falls back to DEFAULT_LAYERS[0] (hybrid satellite + labels) when absent. */
|
|
56
54
|
function BaseLayer() {
|
|
57
55
|
const map = (0, react_leaflet_1.useMap)();
|
|
56
|
+
const theme = (0, styles_1.useTheme)();
|
|
58
57
|
(0, react_1.useEffect)(() => {
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
satellite.
|
|
65
|
-
labels.
|
|
66
|
-
|
|
67
|
-
|
|
58
|
+
const layers = theme.mapLayers;
|
|
59
|
+
const cfg = layers && layers.length > 0 ? layers[0] : MapGeometryPicker_1.DEFAULT_LAYERS[0];
|
|
60
|
+
if (cfg.title === 'Hybrid') {
|
|
61
|
+
const satellite = leaflet_1.default.tileLayer(cfg.url, { attribution: cfg.attribution });
|
|
62
|
+
const labels = leaflet_1.default.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/{z}/{y}/{x}', { attribution: 'Esri, TomTom, Garmin, FAO, NOAA, USGS, © OpenStreetMap' });
|
|
63
|
+
satellite.addTo(map);
|
|
64
|
+
labels.addTo(map);
|
|
65
|
+
return () => { satellite.remove(); labels.remove(); };
|
|
66
|
+
}
|
|
67
|
+
const tl = leaflet_1.default.tileLayer(cfg.url, { attribution: cfg.attribution });
|
|
68
|
+
tl.addTo(map);
|
|
69
|
+
return () => { tl.remove(); };
|
|
70
|
+
}, [map, theme]);
|
|
68
71
|
return null;
|
|
69
72
|
}
|
|
70
73
|
// Fits the rendered geometry and keeps the thumb static (no pan/zoom).
|
package/package.json
CHANGED