@evergis/react 3.1.107 → 3.1.108
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/dist/components/Dashboard/types.d.ts +1 -2
- package/dist/components/Layer/constants.d.ts +5 -5
- package/dist/components/Map/types.d.ts +1 -1
- package/dist/contexts/MapContext/types.d.ts +2 -2
- package/dist/core/classification/findAttributeInExpression.d.ts +1 -1
- package/dist/core/classification/getActualExtrusionHeight.d.ts +2 -2
- package/dist/index.js +8 -12
- package/dist/index.js.map +1 -1
- package/dist/react.esm.js +8 -12
- package/dist/react.esm.js.map +1 -1
- package/dist/types/styling.d.ts +2 -2
- package/package.json +5 -4
package/dist/react.esm.js
CHANGED
|
@@ -16,7 +16,7 @@ import { jsPDF } from 'jspdf';
|
|
|
16
16
|
import html2canvas from 'html2canvas';
|
|
17
17
|
import MapboxDraw from '@mapbox/mapbox-gl-draw';
|
|
18
18
|
import { geometryCollection, multiPolygon, polygon, multiLineString, multiPoint, point as point$1, bbox } from '@turf/turf';
|
|
19
|
-
import MapGL, { Source, Layer as Layer$1 } from 'react-map-gl/
|
|
19
|
+
import MapGL, { Source, Layer as Layer$1 } from 'react-map-gl/maplibre';
|
|
20
20
|
import '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css';
|
|
21
21
|
import 'mapbox-gl/dist/mapbox-gl.css';
|
|
22
22
|
import { Swiper, SwiperSlide } from 'swiper/react';
|
|
@@ -4896,12 +4896,10 @@ const useMapImages = ({ images }) => {
|
|
|
4896
4896
|
if (isSvgUrl(config.url)) {
|
|
4897
4897
|
// SVG: растеризуем через canvas
|
|
4898
4898
|
try {
|
|
4899
|
-
const { data
|
|
4899
|
+
const { data } = await loadSvgAsImage(config.url, size, pixelRatio);
|
|
4900
4900
|
map.current.addImage(config.name, data, {
|
|
4901
4901
|
sdf,
|
|
4902
4902
|
pixelRatio,
|
|
4903
|
-
width,
|
|
4904
|
-
height,
|
|
4905
4903
|
});
|
|
4906
4904
|
loadedImagesRef.current.add(config.name);
|
|
4907
4905
|
}
|
|
@@ -4914,12 +4912,7 @@ const useMapImages = ({ images }) => {
|
|
|
4914
4912
|
else {
|
|
4915
4913
|
// PNG/другие форматы: используем стандартную загрузку Mapbox
|
|
4916
4914
|
return new Promise((resolve, reject) => {
|
|
4917
|
-
map.current.loadImage(config.url
|
|
4918
|
-
if (error) {
|
|
4919
|
-
setErrors(prev => ({ ...prev, [config.name]: error.message }));
|
|
4920
|
-
reject(error);
|
|
4921
|
-
return;
|
|
4922
|
-
}
|
|
4915
|
+
map.current.loadImage(config.url).then((image) => {
|
|
4923
4916
|
if (image) {
|
|
4924
4917
|
map.current.addImage(config.name, image, {
|
|
4925
4918
|
sdf,
|
|
@@ -4928,6 +4921,9 @@ const useMapImages = ({ images }) => {
|
|
|
4928
4921
|
loadedImagesRef.current.add(config.name);
|
|
4929
4922
|
resolve();
|
|
4930
4923
|
}
|
|
4924
|
+
}).catch(error => {
|
|
4925
|
+
setErrors(prev => ({ ...prev, [config.name]: error.message }));
|
|
4926
|
+
reject(error);
|
|
4931
4927
|
});
|
|
4932
4928
|
});
|
|
4933
4929
|
}
|
|
@@ -11466,7 +11462,7 @@ const VectorLayer = ({ layer, tileUrl, visible, beforeId, getLayerTempStyle, fil
|
|
|
11466
11462
|
return null;
|
|
11467
11463
|
}).filter((config) => config !== null);
|
|
11468
11464
|
}, [clientStyle]);
|
|
11469
|
-
|
|
11465
|
+
useMapImages({ images: iconConfigs });
|
|
11470
11466
|
const renderLayerByGeometryType = useCallback(() => {
|
|
11471
11467
|
const visibility = visible ? "visible" : "none";
|
|
11472
11468
|
switch (geometryType) {
|
|
@@ -11619,7 +11615,7 @@ const MapWrapper = styled.div `
|
|
|
11619
11615
|
|
|
11620
11616
|
const Map$1 = ({ zIndex, lowerSiblings, upperSiblings, onError, children, ...rest }) => {
|
|
11621
11617
|
const { map, setLoaded } = useMapContext();
|
|
11622
|
-
return (jsxs(MapWrapper, { "$zIndex": zIndex, children: [lowerSiblings, jsx(MapGL, { ...rest, renderWorldCopies: true,
|
|
11618
|
+
return (jsxs(MapWrapper, { "$zIndex": zIndex, children: [lowerSiblings, jsx(MapGL, { ...rest, renderWorldCopies: true, doubleClickZoom: false, cursor: "default", onLoad: e => {
|
|
11623
11619
|
map.current = e.target;
|
|
11624
11620
|
map.current.on("error", onError);
|
|
11625
11621
|
setLoaded(true);
|