@dartcom/ui-kit 10.1.9 → 10.1.10
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/layers/leaflet/lib/hooks/useGetLeafletLayer.d.ts +2 -1
- package/dist/components/layers/leaflet/lib/hooks/useGetLeafletLayer.d.ts.map +1 -1
- package/dist/index.cjs +7 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Nullable } from '../../../../../types';
|
|
2
|
-
import { SourceLayerEventHandlers, TangramCustomLayer, TangramEventConfig, TangramLeafletLayer, TangramSourceConfig } from '../types';
|
|
2
|
+
import { SourceLayerEventHandlers, TangramCustomLayer, TangramEventConfig, TangramLeafletLayer, TangramSourceConfig, TangramSourceNames } from '../types';
|
|
3
3
|
export declare const useGetLeafletLayer: ({ eventHandlers, }: {
|
|
4
4
|
eventHandlers?: SourceLayerEventHandlers;
|
|
5
5
|
}) => {
|
|
@@ -13,6 +13,7 @@ export declare const useGetLeafletLayer: ({ eventHandlers, }: {
|
|
|
13
13
|
url: string;
|
|
14
14
|
} | undefined;
|
|
15
15
|
updateSource: (sourceName: TangramSourceConfig["name"], newUrl: TangramSourceConfig["url"]) => string[] | undefined;
|
|
16
|
+
reloadSource: (sourceName: TangramSourceNames) => string[] | undefined;
|
|
16
17
|
addLayer: (layer: TangramCustomLayer) => string[] | undefined;
|
|
17
18
|
removeLayer: (layer: TangramCustomLayer) => string[] | undefined;
|
|
18
19
|
addStyle: ({ name, style }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetLeafletLayer.d.ts","sourceRoot":"","sources":["../../../../../../src/components/layers/leaflet/lib/hooks/useGetLeafletLayer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAKnC,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"useGetLeafletLayer.d.ts","sourceRoot":"","sources":["../../../../../../src/components/layers/leaflet/lib/hooks/useGetLeafletLayer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAKnC,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAGlB,eAAO,MAAM,kBAAkB,GAAI,oBAEhC;IACD,aAAa,CAAC,EAAE,wBAAwB,CAAC;CAC1C;;;;8BAmEkB,mBAAmB;4BA4BrB,mBAAmB,CAAC,MAAM,CAAC;;;;;+BAe1B,mBAAmB,CAAC,MAAM,CAAC,UAC/B,mBAAmB,CAAC,KAAK,CAAC;+BA+BvB,kBAAkB;sBASvB,kBAAkB;yBAyDlB,kBAAkB;gCA+BR;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE;gCAyBzC,kBAAkB;gDAkBL;QAAE,KAAK,EAAE,kBAAkB,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE;;;;CA0IvE,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -30387,10 +30387,16 @@ const useGetLeafletLayer = ({ eventHandlers, }) => {
|
|
|
30387
30387
|
});
|
|
30388
30388
|
return;
|
|
30389
30389
|
}
|
|
30390
|
+
config.sources[sourceName].url = '';
|
|
30391
|
+
scene.updateConfig();
|
|
30390
30392
|
config.sources[sourceName].url = newUrl;
|
|
30391
30393
|
scene.updateConfig({ rebuild: true });
|
|
30392
30394
|
return getSources();
|
|
30393
30395
|
}, [config, scene]);
|
|
30396
|
+
const reloadSource = React__namespace.useCallback((sourceName) => {
|
|
30397
|
+
const url = sourceUrl[sourceName];
|
|
30398
|
+
return updateSource(sourceName, url);
|
|
30399
|
+
}, [updateSource]);
|
|
30394
30400
|
const addLayer = React__namespace.useCallback((layer) => {
|
|
30395
30401
|
if (!scene) {
|
|
30396
30402
|
loggerService.warn({
|
|
@@ -30577,6 +30583,7 @@ const useGetLeafletLayer = ({ eventHandlers, }) => {
|
|
|
30577
30583
|
addSource,
|
|
30578
30584
|
getSource,
|
|
30579
30585
|
updateSource,
|
|
30586
|
+
reloadSource,
|
|
30580
30587
|
addLayer,
|
|
30581
30588
|
removeLayer,
|
|
30582
30589
|
addStyle,
|