PageSourceSearch

https://navpro.truckerpath.com/assets/map-default-controls-Cg-QqICw.js

js truckerpath.com collected 2026-10-01 12:04:23 UTC 2,849 bytes, 94 lines download raw bytes

1import { a as __toESM } from "./rolldown-runtime-Cql5ZV07.js";
2import { p as require_react } from "./vendor-charts-D81iZKCV.js";
3import { g as require_compiler_runtime, t as require_jsx_runtime } from "./vendor-react-HZz3WA9p.js";
4import { a as ControlPosition, l as useMap, s as MapControl } from "./vendor-maps-1lAD1rp9.js";
5import { i as ControlFullscreen, n as ControlZoom, r as ControlRestart } from "./marker-tQkMpDnD.js";
6var import_compiler_runtime = /* @__PURE__ */ __toESM(require_compiler_runtime());
7var import_react = /* @__PURE__ */ __toESM(require_react());
8var import_jsx_runtime = /* @__PURE__ */ __toESM(require_jsx_runtime());
9var MapDefaultControls = (t0) => {
10	const $ = (0, import_compiler_runtime.c)(16);
11	const { onRestart, showFullscreen, children, footer } = t0;
12	const initViewRef = (0, import_react.useRef)(null);
13	const map = useMap();
14	let t1;
15	let t2;
16	if ($[0] !== map) {
17		t1 = () => {
18			if (!map) return;
19			const listener = google.maps.event.addListenerOnce(map, "idle", () => {
20				const center = map.getCenter();
21				const zoom = map.getZoom();
22				if (center && zoom !== void 0) initViewRef.current = {
23					center: center.toJSON(),
24					zoom
25				};
26			});
27			return () => google.maps.event.removeListener(listener);
28		};
29		t2 = [map];
30		$[0] = map;
31		$[1] = t1;
32		$[2] = t2;
33	} else {
34		t1 = $[1];
35		t2 = $[2];
36	}
37	(0, import_react.useEffect)(t1, t2);
38	let t3;
39	if ($[3] !== map || $[4] !== onRestart) {
40		t3 = () => {
41			if (onRestart) {
42				onRestart();
43				return;
44			}
45			if (!map || !initViewRef.current) return;
46			map.setCenter(initViewRef.current.center);
47			map.setZoom(initViewRef.current.zoom);
48		};
49		$[3] = map;
50		$[4] = onRestart;
51		$[5] = t3;
52	} else t3 = $[5];
53	const handleRestart = t3;
54	let t4;
55	if ($[6] !== showFullscreen) {
56		t4 = showFullscreen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ControlFullscreen, {});
57		$[6] = showFullscreen;
58		$[7] = t4;
59	} else t4 = $[7];
60	let t5;
61	if ($[8] !== handleRestart) {
62		t5 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ControlRestart, { onClick: handleRestart });
63		$[8] = handleRestart;
64		$[9] = t5;
65	} else t5 = $[9];
66	let t6;
67	if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
68		t6 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ControlZoom, {});
69		$[10] = t6;
70	} else t6 = $[10];
71	let t7;
72	if ($[11] !== children || $[12] !== footer || $[13] !== t4 || $[14] !== t5) {
73		t7 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MapControl, {
74			position: ControlPosition.RIGHT_BOTTOM,
75			children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
76				className: "mr-3 flex flex-col gap-1.5 pb-1",
77				children: [
78					t4,
79					children,
80					t5,
81					t6,
82					footer
83				]
84			})
85		});
86		$[11] = children;
87		$[12] = footer;
88		$[13] = t4;
89		$[14] = t5;
90		$[15] = t7;
91	} else t7 = $[15];
92	return t7;
93};
94export { MapDefaultControls as t };

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.