@performant-software/geospatial 2.2.20-beta.4 → 2.2.20-beta.6
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/index.cjs14.js +1 -1
- package/dist/index.cjs15.js +1 -1
- package/dist/index.cjs17.js +1 -1
- package/dist/index.cjs19.js +1 -1
- package/dist/index.cjs20.js +1 -1
- package/dist/index.cjs21.js +1 -1
- package/dist/index.cjs244.js +1 -1
- package/dist/index.cjs249.js +1 -1
- package/dist/index.cjs252.js +1 -1
- package/dist/index.cjs256.js +1 -1
- package/dist/index.cjs256.js.map +1 -1
- package/dist/index.cjs257.js +1 -1
- package/dist/index.cjs257.js.map +1 -1
- package/dist/index.cjs58.js +1 -1
- package/dist/index.cjs59.js +9 -1
- package/dist/index.cjs59.js.map +1 -1
- package/dist/index.cjs60.js +19 -1
- package/dist/index.cjs60.js.map +1 -1
- package/dist/index.cjs61.js +1 -9
- package/dist/index.cjs61.js.map +1 -1
- package/dist/index.cjs62.js +1 -19
- package/dist/index.cjs62.js.map +1 -1
- package/dist/index.cjs63.js +1 -1
- package/dist/index.cjs63.js.map +1 -1
- package/dist/index.cjs64.js +1 -1
- package/dist/index.cjs64.js.map +1 -1
- package/dist/index.cjs75.js +1 -1
- package/dist/index.cjs75.js.map +1 -1
- package/dist/index.cjs76.js +1 -1
- package/dist/index.cjs76.js.map +1 -1
- package/dist/index.cjs77.js +1 -1
- package/dist/index.cjs77.js.map +1 -1
- package/dist/index.cjs78.js +1 -1
- package/dist/index.cjs78.js.map +1 -1
- package/dist/index.cjs79.js +1 -1
- package/dist/index.cjs79.js.map +1 -1
- package/dist/index.es14.js +2 -2
- package/dist/index.es15.js +3 -3
- package/dist/index.es17.js +3 -3
- package/dist/index.es19.js +1 -1
- package/dist/index.es20.js +2 -2
- package/dist/index.es21.js +2 -2
- package/dist/index.es244.js +1 -1
- package/dist/index.es249.js +1 -1
- package/dist/index.es252.js +1 -1
- package/dist/index.es256.js +4 -15
- package/dist/index.es256.js.map +1 -1
- package/dist/index.es257.js +15 -4
- package/dist/index.es257.js.map +1 -1
- package/dist/index.es58.js +2 -6
- package/dist/index.es58.js.map +1 -1
- package/dist/index.es59.js +30 -2
- package/dist/index.es59.js.map +1 -1
- package/dist/index.es60.js +602 -2
- package/dist/index.es60.js.map +1 -1
- package/dist/index.es61.js +105 -28
- package/dist/index.es61.js.map +1 -1
- package/dist/index.es62.js +10 -602
- package/dist/index.es62.js.map +1 -1
- package/dist/index.es63.js +5 -106
- package/dist/index.es63.js.map +1 -1
- package/dist/index.es64.js +2 -10
- package/dist/index.es64.js.map +1 -1
- package/dist/index.es75.js +2 -28
- package/dist/index.es75.js.map +1 -1
- package/dist/index.es76.js +2 -51
- package/dist/index.es76.js.map +1 -1
- package/dist/index.es77.js +25 -62
- package/dist/index.es77.js.map +1 -1
- package/dist/index.es78.js +51 -2
- package/dist/index.es78.js.map +1 -1
- package/dist/index.es79.js +65 -2
- package/dist/index.es79.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es79.js
CHANGED
|
@@ -1,5 +1,68 @@
|
|
|
1
|
-
|
|
1
|
+
import * as u from "react";
|
|
2
|
+
import { useContext as f, useRef as y, useState as m, useMemo as g, useEffect as S, cloneElement as h } from "react";
|
|
3
|
+
import { MapContext as C } from "./index.es66.js";
|
|
4
|
+
import s from "./index.es188.js";
|
|
5
|
+
import { deepEqual as v } from "./index.es187.js";
|
|
6
|
+
let x = 0;
|
|
7
|
+
function U(t, e, a) {
|
|
8
|
+
if (t.style && t.style._loaded) {
|
|
9
|
+
const n = { ...a };
|
|
10
|
+
return delete n.id, delete n.children, t.addSource(e, n), t.getSource(e);
|
|
11
|
+
}
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
function b(t, e, a) {
|
|
15
|
+
s(e.id === a.id, "source id changed"), s(e.type === a.type, "source type changed");
|
|
16
|
+
let n = "", r = 0;
|
|
17
|
+
for (const o in e)
|
|
18
|
+
o !== "children" && o !== "id" && !v(a[o], e[o]) && (n = o, r++);
|
|
19
|
+
if (!r)
|
|
20
|
+
return;
|
|
21
|
+
const l = e.type;
|
|
22
|
+
if (l === "geojson")
|
|
23
|
+
t.setData(e.data);
|
|
24
|
+
else if (l === "image")
|
|
25
|
+
t.updateImage({
|
|
26
|
+
url: e.url,
|
|
27
|
+
coordinates: e.coordinates
|
|
28
|
+
});
|
|
29
|
+
else if ("setCoordinates" in t && r === 1 && n === "coordinates")
|
|
30
|
+
t.setCoordinates(e.coordinates);
|
|
31
|
+
else if ("setUrl" in t)
|
|
32
|
+
switch (n) {
|
|
33
|
+
case "url":
|
|
34
|
+
t.setUrl(e.url);
|
|
35
|
+
break;
|
|
36
|
+
case "tiles":
|
|
37
|
+
t.setTiles(e.tiles);
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
else
|
|
41
|
+
console.warn(`Unable to update <Source> prop: ${n}`);
|
|
42
|
+
}
|
|
43
|
+
function R(t) {
|
|
44
|
+
const e = f(C).map.getMap(), a = y(t), [, n] = m(0), r = g(() => t.id || `jsx-source-${x++}`, []);
|
|
45
|
+
S(() => {
|
|
46
|
+
if (e) {
|
|
47
|
+
const o = () => setTimeout(() => n((i) => i + 1), 0);
|
|
48
|
+
return e.on("styledata", o), o(), () => {
|
|
49
|
+
var i;
|
|
50
|
+
if (e.off("styledata", o), e.style && e.style._loaded && e.getSource(r)) {
|
|
51
|
+
const c = (i = e.getStyle()) === null || i === void 0 ? void 0 : i.layers;
|
|
52
|
+
if (c)
|
|
53
|
+
for (const d of c)
|
|
54
|
+
d.source === r && e.removeLayer(d.id);
|
|
55
|
+
e.removeSource(r);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}, [e]);
|
|
60
|
+
let l = e && e.style && e.getSource(r);
|
|
61
|
+
return l ? b(l, t, a.current) : l = U(e, r, t), a.current = t, l && u.Children.map(t.children, (o) => o && h(o, {
|
|
62
|
+
source: r
|
|
63
|
+
})) || null;
|
|
64
|
+
}
|
|
2
65
|
export {
|
|
3
|
-
|
|
66
|
+
R as default
|
|
4
67
|
};
|
|
5
68
|
//# sourceMappingURL=index.es79.js.map
|
package/dist/index.es79.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es79.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
1
|
+
{"version":3,"file":"index.es79.js","sources":["../../../node_modules/react-map-gl/dist/esm/components/source.js"],"sourcesContent":["import * as React from 'react';\nimport { useContext, useEffect, useMemo, useState, useRef } from 'react';\nimport { cloneElement } from 'react';\nimport { MapContext } from './map';\nimport assert from '../utils/assert';\nimport { deepEqual } from '../utils/deep-equal';\nlet sourceCounter = 0;\nfunction createSource(map, id, props) {\n // @ts-ignore\n if (map.style && map.style._loaded) {\n const options = { ...props };\n delete options.id;\n delete options.children;\n // @ts-ignore\n map.addSource(id, options);\n return map.getSource(id);\n }\n return null;\n}\n/* eslint-disable complexity */\nfunction updateSource(source, props, prevProps) {\n assert(props.id === prevProps.id, 'source id changed');\n assert(props.type === prevProps.type, 'source type changed');\n let changedKey = '';\n let changedKeyCount = 0;\n for (const key in props) {\n if (key !== 'children' && key !== 'id' && !deepEqual(prevProps[key], props[key])) {\n changedKey = key;\n changedKeyCount++;\n }\n }\n if (!changedKeyCount) {\n return;\n }\n const type = props.type;\n if (type === 'geojson') {\n source.setData(props.data);\n }\n else if (type === 'image') {\n source.updateImage({\n url: props.url,\n coordinates: props.coordinates\n });\n }\n else if ('setCoordinates' in source && changedKeyCount === 1 && changedKey === 'coordinates') {\n source.setCoordinates(props.coordinates);\n }\n else if ('setUrl' in source) {\n // Added in 1.12.0:\n // vectorTileSource.setTiles\n // vectorTileSource.setUrl\n switch (changedKey) {\n case 'url':\n source.setUrl(props.url);\n break;\n case 'tiles':\n source.setTiles(props.tiles);\n break;\n default:\n }\n }\n else {\n // eslint-disable-next-line\n console.warn(`Unable to update <Source> prop: ${changedKey}`);\n }\n}\n/* eslint-enable complexity */\nfunction Source(props) {\n const map = useContext(MapContext).map.getMap();\n const propsRef = useRef(props);\n const [, setStyleLoaded] = useState(0);\n const id = useMemo(() => props.id || `jsx-source-${sourceCounter++}`, []);\n useEffect(() => {\n if (map) {\n /* global setTimeout */\n const forceUpdate = () => setTimeout(() => setStyleLoaded(version => version + 1), 0);\n map.on('styledata', forceUpdate);\n forceUpdate();\n return () => {\n var _a;\n map.off('styledata', forceUpdate);\n // @ts-ignore\n if (map.style && map.style._loaded && map.getSource(id)) {\n // Parent effects are destroyed before child ones, see\n // https://github.com/facebook/react/issues/16728\n // Source can only be removed after all child layers are removed\n const allLayers = (_a = map.getStyle()) === null || _a === void 0 ? void 0 : _a.layers;\n if (allLayers) {\n for (const layer of allLayers) {\n // @ts-ignore (2339) source does not exist on all layer types\n if (layer.source === id) {\n map.removeLayer(layer.id);\n }\n }\n }\n map.removeSource(id);\n }\n };\n }\n return undefined;\n }, [map]);\n // @ts-ignore\n let source = map && map.style && map.getSource(id);\n if (source) {\n updateSource(source, props, propsRef.current);\n }\n else {\n source = createSource(map, id, props);\n }\n propsRef.current = props;\n return ((source &&\n React.Children.map(props.children, child => child &&\n cloneElement(child, {\n source: id\n }))) ||\n null);\n}\nexport default Source;\n//# sourceMappingURL=source.js.map"],"names":["sourceCounter","createSource","map","id","props","options","updateSource","source","prevProps","assert","changedKey","changedKeyCount","key","deepEqual","type","Source","useContext","MapContext","propsRef","useRef","setStyleLoaded","useState","useMemo","useEffect","forceUpdate","version","_a","allLayers","layer","React","child","cloneElement"],"mappings":";;;;;AAMA,IAAIA,IAAgB;AACpB,SAASC,EAAaC,GAAKC,GAAIC,GAAO;AAElC,MAAIF,EAAI,SAASA,EAAI,MAAM,SAAS;AAC1B,UAAAG,IAAU,EAAE,GAAGD;AACrB,kBAAOC,EAAQ,IACf,OAAOA,EAAQ,UAEXH,EAAA,UAAUC,GAAIE,CAAO,GAClBH,EAAI,UAAUC,CAAE;AAAA,EAC3B;AACO,SAAA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