@remotion/maptiler 4.0.541 → 4.0.542
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/esm/index.mjs +23 -17
- package/package.json +5 -5
package/dist/esm/index.mjs
CHANGED
|
@@ -450,7 +450,6 @@ import {
|
|
|
450
450
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
451
451
|
var mapOverlaySchema = {
|
|
452
452
|
...Interactive.baseSchema,
|
|
453
|
-
...Interactive.premountSchema,
|
|
454
453
|
longitude: {
|
|
455
454
|
type: "number",
|
|
456
455
|
min: -180,
|
|
@@ -1610,10 +1609,6 @@ import {
|
|
|
1610
1609
|
import { jsx as jsx7, jsxs, Fragment } from "react/jsx-runtime";
|
|
1611
1610
|
var mapRegionSchema = {
|
|
1612
1611
|
...Interactive2.baseSchema,
|
|
1613
|
-
...{
|
|
1614
|
-
premountFor: Interactive2.premountSchema.premountFor,
|
|
1615
|
-
postmountFor: Interactive2.premountSchema.postmountFor
|
|
1616
|
-
},
|
|
1617
1612
|
fill: {
|
|
1618
1613
|
type: "number",
|
|
1619
1614
|
min: 0,
|
|
@@ -1674,16 +1669,23 @@ var MapRegionDrawing = ({
|
|
|
1674
1669
|
strokeWidth = 9
|
|
1675
1670
|
}) => {
|
|
1676
1671
|
const { map } = useContext9(MapTilerContext);
|
|
1672
|
+
const videoEnabled = Internals8.useVideoEnabled();
|
|
1677
1673
|
const { continueRender, delayRender } = useDelayRender6();
|
|
1678
1674
|
const [readyMap, setReadyMap] = useState2(null);
|
|
1679
1675
|
const isReady = map !== null && readyMap === map;
|
|
1680
1676
|
useLayoutEffect(() => {
|
|
1681
|
-
if (isReady) {
|
|
1677
|
+
if (isReady || !videoEnabled) {
|
|
1682
1678
|
return;
|
|
1683
1679
|
}
|
|
1684
1680
|
const handle = delayRender(`Loading ${feature.properties.name} geometry`);
|
|
1685
1681
|
return () => continueRender(handle);
|
|
1686
|
-
}, [
|
|
1682
|
+
}, [
|
|
1683
|
+
continueRender,
|
|
1684
|
+
delayRender,
|
|
1685
|
+
feature.properties.name,
|
|
1686
|
+
isReady,
|
|
1687
|
+
videoEnabled
|
|
1688
|
+
]);
|
|
1687
1689
|
const outline = useMemo3(() => lineString2(feature.geometry.coordinates[0]), [feature]);
|
|
1688
1690
|
const outlineLength = useMemo3(() => getLineLength2(outline), [outline]);
|
|
1689
1691
|
const fillSourceId = `${id}-fill`;
|
|
@@ -1965,10 +1967,6 @@ import {
|
|
|
1965
1967
|
import { jsx as jsx8, jsxs as jsxs2, Fragment as Fragment2 } from "react/jsx-runtime";
|
|
1966
1968
|
var mapRouteSchema = {
|
|
1967
1969
|
...Interactive3.baseSchema,
|
|
1968
|
-
...{
|
|
1969
|
-
premountFor: Interactive3.premountSchema.premountFor,
|
|
1970
|
-
postmountFor: Interactive3.premountSchema.postmountFor
|
|
1971
|
-
},
|
|
1972
1970
|
glow: {
|
|
1973
1971
|
type: "number",
|
|
1974
1972
|
min: 0,
|
|
@@ -2012,16 +2010,23 @@ var MapRouteDrawing = ({
|
|
|
2012
2010
|
strokeWidth = 9
|
|
2013
2011
|
}) => {
|
|
2014
2012
|
const { map } = useContext10(MapTilerContext);
|
|
2013
|
+
const videoEnabled = Internals9.useVideoEnabled();
|
|
2015
2014
|
const { continueRender, delayRender } = useDelayRender7();
|
|
2016
2015
|
const [readyMap, setReadyMap] = useState3(null);
|
|
2017
2016
|
const isReady = map !== null && readyMap === map;
|
|
2018
2017
|
useLayoutEffect2(() => {
|
|
2019
|
-
if (isReady) {
|
|
2018
|
+
if (isReady || !videoEnabled) {
|
|
2020
2019
|
return;
|
|
2021
2020
|
}
|
|
2022
2021
|
const handle = delayRender(`Loading ${feature.properties.name} route`);
|
|
2023
2022
|
return () => continueRender(handle);
|
|
2024
|
-
}, [
|
|
2023
|
+
}, [
|
|
2024
|
+
continueRender,
|
|
2025
|
+
delayRender,
|
|
2026
|
+
feature.properties.name,
|
|
2027
|
+
isReady,
|
|
2028
|
+
videoEnabled
|
|
2029
|
+
]);
|
|
2025
2030
|
const route = useMemo4(() => lineString3(feature.geometry.coordinates), [feature]);
|
|
2026
2031
|
const routeLength = useMemo4(() => getLineLength3(route), [route]);
|
|
2027
2032
|
const sourceId = `${id}-route`;
|
|
@@ -2380,6 +2385,7 @@ import"@maptiler/sdk/style.css";
|
|
|
2380
2385
|
import { useLayoutEffect as useLayoutEffect3, useMemo as useMemo5, useRef as useRef8, useState as useState4 } from "react";
|
|
2381
2386
|
import {
|
|
2382
2387
|
Interactive as Interactive4,
|
|
2388
|
+
Internals as Internals11,
|
|
2383
2389
|
useDelayRender as useDelayRender9
|
|
2384
2390
|
} from "remotion";
|
|
2385
2391
|
import { jsx as jsx10, jsxs as jsxs3, Fragment as Fragment3 } from "react/jsx-runtime";
|
|
@@ -2398,7 +2404,6 @@ var stripStyleLayers = ({
|
|
|
2398
2404
|
};
|
|
2399
2405
|
var mapViewportSchema = {
|
|
2400
2406
|
...Interactive4.baseSchema,
|
|
2401
|
-
...Interactive4.premountSchema,
|
|
2402
2407
|
centerLongitude: {
|
|
2403
2408
|
type: "number",
|
|
2404
2409
|
min: -180,
|
|
@@ -2546,6 +2551,7 @@ var MapViewportContent = ({
|
|
|
2546
2551
|
zoom = 4
|
|
2547
2552
|
}) => {
|
|
2548
2553
|
const mapContainerRef = useRef8(null);
|
|
2554
|
+
const videoEnabled = Internals11.useVideoEnabled();
|
|
2549
2555
|
const mapRef = useRef8(null);
|
|
2550
2556
|
const initialCameraRef = useRef8({
|
|
2551
2557
|
bearing,
|
|
@@ -2577,12 +2583,12 @@ var MapViewportContent = ({
|
|
|
2577
2583
|
onMapReadyRef.current = onMapReady;
|
|
2578
2584
|
const { continueRender, delayRender } = useDelayRender9();
|
|
2579
2585
|
const [loadedMap, setLoadedMap] = useState4(null);
|
|
2580
|
-
const map = loadedMap?.map.style ? loadedMap.map : null;
|
|
2586
|
+
const map = videoEnabled && loadedMap?.map.style ? loadedMap.map : null;
|
|
2581
2587
|
const [cameraRevision, setCameraRevision] = useState4(0);
|
|
2582
2588
|
const [styleRevision, setStyleRevision] = useState4(0);
|
|
2583
2589
|
const contextValue = useMemo5(() => ({ cameraRevision, map, styleRevision }), [cameraRevision, map, styleRevision]);
|
|
2584
2590
|
useLayoutEffect3(() => {
|
|
2585
|
-
if (!apiKey) {
|
|
2591
|
+
if (!apiKey || !videoEnabled) {
|
|
2586
2592
|
return;
|
|
2587
2593
|
}
|
|
2588
2594
|
if (!mapContainerRef.current || mapRef.current) {
|
|
@@ -2655,7 +2661,7 @@ var MapViewportContent = ({
|
|
|
2655
2661
|
mapRef.current = null;
|
|
2656
2662
|
continueRender(loadingHandle);
|
|
2657
2663
|
};
|
|
2658
|
-
}, [apiKey, continueRender, delayRender]);
|
|
2664
|
+
}, [apiKey, continueRender, delayRender, videoEnabled]);
|
|
2659
2665
|
useLayoutEffect3(() => {
|
|
2660
2666
|
if (loadedMap) {
|
|
2661
2667
|
continueRender(loadedMap.handle);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/maptiler",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.542",
|
|
4
4
|
"description": "MapTiler components for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"formatting": "oxfmt src --check",
|
|
14
14
|
"format": "oxfmt src",
|
|
15
15
|
"lint": "eslint src",
|
|
16
|
-
"watch": "
|
|
17
|
-
"make": "
|
|
16
|
+
"watch": "node ../.monorepo/tsrs.cjs -w",
|
|
17
|
+
"make": "node ../.monorepo/tsrs.cjs && bun --env-file=../.env.bundle bundle.ts"
|
|
18
18
|
},
|
|
19
19
|
"author": "Jonny Burger <jonny@remotion.dev>",
|
|
20
20
|
"contributors": [],
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@maptiler/sdk": "4.0.2",
|
|
27
27
|
"@turf/turf": "7.3.2",
|
|
28
|
-
"remotion": "4.0.
|
|
28
|
+
"remotion": "4.0.542"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"react": ">=16.8.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"react": "19.3.1",
|
|
44
44
|
"react-dom": "19.3.1",
|
|
45
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
45
|
+
"@remotion/eslint-config-internal": "4.0.542",
|
|
46
46
|
"eslint": "9.19.0",
|
|
47
47
|
"typescript": "7.1.0-beta"
|
|
48
48
|
},
|