@macrostrat/map-interface 1.2.1 → 1.2.3
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/CHANGELOG.md +14 -0
- package/dist/cjs/{container.72611900.js → container.b61e4d0f.js} +2 -2
- package/dist/cjs/{container.72611900.js.map → container.b61e4d0f.js.map} +1 -1
- package/dist/cjs/{dev.7499151f.js → dev.8ee72000.js} +3 -3
- package/dist/{esm/dev.ccb6e774.js.map → cjs/dev.8ee72000.js.map} +1 -1
- package/dist/cjs/{expansion-panel.08532cee.js → expansion-panel.ef757efe.js} +6 -5
- package/dist/cjs/expansion-panel.ef757efe.js.map +1 -0
- package/dist/cjs/{header.58c5c012.js → header.b86c0710.js} +11 -5
- package/dist/cjs/header.b86c0710.js.map +1 -0
- package/dist/cjs/{headers.20eae5f7.js → headers.d9f3e324.js} +3 -3
- package/dist/cjs/{headers.20eae5f7.js.map → headers.d9f3e324.js.map} +1 -1
- package/dist/cjs/index.js +6 -6
- package/dist/cjs/{location-panel.c95f5e96.js → location-panel.6a4dc310.js} +7 -7
- package/dist/cjs/location-panel.6a4dc310.js.map +1 -0
- package/dist/cjs/{main.module.3f2b7c9f.js → main.module.0bbfa859.js} +4 -1
- package/dist/cjs/main.module.0bbfa859.js.map +1 -0
- package/dist/cjs/{main.module.ff1b1aca.css → main.module.338867af.css} +23 -11
- package/dist/cjs/main.module.338867af.css.map +1 -0
- package/dist/cjs/{main.module.02c4de16.css → main.module.3dbc089f.css} +22 -6
- package/dist/cjs/main.module.3dbc089f.css.map +1 -0
- package/dist/cjs/{main.module.4ecbaaa5.js → main.module.a3a78b0d.js} +4 -1
- package/dist/cjs/main.module.a3a78b0d.js.map +1 -0
- package/dist/cjs/{map-page.190b6723.js → map-page.cde24ee5.js} +6 -6
- package/dist/cjs/{map-page.190b6723.js.map → map-page.cde24ee5.js.map} +1 -1
- package/dist/cjs/map-view.12e9ea3e.js +178 -0
- package/dist/cjs/map-view.12e9ea3e.js.map +1 -0
- package/dist/cjs/{vector-tile-features.456f887b.js → vector-tile-features.77121785.js} +2 -2
- package/dist/cjs/{vector-tile-features.456f887b.js.map → vector-tile-features.77121785.js.map} +1 -1
- package/dist/esm/{container.16bde261.js → container.2ebe27af.js} +2 -2
- package/dist/esm/{container.16bde261.js.map → container.2ebe27af.js.map} +1 -1
- package/dist/esm/{dev.ccb6e774.js → dev.58b994e7.js} +3 -3
- package/dist/{cjs/dev.7499151f.js.map → esm/dev.58b994e7.js.map} +1 -1
- package/dist/esm/{expansion-panel.feff0e62.js → expansion-panel.465b822f.js} +7 -6
- package/dist/esm/expansion-panel.465b822f.js.map +1 -0
- package/dist/esm/{header.0f535ab1.js → header.b4aa864a.js} +12 -6
- package/dist/esm/header.b4aa864a.js.map +1 -0
- package/dist/esm/{headers.b25ff414.js → headers.32db7784.js} +4 -4
- package/dist/esm/{headers.b25ff414.js.map → headers.32db7784.js.map} +1 -1
- package/dist/esm/index.d.ts +8 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +6 -6
- package/dist/esm/{location-panel.0b1f4ed2.js → location-panel.f22673f5.js} +8 -8
- package/dist/esm/location-panel.f22673f5.js.map +1 -0
- package/dist/esm/{main.module.67a908da.js → main.module.303f6d99.js} +4 -1
- package/dist/esm/main.module.303f6d99.js.map +1 -0
- package/dist/esm/{main.module.89579666.js → main.module.58922c04.js} +4 -1
- package/dist/esm/main.module.58922c04.js.map +1 -0
- package/dist/esm/{map-page.b953c404.js → map-page.f9f59ea0.js} +6 -6
- package/dist/esm/{map-page.b953c404.js.map → map-page.f9f59ea0.js.map} +1 -1
- package/dist/esm/map-view.4f256782.js +172 -0
- package/dist/esm/map-view.4f256782.js.map +1 -0
- package/dist/esm/{vector-tile-features.e1a24df0.js → vector-tile-features.53b48d66.js} +2 -2
- package/dist/esm/{vector-tile-features.e1a24df0.js.map → vector-tile-features.53b48d66.js.map} +1 -1
- package/dist/node/container.abd6f0d2.js.map +1 -1
- package/dist/node/{dev.15b4cdb0.js → dev.3cbf6106.js} +2 -2
- package/dist/node/{dev.15b4cdb0.js.map → dev.3cbf6106.js.map} +1 -1
- package/dist/node/expansion-panel.62240ee3.js +2 -0
- package/dist/node/expansion-panel.62240ee3.js.map +1 -0
- package/dist/node/header.4b58753a.js +2 -0
- package/dist/node/header.4b58753a.js.map +1 -0
- package/dist/node/{headers.0d494ac2.js → headers.2581f6d9.js} +2 -2
- package/dist/node/{headers.0d494ac2.js.map → headers.2581f6d9.js.map} +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/index.js.map +1 -1
- package/dist/node/{location-panel.d22d21fa.js → location-panel.c39983e3.js} +2 -2
- package/dist/node/location-panel.c39983e3.js.map +1 -0
- package/dist/node/main.module.2d51c752.css +2 -0
- package/dist/node/main.module.2d51c752.css.map +1 -0
- package/dist/node/main.module.3a8fef67.js +2 -0
- package/dist/node/main.module.3a8fef67.js.map +1 -0
- package/dist/node/main.module.5d5ab665.js +2 -0
- package/dist/node/main.module.5d5ab665.js.map +1 -0
- package/dist/node/main.module.ba3f4a78.css +2 -0
- package/dist/node/main.module.ba3f4a78.css.map +1 -0
- package/dist/node/{map-page.0b19d49e.js → map-page.f99c4a48.js} +2 -2
- package/dist/node/{map-page.0b19d49e.js.map → map-page.f99c4a48.js.map} +1 -1
- package/dist/node/map-view.77013338.js +2 -0
- package/dist/node/map-view.77013338.js.map +1 -0
- package/dist/node/{vector-tile-features.c02e240c.js → vector-tile-features.b5a23b71.js} +2 -2
- package/dist/node/{vector-tile-features.c02e240c.js.map → vector-tile-features.b5a23b71.js.map} +1 -1
- package/package.json +3 -3
- package/src/container.ts +1 -1
- package/src/expansion-panel/index.ts +1 -1
- package/src/expansion-panel/main.module.sass +20 -10
- package/src/location-panel/header.ts +31 -19
- package/src/location-panel/index.ts +6 -4
- package/src/location-panel/main.module.sass +16 -4
- package/src/{map-view/index.ts → map-view.ts} +51 -18
- package/dist/cjs/expansion-panel.08532cee.js.map +0 -1
- package/dist/cjs/header.58c5c012.js.map +0 -1
- package/dist/cjs/location-panel.c95f5e96.js.map +0 -1
- package/dist/cjs/main.module.02c4de16.css.map +0 -1
- package/dist/cjs/main.module.3f2b7c9f.js.map +0 -1
- package/dist/cjs/main.module.4ecbaaa5.js.map +0 -1
- package/dist/cjs/main.module.ff1b1aca.css.map +0 -1
- package/dist/cjs/map-view.93363b41.js +0 -167
- package/dist/cjs/map-view.93363b41.js.map +0 -1
- package/dist/cjs/terrain.90f76b4e.js +0 -59
- package/dist/cjs/terrain.90f76b4e.js.map +0 -1
- package/dist/esm/expansion-panel.feff0e62.js.map +0 -1
- package/dist/esm/header.0f535ab1.js.map +0 -1
- package/dist/esm/location-panel.0b1f4ed2.js.map +0 -1
- package/dist/esm/main.module.67a908da.js.map +0 -1
- package/dist/esm/main.module.89579666.js.map +0 -1
- package/dist/esm/map-view.a3fe6257.js +0 -161
- package/dist/esm/map-view.a3fe6257.js.map +0 -1
- package/dist/esm/terrain.f65cf7c5.js +0 -54
- package/dist/esm/terrain.f65cf7c5.js.map +0 -1
- package/dist/node/expansion-panel.1553938f.js +0 -2
- package/dist/node/expansion-panel.1553938f.js.map +0 -1
- package/dist/node/header.5f15d599.js +0 -2
- package/dist/node/header.5f15d599.js.map +0 -1
- package/dist/node/location-panel.d22d21fa.js.map +0 -1
- package/dist/node/main.module.2cc98713.css +0 -2
- package/dist/node/main.module.2cc98713.css.map +0 -1
- package/dist/node/main.module.78d7f40f.js +0 -2
- package/dist/node/main.module.78d7f40f.js.map +0 -1
- package/dist/node/main.module.d4e98e60.js +0 -2
- package/dist/node/main.module.d4e98e60.js.map +0 -1
- package/dist/node/main.module.f0530add.css +0 -2
- package/dist/node/main.module.f0530add.css.map +0 -1
- package/dist/node/map-view.c6746dca.js +0 -2
- package/dist/node/map-view.c6746dca.js.map +0 -1
- package/dist/node/terrain.96ae432a.js +0 -2
- package/dist/node/terrain.96ae432a.js.map +0 -1
- package/src/map-view/terrain.ts +0 -63
|
@@ -1 +1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a;QACf;QACA,0CAAE,CAAA,GAAA,mCAAQ,GAAG;YACX,UAAU;YACV,aAAa;QACf;QACA,0CAAE,CAAA,GAAA,yCAAc,GAAG;kBAAE;YAAM,OAAO,YAAY,UAAU;QAAQ;QAChE;KACD;AAGP;AAEA,SAAS,mCAAa,KAAK;IACzB,MAAM,YAAE,QAAQ,YAAE,QAAQ,EAAE,GAAG,MAAM,GAAG;IACxC,6CAA6C,GAC7C,wCAAwC;IACxC,QAAQ,IAAI,CAAC;IAEb,OAAO,0CAAE,2CAAgB;QACvB,GAAG,IAAI;QACP,UAAU;YAAC;YAAU;SAAS;IAChC;AACF;AAGO,MAAM,4CAAa","sources":["packages/map-interface/src/dev/map-page.ts"],"sourcesContent":["// Import other components\nimport { Switch } from \"@blueprintjs/core\";\nimport hyper from \"@macrostrat/hyper\";\nimport { Spacer, useDarkMode, useStoredState } from \"@macrostrat/ui-components\";\nimport mapboxgl from \"mapbox-gl\";\nimport { useCallback, useState, useEffect } from \"react\";\nimport { buildInspectorStyle } from \"./xray\";\nimport { MapAreaContainer, PanelCard } from \"../container\";\nimport { FloatingNavbar, MapLoadingButton } from \"../context-panel\";\nimport { MapMarker } from \"../helpers\";\nimport { LocationPanel } from \"../location-panel\";\nimport { MapView } from \"../map-view\";\nimport styles from \"./main.module.sass\";\nimport { TileExtentLayer } from \"./tile-extent\";\nimport {\n FeaturePanel,\n FeatureSelectionHandler,\n TileInfo,\n} from \"./vector-tile-features\";\nimport { MapPosition } from \"@macrostrat/mapbox-utils\";\n\nexport const h = hyper.styled(styles);\n\nexport function MapInspectorV2({\n title = \"Map inspector\",\n headerElement = null,\n transformRequest = null,\n mapPosition = null,\n mapboxToken = null,\n overlayStyle = null,\n controls = null,\n children = null,\n style,\n bounds = null,\n focusedSource = null,\n focusedSourceTitle = null,\n fitViewport = true,\n styleType = \"macrostrat\",\n}: {\n headerElement?: React.ReactNode;\n transformRequest?: mapboxgl.TransformRequestFunction;\n title?: string;\n style?: mapboxgl.Style | string;\n controls?: React.ReactNode;\n children?: React.ReactNode;\n mapboxToken?: string;\n overlayStyle?: mapboxgl.Style | string;\n focusedSource?: string;\n focusedSourceTitle?: string;\n projection?: string;\n mapPosition?: MapPosition;\n bounds?: [number, number, number, number];\n fitViewport?: boolean;\n styleType?: \"standard\" | \"macrostrat\";\n}) {\n /* We apply a custom style to the panel container when we are interacting\n with the search bar, so that we can block map interactions until search\n bar focus is lost.\n We also apply a custom style when the infodrawer is open so we can hide\n the search bar on mobile platforms\n */\n\n const dark = useDarkMode();\n const isEnabled = dark?.isEnabled;\n\n if (mapboxToken != null) {\n mapboxgl.accessToken = mapboxToken;\n }\n\n if (styleType == \"macrostrat\") {\n style ??= isEnabled\n ? \"mapbox://styles/jczaplewski/cl5uoqzzq003614o6url9ou9z?optimize=true\"\n : \"mapbox://styles/jczaplewski/clatdbkw4002q14lov8zx0bm0?optimize=true\";\n } else {\n style ??= isEnabled\n ? \"mapbox://styles/mapbox/dark-v10\"\n : \"mapbox://styles/mapbox/light-v10\";\n }\n\n const [isOpen, setOpen] = useState(false);\n\n const [state, setState] = useStoredState(\"macrostrat:dev-map-page\", {\n showTileExtent: false,\n xRay: false,\n });\n const { showTileExtent, xRay } = state;\n\n const [actualStyle, setActualStyle] = useState(null);\n\n useEffect(() => {\n buildInspectorStyle(style, overlayStyle, {\n mapboxToken,\n inDarkMode: isEnabled,\n xRay,\n }).then(setActualStyle);\n }, [style, xRay, mapboxToken, isEnabled, overlayStyle]);\n\n const [inspectPosition, setInspectPosition] =\n useState<mapboxgl.LngLat | null>(null);\n\n const [data, setData] = useState(null);\n\n const onSelectPosition = useCallback((position: mapboxgl.LngLat) => {\n setInspectPosition(position);\n }, []);\n\n let detailElement = null;\n if (inspectPosition != null) {\n detailElement = h(\n LocationPanel,\n {\n onClose() {\n setInspectPosition(null);\n },\n position: inspectPosition,\n },\n [\n h(TileInfo, {\n feature: data?.[0] ?? null,\n showExtent: showTileExtent,\n setShowExtent() {\n setState({ ...state, showTileExtent: !showTileExtent });\n },\n }),\n h(FeaturePanel, { features: data, focusedSource, focusedSourceTitle }),\n ]\n );\n }\n\n let tile = null;\n if (showTileExtent && data?.[0] != null) {\n let f = data[0];\n tile = { x: f._x, y: f._y, z: f._z };\n }\n\n return h(\n MapAreaContainer,\n {\n navbar: h(FloatingNavbar, {\n rightElement: h(MapLoadingButton, {\n large: true,\n active: isOpen,\n onClick: () => setOpen(!isOpen),\n style: {\n marginRight: \"-5px\",\n },\n }),\n headerElement,\n title,\n }),\n contextPanel: h(PanelCard, [\n controls,\n h(Switch, {\n checked: xRay,\n label: \"X-ray mode\",\n onChange() {\n setState({ ...state, xRay: !xRay });\n },\n }),\n ]),\n detailPanel: detailElement,\n contextPanelOpen: isOpen,\n fitViewport,\n },\n h(\n MapView,\n {\n style: actualStyle,\n transformRequest,\n mapPosition,\n projection: { name: \"globe\" },\n mapboxToken,\n bounds,\n },\n [\n h(FeatureSelectionHandler, {\n selectedLocation: inspectPosition,\n setFeatures: setData,\n }),\n h(MapMarker, {\n position: inspectPosition,\n setPosition: onSelectPosition,\n }),\n h(TileExtentLayer, { tile, color: isEnabled ? \"white\" : \"black\" }),\n children,\n ]\n )\n );\n}\n\nfunction MapInspector(props) {\n const { children, controls, ...rest } = props;\n /** Compatibility wrapper for MapInspectorV2 */\n // React warning about this legacy usage\n console.warn(\"MapInspector is deprecated. Use MapInspectorV2 instead\");\n\n return h(MapInspectorV2, {\n ...rest,\n controls: [children, controls],\n });\n}\n\n// Legacy export\nexport const DevMapPage = MapInspector;\n"],"names":[],"version":3,"file":"map-page.
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0BAA0B;;;;;;;;;;;;;;;AAqBnB,MAAM,4CAAI,CAAA,GAAA,gDAAI,EAAE,MAAM,CAAC,CAAA,GAAA,mDAAK;AAE5B,SAAS,0CAAe,SAC7B,QAAQ,gCACR,gBAAgB,wBAChB,mBAAmB,mBACnB,cAAc,mBACd,cAAc,oBACd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C,GAC7C,wCAAwC;IACxC,QAAQ,IAAI,CAAC;IAEb,OAAO,0CAAE,2CAAgB;QACvB,GAAG,IAAI;QACP,UAAU;YAAC;YAAU;SAAS;IAChC;AACF;AAGO,MAAM,4CAAa","sources":["packages/map-interface/src/dev/map-page.ts"],"sourcesContent":["// Import other components\nimport { Switch } from \"@blueprintjs/core\";\nimport hyper from \"@macrostrat/hyper\";\nimport { Spacer, useDarkMode, useStoredState } from \"@macrostrat/ui-components\";\nimport mapboxgl from \"mapbox-gl\";\nimport { useCallback, useState, useEffect } from \"react\";\nimport { buildInspectorStyle } from \"./xray\";\nimport { MapAreaContainer, PanelCard } from \"../container\";\nimport { FloatingNavbar, MapLoadingButton } from \"../context-panel\";\nimport { MapMarker } from \"../helpers\";\nimport { LocationPanel } from \"../location-panel\";\nimport { MapView } from \"../map-view\";\nimport styles from \"./main.module.sass\";\nimport { TileExtentLayer } from \"./tile-extent\";\nimport {\n FeaturePanel,\n FeatureSelectionHandler,\n TileInfo,\n} from \"./vector-tile-features\";\nimport { MapPosition } from \"@macrostrat/mapbox-utils\";\n\nexport const h = hyper.styled(styles);\n\nexport function MapInspectorV2({\n title = \"Map inspector\",\n headerElement = null,\n transformRequest = null,\n mapPosition = null,\n mapboxToken = null,\n overlayStyle = null,\n controls = null,\n children = null,\n style,\n bounds = null,\n focusedSource = null,\n focusedSourceTitle = null,\n fitViewport = true,\n styleType = \"macrostrat\",\n}: {\n headerElement?: React.ReactNode;\n transformRequest?: mapboxgl.TransformRequestFunction;\n title?: string;\n style?: mapboxgl.Style | string;\n controls?: React.ReactNode;\n children?: React.ReactNode;\n mapboxToken?: string;\n overlayStyle?: mapboxgl.Style | string;\n focusedSource?: string;\n focusedSourceTitle?: string;\n projection?: string;\n mapPosition?: MapPosition;\n bounds?: [number, number, number, number];\n fitViewport?: boolean;\n styleType?: \"standard\" | \"macrostrat\";\n}) {\n /* We apply a custom style to the panel container when we are interacting\n with the search bar, so that we can block map interactions until search\n bar focus is lost.\n We also apply a custom style when the infodrawer is open so we can hide\n the search bar on mobile platforms\n */\n\n const dark = useDarkMode();\n const isEnabled = dark?.isEnabled;\n\n if (mapboxToken != null) {\n mapboxgl.accessToken = mapboxToken;\n }\n\n if (styleType == \"macrostrat\") {\n style ??= isEnabled\n ? \"mapbox://styles/jczaplewski/cl5uoqzzq003614o6url9ou9z?optimize=true\"\n : \"mapbox://styles/jczaplewski/clatdbkw4002q14lov8zx0bm0?optimize=true\";\n } else {\n style ??= isEnabled\n ? \"mapbox://styles/mapbox/dark-v10\"\n : \"mapbox://styles/mapbox/light-v10\";\n }\n\n const [isOpen, setOpen] = useState(false);\n\n const [state, setState] = useStoredState(\"macrostrat:dev-map-page\", {\n showTileExtent: false,\n xRay: false,\n });\n const { showTileExtent, xRay } = state;\n\n const [actualStyle, setActualStyle] = useState(null);\n\n useEffect(() => {\n buildInspectorStyle(style, overlayStyle, {\n mapboxToken,\n inDarkMode: isEnabled,\n xRay,\n }).then(setActualStyle);\n }, [style, xRay, mapboxToken, isEnabled, overlayStyle]);\n\n const [inspectPosition, setInspectPosition] =\n useState<mapboxgl.LngLat | null>(null);\n\n const [data, setData] = useState(null);\n\n const onSelectPosition = useCallback((position: mapboxgl.LngLat) => {\n setInspectPosition(position);\n }, []);\n\n let detailElement = null;\n if (inspectPosition != null) {\n detailElement = h(\n LocationPanel,\n {\n onClose() {\n setInspectPosition(null);\n },\n position: inspectPosition,\n },\n [\n h(TileInfo, {\n feature: data?.[0] ?? null,\n showExtent: showTileExtent,\n setShowExtent() {\n setState({ ...state, showTileExtent: !showTileExtent });\n },\n }),\n h(FeaturePanel, { features: data, focusedSource, focusedSourceTitle }),\n ]\n );\n }\n\n let tile = null;\n if (showTileExtent && data?.[0] != null) {\n let f = data[0];\n tile = { x: f._x, y: f._y, z: f._z };\n }\n\n return h(\n MapAreaContainer,\n {\n navbar: h(FloatingNavbar, {\n rightElement: h(MapLoadingButton, {\n large: true,\n active: isOpen,\n onClick: () => setOpen(!isOpen),\n style: {\n marginRight: \"-5px\",\n },\n }),\n headerElement,\n title,\n }),\n contextPanel: h(PanelCard, [\n controls,\n h(Switch, {\n checked: xRay,\n label: \"X-ray mode\",\n onChange() {\n setState({ ...state, xRay: !xRay });\n },\n }),\n ]),\n detailPanel: detailElement,\n contextPanelOpen: isOpen,\n fitViewport,\n },\n h(\n MapView,\n {\n style: actualStyle,\n transformRequest,\n mapPosition,\n projection: { name: \"globe\" },\n mapboxToken,\n bounds,\n },\n [\n h(FeatureSelectionHandler, {\n selectedLocation: inspectPosition,\n setFeatures: setData,\n }),\n h(MapMarker, {\n position: inspectPosition,\n setPosition: onSelectPosition,\n }),\n h(TileExtentLayer, { tile, color: isEnabled ? \"white\" : \"black\" }),\n children,\n ]\n )\n );\n}\n\nfunction MapInspector(props) {\n const { children, controls, ...rest } = props;\n /** Compatibility wrapper for MapInspectorV2 */\n // React warning about this legacy usage\n console.warn(\"MapInspector is deprecated. Use MapInspectorV2 instead\");\n\n return h(MapInspectorV2, {\n ...rest,\n controls: [children, controls],\n });\n}\n\n// Legacy export\nexport const DevMapPage = MapInspector;\n"],"names":[],"version":3,"file":"map-page.cde24ee5.js.map"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
var $35f1bc0112883d51$exports = require("./main.module.62939ea7.js");
|
|
2
|
+
require("./main.module.f085a193.css");
|
|
3
|
+
var $2611a7b4364593e5$exports = require("./helpers.0f72ddaf.js");
|
|
4
|
+
var $3490fc4f4bda12f7$exports = require("./utils.26f02633.js");
|
|
5
|
+
var $8GJXj$macrostrathyper = require("@macrostrat/hyper");
|
|
6
|
+
var $8GJXj$macrostratmapboxreact = require("@macrostrat/mapbox-react");
|
|
7
|
+
var $8GJXj$macrostratmapboxutils = require("@macrostrat/mapbox-utils");
|
|
8
|
+
var $8GJXj$classnames = require("classnames");
|
|
9
|
+
var $8GJXj$mapboxgl = require("mapbox-gl");
|
|
10
|
+
var $8GJXj$react = require("react");
|
|
11
|
+
require("mapbox-gl/dist/mapbox-gl.css");
|
|
12
|
+
var $8GJXj$macrostratuicomponents = require("@macrostrat/ui-components");
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
function $parcel$interopDefault(a) {
|
|
16
|
+
return a && a.__esModule ? a.default : a;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function $parcel$export(e, n, v, s) {
|
|
20
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
$parcel$export(module.exports, "MapView", () => $493deb9ab6b848e3$export$ab1e7a67d6ec5ad8);
|
|
24
|
+
$parcel$export(module.exports, "MapTerrainManager", () => $493deb9ab6b848e3$export$cee395a8a2a00b29);
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
const $493deb9ab6b848e3$var$h = (0, ($parcel$interopDefault($8GJXj$macrostrathyper))).styled((0, ($parcel$interopDefault($35f1bc0112883d51$exports))));
|
|
37
|
+
function $493deb9ab6b848e3$var$defaultInitializeMap(container, args = {}) {
|
|
38
|
+
const { mapPosition: mapPosition, ...rest } = args;
|
|
39
|
+
console.log("Initializing map (default)", args);
|
|
40
|
+
const map = new (0, ($parcel$interopDefault($8GJXj$mapboxgl))).Map({
|
|
41
|
+
container: container,
|
|
42
|
+
maxZoom: 18,
|
|
43
|
+
//maxTileCacheSize: 0,
|
|
44
|
+
logoPosition: "bottom-left",
|
|
45
|
+
trackResize: true,
|
|
46
|
+
antialias: true,
|
|
47
|
+
optimizeForTerrain: true,
|
|
48
|
+
...rest
|
|
49
|
+
});
|
|
50
|
+
// set initial map position
|
|
51
|
+
if (mapPosition != null) (0, $8GJXj$macrostratmapboxutils.setMapPosition)(map, mapPosition);
|
|
52
|
+
//setMapPosition(map, mapPosition);
|
|
53
|
+
return map;
|
|
54
|
+
}
|
|
55
|
+
const $493deb9ab6b848e3$var$defaultMapPosition = {
|
|
56
|
+
camera: {
|
|
57
|
+
lat: 34,
|
|
58
|
+
lng: -120,
|
|
59
|
+
altitude: 300000
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
function $493deb9ab6b848e3$export$ab1e7a67d6ec5ad8(props) {
|
|
63
|
+
let { terrainSourceID: terrainSourceID } = props;
|
|
64
|
+
const { enableTerrain: enableTerrain = true, style: style, mapPosition: mapPosition = $493deb9ab6b848e3$var$defaultMapPosition, initializeMap: initializeMap = $493deb9ab6b848e3$var$defaultInitializeMap, children: children, mapboxToken: mapboxToken, accessToken: // Deprecated
|
|
65
|
+
accessToken, infoMarkerPosition: infoMarkerPosition, transformRequest: transformRequest, projection: projection, onMapLoaded: onMapLoaded = null, onStyleLoaded: onStyleLoaded = null, onMapMoved: onMapMoved = null, ...rest } = props;
|
|
66
|
+
if (enableTerrain) terrainSourceID ??= "mapbox-3d-dem";
|
|
67
|
+
const _mapboxToken = mapboxToken ?? accessToken;
|
|
68
|
+
if (_mapboxToken != null) (0, ($parcel$interopDefault($8GJXj$mapboxgl))).accessToken = _mapboxToken;
|
|
69
|
+
const dispatch = (0, $8GJXj$macrostratmapboxreact.useMapDispatch)();
|
|
70
|
+
let mapRef = (0, $8GJXj$macrostratmapboxreact.useMapRef)();
|
|
71
|
+
const ref = (0, $8GJXj$react.useRef)();
|
|
72
|
+
const parentRef = (0, $8GJXj$react.useRef)();
|
|
73
|
+
(0, $8GJXj$macrostratuicomponents.useAsyncEffect)(async ()=>{
|
|
74
|
+
/** Manager to update map style */ if (style == null) return;
|
|
75
|
+
let map = mapRef.current;
|
|
76
|
+
/** If we can, we try to update the map style with terrain information
|
|
77
|
+
* immediately, before the style is loaded. This allows us to avoid a
|
|
78
|
+
* flash of the map without terrain.
|
|
79
|
+
*
|
|
80
|
+
* To do this, we need to estimate the map position before load, which
|
|
81
|
+
* doesn't always work.
|
|
82
|
+
*/ // We either get the map position directly from the map or from props
|
|
83
|
+
const estMapPosition = map == null ? mapPosition : (0, $8GJXj$macrostratmapboxutils.getMapPosition)(map);
|
|
84
|
+
let newStyle = style;
|
|
85
|
+
const { mapUse3D: mapUse3D } = (0, $8GJXj$macrostratmapboxutils.mapViewInfo)(estMapPosition);
|
|
86
|
+
/** If style is a string, we can't update it with terrain layers immediately.
|
|
87
|
+
* We need to wait for the style to load and then update it.
|
|
88
|
+
*/ if (typeof style === "string") newStyle = await (0, $8GJXj$macrostratmapboxutils.getMapboxStyle)(style, {
|
|
89
|
+
access_token: (0, ($parcel$interopDefault($8GJXj$mapboxgl))).accessToken
|
|
90
|
+
});
|
|
91
|
+
if (mapUse3D) // We can update the style with terrain layers immediately
|
|
92
|
+
newStyle = (0, $8GJXj$macrostratmapboxreact.addTerrainToStyle)(newStyle, terrainSourceID);
|
|
93
|
+
if (map != null) {
|
|
94
|
+
console.log("Setting style", newStyle);
|
|
95
|
+
map.setStyle(newStyle);
|
|
96
|
+
} else {
|
|
97
|
+
console.log("Initializing map", newStyle);
|
|
98
|
+
const map = initializeMap(ref.current, {
|
|
99
|
+
style: newStyle,
|
|
100
|
+
projection: projection,
|
|
101
|
+
mapPosition: mapPosition,
|
|
102
|
+
transformRequest: transformRequest,
|
|
103
|
+
...rest
|
|
104
|
+
});
|
|
105
|
+
dispatch({
|
|
106
|
+
type: "set-map",
|
|
107
|
+
payload: map
|
|
108
|
+
});
|
|
109
|
+
map.setPadding((0, $3490fc4f4bda12f7$exports.getMapPadding)(ref, parentRef), {
|
|
110
|
+
animate: false
|
|
111
|
+
});
|
|
112
|
+
onMapLoaded?.(map);
|
|
113
|
+
}
|
|
114
|
+
const loadCallback = ()=>{
|
|
115
|
+
onStyleLoaded?.(map);
|
|
116
|
+
// Set initial terrain state
|
|
117
|
+
dispatch({
|
|
118
|
+
type: "set-style-loaded",
|
|
119
|
+
payload: true
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
map = mapRef.current;
|
|
123
|
+
if (map.style?._loaded) // Catch a race condition where the style is loaded before the callback is set
|
|
124
|
+
loadCallback();
|
|
125
|
+
map.on("style.load", loadCallback);
|
|
126
|
+
return ()=>{
|
|
127
|
+
map.off("style.load", loadCallback);
|
|
128
|
+
};
|
|
129
|
+
}, [
|
|
130
|
+
style
|
|
131
|
+
]);
|
|
132
|
+
const _computedMapPosition = (0, $8GJXj$macrostratmapboxreact.useMapPosition)();
|
|
133
|
+
const { mapUse3D: mapUse3D, mapIsRotated: mapIsRotated } = (0, $8GJXj$macrostratmapboxutils.mapViewInfo)(_computedMapPosition);
|
|
134
|
+
// Get map projection
|
|
135
|
+
const _projection = mapRef.current?.getProjection()?.name ?? "mercator";
|
|
136
|
+
const className = (0, ($parcel$interopDefault($8GJXj$classnames)))({
|
|
137
|
+
"is-rotated": mapIsRotated ?? false,
|
|
138
|
+
"is-3d-available": mapUse3D ?? false
|
|
139
|
+
}, `${_projection}-projection`);
|
|
140
|
+
return $493deb9ab6b848e3$var$h("div.map-view-container.main-view", {
|
|
141
|
+
ref: parentRef
|
|
142
|
+
}, [
|
|
143
|
+
$493deb9ab6b848e3$var$h("div.mapbox-map#map", {
|
|
144
|
+
ref: ref,
|
|
145
|
+
className: className
|
|
146
|
+
}),
|
|
147
|
+
$493deb9ab6b848e3$var$h((0, $2611a7b4364593e5$exports.MapLoadingReporter), {
|
|
148
|
+
ignoredSources: [
|
|
149
|
+
"elevationMarker",
|
|
150
|
+
"crossSectionEndpoints"
|
|
151
|
+
]
|
|
152
|
+
}),
|
|
153
|
+
$493deb9ab6b848e3$var$h((0, $2611a7b4364593e5$exports.MapMovedReporter), {
|
|
154
|
+
onMapMoved: onMapMoved
|
|
155
|
+
}),
|
|
156
|
+
$493deb9ab6b848e3$var$h((0, $2611a7b4364593e5$exports.MapResizeManager), {
|
|
157
|
+
containerRef: ref
|
|
158
|
+
}),
|
|
159
|
+
$493deb9ab6b848e3$var$h((0, $2611a7b4364593e5$exports.MapPaddingManager), {
|
|
160
|
+
containerRef: ref,
|
|
161
|
+
parentRef: parentRef,
|
|
162
|
+
infoMarkerPosition: infoMarkerPosition
|
|
163
|
+
}),
|
|
164
|
+
$493deb9ab6b848e3$var$h($493deb9ab6b848e3$export$cee395a8a2a00b29, {
|
|
165
|
+
mapUse3D: mapUse3D,
|
|
166
|
+
terrainSourceID: terrainSourceID,
|
|
167
|
+
style: style
|
|
168
|
+
}),
|
|
169
|
+
children
|
|
170
|
+
]);
|
|
171
|
+
}
|
|
172
|
+
function $493deb9ab6b848e3$export$cee395a8a2a00b29({ mapUse3D: mapUse3D, terrainSourceID: terrainSourceID, style: style }) {
|
|
173
|
+
(0, $8GJXj$macrostratmapboxreact.use3DTerrain)(mapUse3D, terrainSourceID);
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
//# sourceMappingURL=map-view.12e9ea3e.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAM,0BAAI,CAAA,GAAA,gDAAI,EAAE,MAAM,CAAC,CAAA,GAAA,mDAAK;AA2B5B,SAAS,2CAAqB,SAAS,EAAE,OAAyB,CAAC,CAAC;IAClE,MAAM,eAAE,WAAW,EAAE,GAAG,MAAM,GAAG;IACjC,QAAQ,GAAG,CAAC,8BAA8B;IAE1C,MAAM,MAAM,IAAI,CAAA,GAAA,yCAAO,EAAE,GAAG,CAAC;mBAC3B;QACA,SAAS;QACT,sBAAsB;QACtB,cAAc;QACd,aAAa;QACb,WAAW;QACX,oBAAoB;QACpB,GAAG,IAAI;IACT;IAEA,2BAA2B;IAC3B,IAAI,eAAe,MACjB,CAAA,GAAA,2CAAa,EAAE,KAAK;IAGtB,mCAAmC;IACnC,OAAO;AACT;AAEA,MAAM,2CAAkC;IACtC,QAAQ;QACN,KAAK;QACL,KAAK;QACL,UAAU;IACZ;AACF;AAEO,SAAS,0CAAQ,KAAmB;IACzC,IAAI,mBAAE,eAAe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O;AACT","sources":["packages/map-interface/src/map-view.ts"],"sourcesContent":["import hyper from \"@macrostrat/hyper\";\nimport {\n useMapRef,\n useMapDispatch,\n useMapPosition,\n setup3DTerrain,\n use3DTerrain,\n addTerrainToStyle,\n} from \"@macrostrat/mapbox-react\";\nimport {\n mapViewInfo,\n MapPosition,\n setMapPosition,\n getMapPosition,\n getMapboxStyle,\n} from \"@macrostrat/mapbox-utils\";\nimport classNames from \"classnames\";\nimport mapboxgl from \"mapbox-gl\";\nimport { useEffect, useRef } from \"react\";\nimport styles from \"./main.module.sass\";\nimport {\n MapLoadingReporter,\n MapMovedReporter,\n MapPaddingManager,\n MapResizeManager,\n} from \"./helpers\";\nimport \"mapbox-gl/dist/mapbox-gl.css\";\nimport { getMapPadding } from \"./utils\";\nimport { useAsyncEffect } from \"@macrostrat/ui-components\";\n\nconst h = hyper.styled(styles);\n\ntype MapboxCoreOptions = Omit<mapboxgl.MapboxOptions, \"container\">;\n\nexport interface MapViewProps extends MapboxCoreOptions {\n showLineSymbols?: boolean;\n children?: React.ReactNode;\n mapboxToken?: string;\n // Deprecated\n accessToken?: string;\n terrainSourceID?: string;\n enableTerrain?: boolean;\n infoMarkerPosition?: mapboxgl.LngLatLike;\n mapPosition?: MapPosition;\n initializeMap?: (\n container: HTMLElement,\n args: MapboxOptionsExt\n ) => mapboxgl.Map;\n onMapLoaded?: (map: mapboxgl.Map) => void;\n onStyleLoaded?: (map: mapboxgl.Map) => void;\n onMapMoved?: (mapPosition: MapPosition, map: mapboxgl.Map) => void;\n}\n\nexport interface MapboxOptionsExt extends MapboxCoreOptions {\n mapPosition?: MapPosition;\n}\n\nfunction defaultInitializeMap(container, args: MapboxOptionsExt = {}) {\n const { mapPosition, ...rest } = args;\n console.log(\"Initializing map (default)\", args);\n\n const map = new mapboxgl.Map({\n container,\n maxZoom: 18,\n //maxTileCacheSize: 0,\n logoPosition: \"bottom-left\",\n trackResize: true,\n antialias: true,\n optimizeForTerrain: true,\n ...rest,\n });\n\n // set initial map position\n if (mapPosition != null) {\n setMapPosition(map, mapPosition);\n }\n\n //setMapPosition(map, mapPosition);\n return map;\n}\n\nconst defaultMapPosition: MapPosition = {\n camera: {\n lat: 34,\n lng: -120,\n altitude: 300000,\n },\n};\n\nexport function MapView(props: MapViewProps) {\n let { terrainSourceID } = props;\n const {\n enableTerrain = true,\n style,\n mapPosition = defaultMapPosition,\n initializeMap = defaultInitializeMap,\n children,\n mapboxToken,\n // Deprecated\n accessToken,\n infoMarkerPosition,\n transformRequest,\n projection,\n onMapLoaded = null,\n onStyleLoaded = null,\n onMapMoved = null,\n ...rest\n } = props;\n if (enableTerrain) {\n terrainSourceID ??= \"mapbox-3d-dem\";\n }\n\n const _mapboxToken = mapboxToken ?? accessToken;\n\n if (_mapboxToken != null) {\n mapboxgl.accessToken = _mapboxToken;\n }\n\n const dispatch = useMapDispatch();\n let mapRef = useMapRef();\n const ref = useRef<HTMLDivElement>();\n const parentRef = useRef<HTMLDivElement>();\n\n useAsyncEffect(async () => {\n /** Manager to update map style */\n if (style == null) return;\n let map = mapRef.current;\n\n /** If we can, we try to update the map style with terrain information\n * immediately, before the style is loaded. This allows us to avoid a\n * flash of the map without terrain.\n *\n * To do this, we need to estimate the map position before load, which\n * doesn't always work.\n */\n // We either get the map position directly from the map or from props\n const estMapPosition: MapPosition | null =\n map == null ? mapPosition : getMapPosition(map);\n let newStyle = style;\n const { mapUse3D } = mapViewInfo(estMapPosition);\n\n /** If style is a string, we can't update it with terrain layers immediately.\n * We need to wait for the style to load and then update it.\n */\n if (typeof style === \"string\") {\n newStyle = await getMapboxStyle(style, {\n access_token: mapboxgl.accessToken,\n });\n }\n\n if (mapUse3D) {\n // We can update the style with terrain layers immediately\n newStyle = addTerrainToStyle(newStyle as mapboxgl.Style, terrainSourceID);\n }\n\n if (map != null) {\n console.log(\"Setting style\", newStyle);\n map.setStyle(newStyle);\n } else {\n console.log(\"Initializing map\", newStyle);\n const map = initializeMap(ref.current, {\n style: newStyle,\n projection,\n mapPosition,\n transformRequest,\n ...rest,\n });\n dispatch({ type: \"set-map\", payload: map });\n map.setPadding(getMapPadding(ref, parentRef), { animate: false });\n onMapLoaded?.(map);\n }\n\n const loadCallback = () => {\n onStyleLoaded?.(map);\n // Set initial terrain state\n dispatch({ type: \"set-style-loaded\", payload: true });\n };\n\n map = mapRef.current;\n\n if (map.style?._loaded) {\n // Catch a race condition where the style is loaded before the callback is set\n loadCallback();\n }\n map.on(\"style.load\", loadCallback);\n return () => {\n map.off(\"style.load\", loadCallback);\n };\n }, [style]);\n\n const _computedMapPosition = useMapPosition();\n const { mapUse3D, mapIsRotated } = mapViewInfo(_computedMapPosition);\n\n // Get map projection\n const _projection = mapRef.current?.getProjection()?.name ?? \"mercator\";\n\n const className = classNames(\n {\n \"is-rotated\": mapIsRotated ?? false,\n \"is-3d-available\": mapUse3D ?? false,\n },\n `${_projection}-projection`\n );\n\n return h(\"div.map-view-container.main-view\", { ref: parentRef }, [\n h(\"div.mapbox-map#map\", { ref, className }),\n h(MapLoadingReporter, {\n ignoredSources: [\"elevationMarker\", \"crossSectionEndpoints\"],\n }),\n h(MapMovedReporter, { onMapMoved }),\n h(MapResizeManager, { containerRef: ref }),\n h(MapPaddingManager, { containerRef: ref, parentRef, infoMarkerPosition }),\n h(MapTerrainManager, { mapUse3D, terrainSourceID, style }),\n children,\n ]);\n}\n\nexport function MapTerrainManager({\n mapUse3D,\n terrainSourceID,\n style,\n}: {\n mapUse3D?: boolean;\n terrainSourceID?: string;\n style?: mapboxgl.Style | string;\n}) {\n use3DTerrain(mapUse3D, terrainSourceID);\n\n return null;\n}\n"],"names":[],"version":3,"file":"map-view.12e9ea3e.js.map"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var $33088e8384af337c$exports = require("./main.module.ccec47df.js");
|
|
2
2
|
require("./main.module.becc2fe7.css");
|
|
3
|
-
var $750d69d73bfbdc9a$exports = require("./expansion-panel.
|
|
3
|
+
var $750d69d73bfbdc9a$exports = require("./expansion-panel.ef757efe.js");
|
|
4
4
|
var $dHcMG$blueprintjscore = require("@blueprintjs/core");
|
|
5
5
|
var $dHcMG$macrostratmapboxreact = require("@macrostrat/mapbox-react");
|
|
6
6
|
var $dHcMG$macrostrathyper = require("@macrostrat/hyper");
|
|
@@ -265,4 +265,4 @@ function $db14eb7a5c07abdb$export$617d79dae526d2cf({ features: features }) {
|
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
|
|
268
|
-
//# sourceMappingURL=vector-tile-features.
|
|
268
|
+
//# sourceMappingURL=vector-tile-features.77121785.js.map
|
package/dist/cjs/{vector-tile-features.456f887b.js.map → vector-tile-features.77121785.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,MAAM,0BAAI,CAAA,GAAA,gDAAI,EAAE,MAAM,CAAC,CAAA,GAAA,mDAAK;AAErB,SAAS,0CAAkB,QAAE,IAAI,EAAE,GAAG,MAAM;IACjD,qEAAqE;IACrE,uDAAuD;IACvD,MAAM,CAAC,cAAc,gBAAgB,GAAG,CAAA,GAAA,qBAAO,EAAE;IACjD,MAAM,eAAe,CAAA,GAAA,wBAAU,EAAE,IAAM,gBAAgB,OAAO,EAAE;IAChE,MAAM,eAAe,CAAA,GAAA,wBAAU,EAAE,IAAM,gBAAgB,QAAQ,EAAE;IAEjE,OAAO,wBAAE,0BAA0B;sBAAE;sBAAc;IAAa,GAAG;QACjE,wBAAE,EAAE,CAAC,cAAc,gBAAgB,wBAAE,sCAAgB;kBAAE;QAAK;QAC5D,wBAAE,CAAA,GAAA,sCAAO,GAAG;kBACV;YACA,UAAU;YACV,GAAG,IAAI;QACT;KACD;AACH;AAEO,SAAS,0CAAc,WAAE,OAAO,EAAE;IACvC,MAAM,QAAQ,QAAQ,UAAU;IAChC,OAAO,wBAAE,sBAAsB;QAC7B,wBAAE,EAAE,CAAC,OAAO,IAAI,CAAC,OAAO,MAAM,GAAG,GAAG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;QACR,qBAAqB,wBACnB,CAAA,GAAA,wCAAa,GACb;YACE,OAAO;YACP,WAAW;YACX,UAAU;QACZ,GACA;YACE,wBAAE,8CAAwB;0BACxB;gBACA,UAAU;YACZ;SACD;QAEH,mBAAmB,SAAS,MAAM,CAAC,CAAC,IAAM,EAAE,MAAM,IAAI;IACxD;IAEA,OAAO,wBAAE,qBAAqB;QAC5B;QACA,wBACE,CAAA,GAAA,wCAAa,GACb;mBAAE;YAAO,WAAW;YAAoB,UAAU,iBAAiB;QAAK,GACxE;YACE,wBAAE,qCAAe;gBACf,UAAU;YACZ;SACD;KAEJ;AACH;AAEA,SAAS,oCAAc,YAAE,QAAQ,EAAE;IACjC,6CAA6C,GAC7C,IAAI,YAAY,MAAM,OAAO;IAE7B,MAAM,SAAS,CAAA,GAAA,oBAAI,EAAE,UAAU,CAAC,IAAM,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,EAAE,WAAW,EAAE;IAEtE,OAAO,wBACL,sBACA,MAAM,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,KAAK,SAAS;QACrC,OAAO,wBAAE,qBAAqB;YAC5B,wBAAE,qCAAe;gBAAE,SAAS,QAAQ,CAAC,EAAE;YAAC;YACxC,wBAAE,2CAAU;0BAAE;YAAS;SACxB;IACH;AAEJ;AAEO,SAAS,0CAAS,YAAE,QAAQ,EAAE;IACnC,OAAO,wBACL,gBACA,SAAS,GAAG,CAAC,CAAC,SAAS,IAAM,wBAAE,2CAAe;YAAE,KAAK;qBAAG;QAAQ;AAEpE","sources":["packages/map-interface/src/dev/vector-tile-features.ts"],"sourcesContent":["import { Spinner, Switch, Button, Intent } from \"@blueprintjs/core\";\nimport { useMapRef, useMapStatus } from \"@macrostrat/mapbox-react\";\nimport mapboxgl from \"mapbox-gl\";\nimport hyper from \"@macrostrat/hyper\";\nimport styles from \"./main.module.sass\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { JSONView } from \"@macrostrat/ui-components\";\nimport { group } from \"d3-array\";\nimport { ExpansionPanel } from \"../expansion-panel\";\n\nconst h = hyper.styled(styles);\n\nexport function FeatureProperties({ data, ...rest }) {\n // Instead of managing hover state with CSS, we use a state variable,\n // so that the button re-renders when the state changes\n const [showControls, setShowControls] = useState(false);\n const onMouseEnter = useCallback(() => setShowControls(true), []);\n const onMouseLeave = useCallback(() => setShowControls(false), []);\n\n return h(\"div.feature-properties\", { onMouseEnter, onMouseLeave }, [\n h.if(showControls)(\"div.controls\", h(CopyJSONButton, { data })),\n h(JSONView, {\n data,\n hideRoot: true,\n ...rest,\n }),\n ]);\n}\n\nexport function FeatureRecord({ feature }) {\n const props = feature.properties;\n return h(\"div.feature-record\", [\n h.if(Object.keys(props).length > 0)(FeatureProperties, { data: props }),\n ]);\n}\n\nfunction CopyJSONButton({ data }) {\n const [copied, setCopied] = useState(false);\n return h(Button, {\n icon: copied ? \"tick\" : \"clipboard\",\n intent: copied ? Intent.SUCCESS : Intent.NONE,\n minimal: true,\n small: true,\n onClick() {\n navigator.clipboard.writeText(JSON.stringify(data, null, 2));\n setCopied(true);\n },\n });\n}\n\n/** This component wraps queryRenderedFeatures to get features at a given location */\nexport function FeatureSelectionHandler({\n selectedLocation,\n setFeatures,\n radius = 2,\n}: {\n selectedLocation: mapboxgl.LngLat;\n setFeatures: (features: mapboxgl.MapboxGeoJSONFeature[]) => void;\n radius?: number;\n}) {\n const mapRef = useMapRef();\n const isLoading = useMapStatus((s) => s.isLoading);\n const isInitialized = useMapStatus((s) => s.isInitialized);\n const prevLocation = useRef(null);\n const prevFeatures = useRef([]);\n\n useEffect(() => {\n const map = mapRef?.current;\n if (map == null) return;\n if (selectedLocation == null) {\n setFeatures(null);\n return;\n }\n\n if (!isInitialized) return;\n\n const hasPreviouslyLoadedFeatures = prevFeatures.current.length > 0;\n\n const locationMemo = JSON.stringify(selectedLocation);\n if (locationMemo == prevLocation.current && hasPreviouslyLoadedFeatures)\n return;\n\n prevLocation.current = locationMemo;\n\n // Don't update if the location hasn't changed\n //if (selectedLocation == prevLocation) return;\n\n const r = radius;\n const pt = map.project(selectedLocation);\n\n const bbox: [mapboxgl.PointLike, mapboxgl.PointLike] = [\n [pt.x - r, pt.y - r],\n [pt.x + r, pt.y + r],\n ];\n const features = map.queryRenderedFeatures(bbox);\n prevFeatures.current = features ?? [];\n setFeatures(features);\n }, [isInitialized, selectedLocation, isLoading]);\n\n return null;\n}\n\nfunction FeatureHeader({ feature }) {\n return h(\"div.feature-header\", [\n h(\"h3\", [\n h(KeyValue, { label: \"Source\", value: feature.source }),\n h(KeyValue, { label: \"Source layer\", value: feature.sourceLayer }),\n ]),\n ]);\n}\n\nfunction KeyValue({ label, value }) {\n return h(\"span.key-value\", [h(\"span.key\", label), h(\"code.value\", value)]);\n}\n\nfunction LoadingAwareFeatureSet({ features, sourceID }) {\n const map = useMapRef();\n if (map?.current == null) return null;\n const [isLoaded, setIsLoaded] = useState(false);\n\n const sourceFeatures = features.filter((d) => d.source == \"burwell\");\n\n useEffect(() => {\n if (sourceFeatures.length > 0) {\n setIsLoaded(true);\n return;\n }\n\n const isLoaded = map.current.isSourceLoaded(sourceID);\n setIsLoaded(isLoaded);\n if (!isLoaded) {\n map.current.once(\"sourcedata\", (e) => {\n if (e.sourceId == sourceID) {\n setIsLoaded(true);\n }\n });\n }\n }, [map.current, sourceID, sourceFeatures.length]);\n\n if (!isLoaded) return h(Spinner);\n return h(Features, { features: sourceFeatures });\n}\n\nexport function TileInfo({ feature, showExtent, setShowExtent }) {\n if (feature == null) return null;\n const size = feature._vectorTileFeature._pbf.length;\n return h(\"div.tile-info\", [\n h(\"h3\", \"Tile\"),\n h(\"div.tile-index\", [\n h(KeyValue, { label: \"x\", value: feature._x }),\n h(KeyValue, { label: \"y\", value: feature._y }),\n h(KeyValue, { label: \"z\", value: feature._z }),\n ]),\n h(\"div.spacer\"),\n h(KeyValue, { label: \"Size\", value: formatSize(size) }),\n h(Switch, {\n label: \"Show extent\",\n alignIndicator: \"right\",\n checked: showExtent,\n onChange() {\n setShowExtent(!showExtent);\n },\n }),\n ]);\n}\n\nfunction formatSize(size: number) {\n if (size > 1000000)\n return h(UnitNumber, { value: size / 1000000, unit: \"Mb\" });\n if (size > 1000) return h(UnitNumber, { value: size / 1000, unit: \"Kb\" });\n return `${size} bytes`;\n}\n\nfunction UnitNumber({ value, unit, precision = 1 }) {\n return h(\"span.unit-number\", [\n h(\"span.number\", value.toFixed(precision)),\n h(\"span.unit\", unit),\n ]);\n}\n\nexport function FeaturePanel({ features, focusedSource = null }) {\n if (features == null) return null;\n\n let focusedSourcePanel = null;\n let filteredFeatures = features;\n let title = \"Features\";\n\n if (focusedSource != null) {\n title = \"Basemap features\";\n focusedSourcePanel = h(\n ExpansionPanel,\n {\n title: \"Macrostrat features\",\n className: \"macrostrat-features\",\n expanded: true,\n },\n [\n h(LoadingAwareFeatureSet, {\n features,\n sourceID: focusedSource,\n }),\n ]\n );\n filteredFeatures = features.filter((d) => d.source != focusedSource);\n }\n\n return h(\"div.feature-panel\", [\n focusedSourcePanel,\n h(\n ExpansionPanel,\n { title, className: \"basemap-features\", expanded: focusedSource == null },\n [\n h(FeatureGroups, {\n features: filteredFeatures,\n }),\n ]\n ),\n ]);\n}\n\nfunction FeatureGroups({ features }) {\n /** Group features by source and sourceLayer */\n if (features == null) return null;\n\n const groups = group(features, (d) => `${d.source} - ${d.sourceLayer}`);\n\n return h(\n \"div.feature-groups\",\n Array.from(groups).map(([key, features]) => {\n return h(\"div.feature-group\", [\n h(FeatureHeader, { feature: features[0] }),\n h(Features, { features }),\n ]);\n })\n );\n}\n\nexport function Features({ features }) {\n return h(\n \"div.features\",\n features.map((feature, i) => h(FeatureRecord, { key: i, feature }))\n );\n}\n"],"names":[],"version":3,"file":"vector-tile-features.456f887b.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,MAAM,0BAAI,CAAA,GAAA,gDAAI,EAAE,MAAM,CAAC,CAAA,GAAA,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AAE,EAAE,WAAW,EAAE;IAEtE,OAAO,wBACL,sBACA,MAAM,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,KAAK,SAAS;QACrC,OAAO,wBAAE,qBAAqB;YAC5B,wBAAE,qCAAe;gBAAE,SAAS,QAAQ,CAAC,EAAE;YAAC;YACxC,wBAAE,2CAAU;0BAAE;YAAS;SACxB;IACH;AAEJ;AAEO,SAAS,0CAAS,YAAE,QAAQ,EAAE;IACnC,OAAO,wBACL,gBACA,SAAS,GAAG,CAAC,CAAC,SAAS,IAAM,wBAAE,2CAAe;YAAE,KAAK;qBAAG;QAAQ;AAEpE","sources":["packages/map-interface/src/dev/vector-tile-features.ts"],"sourcesContent":["import { Spinner, Switch, Button, Intent } from \"@blueprintjs/core\";\nimport { useMapRef, useMapStatus } from \"@macrostrat/mapbox-react\";\nimport mapboxgl from \"mapbox-gl\";\nimport hyper from \"@macrostrat/hyper\";\nimport styles from \"./main.module.sass\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { JSONView } from \"@macrostrat/ui-components\";\nimport { group } from \"d3-array\";\nimport { ExpansionPanel } from \"../expansion-panel\";\n\nconst h = hyper.styled(styles);\n\nexport function FeatureProperties({ data, ...rest }) {\n // Instead of managing hover state with CSS, we use a state variable,\n // so that the button re-renders when the state changes\n const [showControls, setShowControls] = useState(false);\n const onMouseEnter = useCallback(() => setShowControls(true), []);\n const onMouseLeave = useCallback(() => setShowControls(false), []);\n\n return h(\"div.feature-properties\", { onMouseEnter, onMouseLeave }, [\n h.if(showControls)(\"div.controls\", h(CopyJSONButton, { data })),\n h(JSONView, {\n data,\n hideRoot: true,\n ...rest,\n }),\n ]);\n}\n\nexport function FeatureRecord({ feature }) {\n const props = feature.properties;\n return h(\"div.feature-record\", [\n h.if(Object.keys(props).length > 0)(FeatureProperties, { data: props }),\n ]);\n}\n\nfunction CopyJSONButton({ data }) {\n const [copied, setCopied] = useState(false);\n return h(Button, {\n icon: copied ? \"tick\" : \"clipboard\",\n intent: copied ? Intent.SUCCESS : Intent.NONE,\n minimal: true,\n small: true,\n onClick() {\n navigator.clipboard.writeText(JSON.stringify(data, null, 2));\n setCopied(true);\n },\n });\n}\n\n/** This component wraps queryRenderedFeatures to get features at a given location */\nexport function FeatureSelectionHandler({\n selectedLocation,\n setFeatures,\n radius = 2,\n}: {\n selectedLocation: mapboxgl.LngLat;\n setFeatures: (features: mapboxgl.MapboxGeoJSONFeature[]) => void;\n radius?: number;\n}) {\n const mapRef = useMapRef();\n const isLoading = useMapStatus((s) => s.isLoading);\n const isInitialized = useMapStatus((s) => s.isInitialized);\n const prevLocation = useRef(null);\n const prevFeatures = useRef([]);\n\n useEffect(() => {\n const map = mapRef?.current;\n if (map == null) return;\n if (selectedLocation == null) {\n setFeatures(null);\n return;\n }\n\n if (!isInitialized) return;\n\n const hasPreviouslyLoadedFeatures = prevFeatures.current.length > 0;\n\n const locationMemo = JSON.stringify(selectedLocation);\n if (locationMemo == prevLocation.current && hasPreviouslyLoadedFeatures)\n return;\n\n prevLocation.current = locationMemo;\n\n // Don't update if the location hasn't changed\n //if (selectedLocation == prevLocation) return;\n\n const r = radius;\n const pt = map.project(selectedLocation);\n\n const bbox: [mapboxgl.PointLike, mapboxgl.PointLike] = [\n [pt.x - r, pt.y - r],\n [pt.x + r, pt.y + r],\n ];\n const features = map.queryRenderedFeatures(bbox);\n prevFeatures.current = features ?? [];\n setFeatures(features);\n }, [isInitialized, selectedLocation, isLoading]);\n\n return null;\n}\n\nfunction FeatureHeader({ feature }) {\n return h(\"div.feature-header\", [\n h(\"h3\", [\n h(KeyValue, { label: \"Source\", value: feature.source }),\n h(KeyValue, { label: \"Source layer\", value: feature.sourceLayer }),\n ]),\n ]);\n}\n\nfunction KeyValue({ label, value }) {\n return h(\"span.key-value\", [h(\"span.key\", label), h(\"code.value\", value)]);\n}\n\nfunction LoadingAwareFeatureSet({ features, sourceID }) {\n const map = useMapRef();\n if (map?.current == null) return null;\n const [isLoaded, setIsLoaded] = useState(false);\n\n const sourceFeatures = features.filter((d) => d.source == \"burwell\");\n\n useEffect(() => {\n if (sourceFeatures.length > 0) {\n setIsLoaded(true);\n return;\n }\n\n const isLoaded = map.current.isSourceLoaded(sourceID);\n setIsLoaded(isLoaded);\n if (!isLoaded) {\n map.current.once(\"sourcedata\", (e) => {\n if (e.sourceId == sourceID) {\n setIsLoaded(true);\n }\n });\n }\n }, [map.current, sourceID, sourceFeatures.length]);\n\n if (!isLoaded) return h(Spinner);\n return h(Features, { features: sourceFeatures });\n}\n\nexport function TileInfo({ feature, showExtent, setShowExtent }) {\n if (feature == null) return null;\n const size = feature._vectorTileFeature._pbf.length;\n return h(\"div.tile-info\", [\n h(\"h3\", \"Tile\"),\n h(\"div.tile-index\", [\n h(KeyValue, { label: \"x\", value: feature._x }),\n h(KeyValue, { label: \"y\", value: feature._y }),\n h(KeyValue, { label: \"z\", value: feature._z }),\n ]),\n h(\"div.spacer\"),\n h(KeyValue, { label: \"Size\", value: formatSize(size) }),\n h(Switch, {\n label: \"Show extent\",\n alignIndicator: \"right\",\n checked: showExtent,\n onChange() {\n setShowExtent(!showExtent);\n },\n }),\n ]);\n}\n\nfunction formatSize(size: number) {\n if (size > 1000000)\n return h(UnitNumber, { value: size / 1000000, unit: \"Mb\" });\n if (size > 1000) return h(UnitNumber, { value: size / 1000, unit: \"Kb\" });\n return `${size} bytes`;\n}\n\nfunction UnitNumber({ value, unit, precision = 1 }) {\n return h(\"span.unit-number\", [\n h(\"span.number\", value.toFixed(precision)),\n h(\"span.unit\", unit),\n ]);\n}\n\nexport function FeaturePanel({ features, focusedSource = null }) {\n if (features == null) return null;\n\n let focusedSourcePanel = null;\n let filteredFeatures = features;\n let title = \"Features\";\n\n if (focusedSource != null) {\n title = \"Basemap features\";\n focusedSourcePanel = h(\n ExpansionPanel,\n {\n title: \"Macrostrat features\",\n className: \"macrostrat-features\",\n expanded: true,\n },\n [\n h(LoadingAwareFeatureSet, {\n features,\n sourceID: focusedSource,\n }),\n ]\n );\n filteredFeatures = features.filter((d) => d.source != focusedSource);\n }\n\n return h(\"div.feature-panel\", [\n focusedSourcePanel,\n h(\n ExpansionPanel,\n { title, className: \"basemap-features\", expanded: focusedSource == null },\n [\n h(FeatureGroups, {\n features: filteredFeatures,\n }),\n ]\n ),\n ]);\n}\n\nfunction FeatureGroups({ features }) {\n /** Group features by source and sourceLayer */\n if (features == null) return null;\n\n const groups = group(features, (d) => `${d.source} - ${d.sourceLayer}`);\n\n return h(\n \"div.feature-groups\",\n Array.from(groups).map(([key, features]) => {\n return h(\"div.feature-group\", [\n h(FeatureHeader, { feature: features[0] }),\n h(Features, { features }),\n ]);\n })\n );\n}\n\nexport function Features({ features }) {\n return h(\n \"div.features\",\n features.map((feature, i) => h(FeatureRecord, { key: i, feature }))\n );\n}\n"],"names":[],"version":3,"file":"vector-tile-features.77121785.js.map"}
|
|
@@ -64,7 +64,7 @@ function $4bdfa9cd8240b2fd$var$_MapAreaContainer({ children: children, className
|
|
|
64
64
|
])
|
|
65
65
|
]);
|
|
66
66
|
let contextStack = null;
|
|
67
|
-
if (navbar != null
|
|
67
|
+
if (navbar != null || contextPanel != null) contextStack = $4bdfa9cd8240b2fd$var$h($4bdfa9cd8240b2fd$var$ContextStack, {
|
|
68
68
|
navbar: navbar,
|
|
69
69
|
...contextStackProps
|
|
70
70
|
}, [
|
|
@@ -123,4 +123,4 @@ function $4bdfa9cd8240b2fd$export$fa395a37c3898ae3({ className: className, child
|
|
|
123
123
|
|
|
124
124
|
|
|
125
125
|
export {$4bdfa9cd8240b2fd$export$ec68dd77edbe678b as PanelCard, $4bdfa9cd8240b2fd$export$612ca936d3ed4784 as DetailPanelStyle, $4bdfa9cd8240b2fd$export$9fa5da0bcfd0a290 as MapAreaContainer, $4bdfa9cd8240b2fd$export$fa395a37c3898ae3 as MapStyledContainer};
|
|
126
|
-
//# sourceMappingURL=container.
|
|
126
|
+
//# sourceMappingURL=container.2ebe27af.js.map
|
|
@@ -1 +1 @@
|
|
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QAC5D,YAAY,CAAA,GAAA,iBAAS,EAAE,WAAW;YAChC,kBAAkB;YAClB,oBAAoB;YACpB,iBAAiB;QACnB;IACF;IAEA,OAAO,wBAAE,OAAO;mBAAE;IAAU,GAAG;AACjC,EAEA,qDAAqD","sources":["packages/map-interface/src/container.ts"],"sourcesContent":["import hyper, { addClassNames } from \"@macrostrat/hyper\";\nimport { HTMLDivProps } from \"@blueprintjs/core\";\nimport styles from \"./main.module.sass\";\nimport classNames from \"classnames\";\nimport { useTransition } from \"transition-hook\";\nimport {\n MapboxMapProvider,\n ZoomControl,\n useMapPosition,\n} from \"@macrostrat/mapbox-react\";\nimport { ToasterContext } from \"@macrostrat/ui-components\";\nimport { MapBottomControls } from \"./controls\";\nimport { mapViewInfo, MapPosition } from \"@macrostrat/mapbox-utils\";\nimport { Card } from \"@blueprintjs/core\";\n\nimport { ReactNode } from \"react\";\n\nconst h = hyper.styled(styles);\n\ntype AnyElement = React.ReactNode | React.ReactElement | React.ReactFragment;\n\nexport const PanelCard = (props) =>\n h(Card, { ...props, className: classNames(\"panel-card\", props.className) });\n\ninterface ContextStackProps extends HTMLDivProps {\n adaptiveWidth: boolean;\n navbar: AnyElement;\n}\n\nexport enum DetailPanelStyle {\n FIXED = \"fixed\",\n FLOATING = \"floating\",\n}\n\nexport const MapAreaContainer = (props) =>\n h(MapProviders, h(_MapAreaContainer, props));\n\ninterface MapAreaContainerProps {\n navbar: AnyElement;\n children?: AnyElement;\n mapControls?: AnyElement;\n contextPanel?: AnyElement;\n contextStack?: AnyElement;\n mainPanel?: AnyElement;\n detailPanel?: AnyElement;\n bottomPanel?: AnyElement;\n className?: string;\n detailPanelOpen?: boolean;\n contextPanelOpen?: boolean;\n contextStackProps?: ContextStackProps;\n detailStackProps?: HTMLDivProps;\n detailPanelStyle: DetailPanelStyle;\n fitViewport?: boolean;\n showPanelOutlines?: boolean;\n preventMapInteraction?: boolean;\n}\n\nfunction _MapAreaContainer({\n children,\n className,\n navbar,\n contextPanel = null,\n detailPanel = null,\n detailPanelOpen,\n contextPanelOpen = true,\n bottomPanel = null,\n mainPanel,\n mapControls = h(MapBottomControls),\n contextStackProps = null,\n detailStackProps = null,\n detailPanelStyle = DetailPanelStyle.FLOATING,\n fitViewport = true,\n showPanelOutlines = false,\n preventMapInteraction = false,\n ...rest\n}: MapAreaContainerProps) {\n const _detailPanelOpen = detailPanelOpen ?? detailPanel != null;\n const contextPanelTrans = useTransition(contextPanelOpen, 800);\n const detailPanelTrans = useTransition(_detailPanelOpen, 800);\n\n /*- We apply a custom style to the panel container when we are interacting\n with the search bar, so that we can block map interactions until search\n bar focus is lost.\n - We also apply a custom style when the infodrawer is open so we can hide\n the search bar on mobile platforms\n - These styles are doubly applied so we can have both namespaced and\n outside-accessible styles for each case.\n */\n const mainUIClassNames = classNames(\n \"map-container\",\n className,\n `detail-panel-${detailPanelStyle}`,\n `context-panel-${contextPanelTrans.stage}`,\n `map-context-${contextPanelTrans.stage}`,\n `detail-panel-${detailPanelTrans.stage}`,\n `map-detail-${detailPanelTrans.stage}`,\n {\n \"detail-panel-open\": _detailPanelOpen,\n \"map-context-open\": contextPanelOpen,\n \"show-panel-outlines\": showPanelOutlines,\n \"fit-viewport\": fitViewport,\n }\n );\n\n const mapControlsExt = h([\n h(ZoomControl, { className: \"zoom-control\" }),\n h(\"div.spacer\"),\n mapControls,\n ]);\n\n const detailStackExt = h(\n \"div.detail-stack.infodrawer-container\",\n detailStackProps,\n [\n h(\"div.detail-panel-holder\", null, detailPanel),\n h.if(detailPanelStyle == DetailPanelStyle.FLOATING)([mapControlsExt]),\n ]\n );\n\n let contextStack = null;\n if (navbar != null
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAM,0BAAI,CAAA,GAAA,sBAAI,EAAE,MAAM,CAAC,CAAA,GAAA,sEAAK;AAIrB,MAAM,4CAAY,CAAC,QACxB,wBAAE,CAAA,GAAA,WAAG,GAAG;QAAE,GAAG,KAAK;QAAE,WA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from \"@macrostrat/hyper\";\nimport { HTMLDivProps } from \"@blueprintjs/core\";\nimport styles from \"./main.module.sass\";\nimport classNames from \"classnames\";\nimport { useTransition } from \"transition-hook\";\nimport {\n MapboxMapProvider,\n ZoomControl,\n useMapPosition,\n} from \"@macrostrat/mapbox-react\";\nimport { ToasterContext } from \"@macrostrat/ui-components\";\nimport { MapBottomControls } from \"./controls\";\nimport { mapViewInfo, MapPosition } from \"@macrostrat/mapbox-utils\";\nimport { Card } from \"@blueprintjs/core\";\n\nimport { ReactNode } from \"react\";\n\nconst h = hyper.styled(styles);\n\ntype AnyElement = React.ReactNode | React.ReactElement | React.ReactFragment;\n\nexport const PanelCard = (props) =>\n h(Card, { ...props, className: classNames(\"panel-card\", props.className) });\n\ninterface ContextStackProps extends HTMLDivProps {\n adaptiveWidth: boolean;\n navbar: AnyElement;\n}\n\nexport enum DetailPanelStyle {\n FIXED = \"fixed\",\n FLOATING = \"floating\",\n}\n\nexport const MapAreaContainer = (props) =>\n h(MapProviders, h(_MapAreaContainer, props));\n\ninterface MapAreaContainerProps {\n navbar: AnyElement;\n children?: AnyElement;\n mapControls?: AnyElement;\n contextPanel?: AnyElement;\n contextStack?: AnyElement;\n mainPanel?: AnyElement;\n detailPanel?: AnyElement;\n bottomPanel?: AnyElement;\n className?: string;\n detailPanelOpen?: boolean;\n contextPanelOpen?: boolean;\n contextStackProps?: ContextStackProps;\n detailStackProps?: HTMLDivProps;\n detailPanelStyle: DetailPanelStyle;\n fitViewport?: boolean;\n showPanelOutlines?: boolean;\n preventMapInteraction?: boolean;\n}\n\nfunction _MapAreaContainer({\n children,\n className,\n navbar,\n contextPanel = null,\n detailPanel = null,\n detailPanelOpen,\n contextPanelOpen = true,\n bottomPanel = null,\n mainPanel,\n mapControls = h(MapBottomControls),\n contextStackProps = null,\n detailStackProps = null,\n detailPanelStyle = DetailPanelStyle.FLOATING,\n fitViewport = true,\n showPanelOutlines = false,\n preventMapInteraction = false,\n ...rest\n}: MapAreaContainerProps) {\n const _detailPanelOpen = detailPanelOpen ?? detailPanel != null;\n const contextPanelTrans = useTransition(contextPanelOpen, 800);\n const detailPanelTrans = useTransition(_detailPanelOpen, 800);\n\n /*- We apply a custom style to the panel container when we are interacting\n with the search bar, so that we can block map interactions until search\n bar focus is lost.\n - We also apply a custom style when the infodrawer is open so we can hide\n the search bar on mobile platforms\n - These styles are doubly applied so we can have both namespaced and\n outside-accessible styles for each case.\n */\n const mainUIClassNames = classNames(\n \"map-container\",\n className,\n `detail-panel-${detailPanelStyle}`,\n `context-panel-${contextPanelTrans.stage}`,\n `map-context-${contextPanelTrans.stage}`,\n `detail-panel-${detailPanelTrans.stage}`,\n `map-detail-${detailPanelTrans.stage}`,\n {\n \"detail-panel-open\": _detailPanelOpen,\n \"map-context-open\": contextPanelOpen,\n \"show-panel-outlines\": showPanelOutlines,\n \"fit-viewport\": fitViewport,\n }\n );\n\n const mapControlsExt = h([\n h(ZoomControl, { className: \"zoom-control\" }),\n h(\"div.spacer\"),\n mapControls,\n ]);\n\n const detailStackExt = h(\n \"div.detail-stack.infodrawer-container\",\n detailStackProps,\n [\n h(\"div.detail-panel-holder\", null, detailPanel),\n h.if(detailPanelStyle == DetailPanelStyle.FLOATING)([mapControlsExt]),\n ]\n );\n\n let contextStack = null;\n if (navbar != null || contextPanel != null) {\n contextStack = h(ContextStack, { navbar, ...contextStackProps }, [\n h.if(contextPanelTrans.shouldMount)([contextPanel]),\n ]);\n }\n\n return h(MapStyledContainer, { className: mainUIClassNames }, [\n h(\"div.main-row\", [\n h(\"div.map-ui\", { ...rest }, [\n contextStack,\n //h(MapView),\n children ?? mainPanel,\n h.if(detailPanelStyle == DetailPanelStyle.FLOATING)([detailStackExt]),\n h.if(detailPanelStyle == DetailPanelStyle.FIXED)(\n \"div.map-control-stack\",\n mapControlsExt\n ),\n ]),\n h.if(detailPanelStyle == DetailPanelStyle.FIXED)([detailStackExt]),\n ]),\n h(\"div.bottom\", null, bottomPanel),\n ]);\n}\n\nfunction ContextStack(props: ContextStackProps) {\n const { adaptiveWidth, navbar, children, ...rest } = props;\n const props1 = addClassNames(rest, { \"adaptive-width\": adaptiveWidth });\n return h(\"div.context-stack\", props1, [\n navbar,\n h(\"div.context-panel-holder\", null, children),\n h(\"div.spacer\"),\n ]);\n}\n\nconst MapProviders = ({ children }) =>\n h(ToasterContext, h(MapboxMapProvider, children));\n\ninterface MapContainerProps {\n className?: string;\n children?: ReactNode;\n}\n\nexport function MapStyledContainer({ className, children }: MapContainerProps) {\n const mapPosition = useMapPosition();\n if (mapPosition != null) {\n const { mapIsRotated, mapUse3D, mapIsGlobal } = mapViewInfo(mapPosition);\n className = classNames(className, {\n \"map-is-rotated\": mapIsRotated,\n \"map-3d-available\": mapUse3D,\n \"map-is-global\": mapIsGlobal,\n });\n }\n\n return h(\"div\", { className }, children);\n}\n\n//const _MapPage = compose(HotkeysProvider, MapPage);\n"],"names":[],"version":3,"file":"container.2ebe27af.js.map"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {h as $a281a0612311d660$export$dda1d9f60106f0e9, MapInspectorV2 as $a281a0612311d660$export$eab3034e57b46e26, DevMapPage as $a281a0612311d660$export$2391061fbdfb71ef} from "./map-page.
|
|
1
|
+
import {h as $a281a0612311d660$export$dda1d9f60106f0e9, MapInspectorV2 as $a281a0612311d660$export$eab3034e57b46e26, DevMapPage as $a281a0612311d660$export$2391061fbdfb71ef} from "./map-page.f9f59ea0.js";
|
|
2
2
|
import {TileExtentLayer as $1d4d29ef2725aa16$export$86c09739b12f23cd} from "./tile-extent.ca526996.js";
|
|
3
|
-
import {FeatureProperties as $b8c84b63e75fe4f2$export$2906e7f4b228efe9, FeatureRecord as $b8c84b63e75fe4f2$export$dc87b4d46cea200d, FeatureSelectionHandler as $b8c84b63e75fe4f2$export$214daccdda0f4ac6, Features as $b8c84b63e75fe4f2$export$617d79dae526d2cf, TileInfo as $b8c84b63e75fe4f2$export$43c75dec9d0b96c, FeaturePanel as $b8c84b63e75fe4f2$export$43277c51a01761c1} from "./vector-tile-features.
|
|
3
|
+
import {FeatureProperties as $b8c84b63e75fe4f2$export$2906e7f4b228efe9, FeatureRecord as $b8c84b63e75fe4f2$export$dc87b4d46cea200d, FeatureSelectionHandler as $b8c84b63e75fe4f2$export$214daccdda0f4ac6, Features as $b8c84b63e75fe4f2$export$617d79dae526d2cf, TileInfo as $b8c84b63e75fe4f2$export$43c75dec9d0b96c, FeaturePanel as $b8c84b63e75fe4f2$export$43277c51a01761c1} from "./vector-tile-features.53b48d66.js";
|
|
4
4
|
import {buildXRayStyle as $64ee2eed3ed5ffbc$export$eff5fb2e10d05b1d, buildInspectorStyle as $64ee2eed3ed5ffbc$export$e739dc8dfc0db9a6} from "./xray.c0663c25.js";
|
|
5
5
|
|
|
6
6
|
|
|
@@ -10,4 +10,4 @@ import {buildXRayStyle as $64ee2eed3ed5ffbc$export$eff5fb2e10d05b1d, buildInspec
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
export {$a281a0612311d660$export$dda1d9f60106f0e9 as h, $a281a0612311d660$export$eab3034e57b46e26 as MapInspectorV2, $a281a0612311d660$export$2391061fbdfb71ef as DevMapPage, $1d4d29ef2725aa16$export$86c09739b12f23cd as TileExtentLayer, $b8c84b63e75fe4f2$export$2906e7f4b228efe9 as FeatureProperties, $b8c84b63e75fe4f2$export$dc87b4d46cea200d as FeatureRecord, $b8c84b63e75fe4f2$export$214daccdda0f4ac6 as FeatureSelectionHandler, $b8c84b63e75fe4f2$export$617d79dae526d2cf as Features, $b8c84b63e75fe4f2$export$43c75dec9d0b96c as TileInfo, $b8c84b63e75fe4f2$export$43277c51a01761c1 as FeaturePanel, $64ee2eed3ed5ffbc$export$eff5fb2e10d05b1d as buildXRayStyle, $64ee2eed3ed5ffbc$export$e739dc8dfc0db9a6 as buildInspectorStyle};
|
|
13
|
-
//# sourceMappingURL=dev.
|
|
13
|
+
//# sourceMappingURL=dev.58b994e7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"","sources":["packages/map-interface/src/dev/index.ts"],"sourcesContent":["export * from \"./map-page\";\nexport * from \"./tile-extent\";\nexport * from \"./vector-tile-features\";\nexport * from \"./xray\";\n"],"names":[],"version":3,"file":"dev.
|
|
1
|
+
{"mappings":"","sources":["packages/map-interface/src/dev/index.ts"],"sourcesContent":["export * from \"./map-page\";\nexport * from \"./tile-extent\";\nexport * from \"./vector-tile-features\";\nexport * from \"./xray\";\n"],"names":[],"version":3,"file":"dev.58b994e7.js.map"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import $h94Kl$
|
|
2
|
-
import "../cjs/main.module.
|
|
3
|
-
import {PanelSubhead as $72e497a412b1da0a$export$ed081779ec3709aa} from "./headers.
|
|
1
|
+
import $h94Kl$mainmodule58922c04js from "./main.module.58922c04.js";
|
|
2
|
+
import "../cjs/main.module.338867af.css";
|
|
3
|
+
import {PanelSubhead as $72e497a412b1da0a$export$ed081779ec3709aa} from "./headers.32db7784.js";
|
|
4
4
|
import {useState as $h94Kl$useState} from "react";
|
|
5
5
|
import {Icon as $h94Kl$Icon, Collapse as $h94Kl$Collapse, Button as $h94Kl$Button} from "@blueprintjs/core";
|
|
6
6
|
import $h94Kl$macrostrathyper from "@macrostrat/hyper";
|
|
@@ -16,7 +16,7 @@ function $parcel$interopDefault(a) {
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
const $d570ac304373e71c$var$h = (0, $h94Kl$macrostrathyper).styled((0, ($parcel$interopDefault($h94Kl$
|
|
19
|
+
const $d570ac304373e71c$var$h = (0, $h94Kl$macrostrathyper).styled((0, ($parcel$interopDefault($h94Kl$mainmodule58922c04js))));
|
|
20
20
|
function $d570ac304373e71c$export$cea00a9d724d5a32(props) {
|
|
21
21
|
const { expanded: expanded, children: children, onChange: onChange, className: className, title: title, titleComponent: titleComponent } = props;
|
|
22
22
|
const icon = expanded ? "chevron-up" : "chevron-down";
|
|
@@ -28,7 +28,8 @@ function $d570ac304373e71c$export$cea00a9d724d5a32(props) {
|
|
|
28
28
|
}, [
|
|
29
29
|
children,
|
|
30
30
|
$d570ac304373e71c$var$h((0, $h94Kl$Icon), {
|
|
31
|
-
icon: icon
|
|
31
|
+
icon: icon,
|
|
32
|
+
className: "expansion-panel-icon"
|
|
32
33
|
})
|
|
33
34
|
]);
|
|
34
35
|
}
|
|
@@ -120,4 +121,4 @@ function $d570ac304373e71c$export$263416b670b3f129({ title: title, className: cl
|
|
|
120
121
|
|
|
121
122
|
|
|
122
123
|
export {$d570ac304373e71c$export$cea00a9d724d5a32 as ExpansionPanelSummary, $d570ac304373e71c$export$39c134eb0b07cf0e as InfoPanelSection, $d570ac304373e71c$export$40e646e38e6ed100 as ExpansionPanel, $d570ac304373e71c$export$d7160281aff7c3b8 as SubExpansionPanel, $d570ac304373e71c$export$44ad9ff780615135 as ExpandableDetailsPanel, $d570ac304373e71c$export$263416b670b3f129 as ExpansionBody, $72e497a412b1da0a$export$ed081779ec3709aa as PanelSubhead};
|
|
123
|
-
//# sourceMappingURL=expansion-panel.
|
|
124
|
+
//# sourceMappingURL=expansion-panel.465b822f.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;AAQA,MAAM,0BAAI,CAAA,GAAA,sBAAI,EAAE,MAAM,CAAC,CAAA,GAAA,sEAAK;AAE5B,SAAS,0CAAsB,KAAK;IAClC,MAAM,YAAE,QAAQ,YAAE,QAAQ,YAAE,QAAQ,aAAE,SAAS,SAAE,KAAK,kBAAE,cAAc,EAAE,GACtE;IACF,MAAM,OAAO,WAAW,eAAe;IACvC,OAAO,wBACL,CAAA,GAAA,yCAAW,GACX;QACE,WAAW,CAAA,GAAA,iBAAS,EAAE,0BAA0B;QAChD,SAAS;eACT;QACA,WAAW;IACb,GACA;QAAC;QAAU,wBAAE,CAAA,GAAA,WAAG,GAAG;kBAAE;YAAM,WAAW;QAAuB;KAAG;AAEpE;AAEA,SAAS,yCAAmB,KAAK;I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KAAM;IAClD,OAAO,wBAAE,0BAA0B;mBAAE;IAAU,GAAG;QAChD,wBAAE,+BAA+B;YAC/B,wBAAE,iCAAiC;YACnC,wBAAE,iCAAiC;gBACjC,wBAAE,CAAA,GAAA,aAAK,GAAG;oBACR,OAAO;oBACP,SAAS;oBACT,QAAQ;oBACR,SAAS,IAAM,UAAU,CAAC;oBAC1B,MAAM;gBACR;aACD;SACF;QACD,wBACE,CAAA,GAAA,eAAO,GACP;oBAAE;QAAO,GACT,wBAAE,mCAAmC,MAAM;KAE9C;AACH;AAEA,SAAS,0CAAc,SAAE,KAAK,aAAE,SAAS,YAAE,QAAQ,EAAE;IACnD,OAAO,wBAAE,sBAAsB;mBAAE;IAAU,GAAG;QAC5C,wBAAE,qCAAqC;QACvC,wBAAE,mCAAmC,MAAM;KAC5C;AACH","sources":["packages/map-interface/src/expansion-panel/index.ts"],"sourcesContent":["import { useState } from \"react\";\nimport { Collapse, Icon } from \"@blueprintjs/core\";\nimport hyper from \"@macrostrat/hyper\";\nimport styles from \"./main.module.sass\";\nimport classNames from \"classnames\";\nimport { Button } from \"@blueprintjs/core\";\nimport { PanelSubhead } from \"./headers\";\n\nconst h = hyper.styled(styles);\n\nfunction ExpansionPanelSummary(props) {\n const { expanded, children, onChange, className, title, titleComponent } =\n props;\n const icon = expanded ? \"chevron-up\" : \"chevron-down\";\n return h(\n PanelSubhead,\n {\n className: classNames(\"expansion-panel-header\", className),\n onClick: onChange,\n title,\n component: titleComponent,\n },\n [children, h(Icon, { icon, className: \"expansion-panel-icon\" })]\n );\n}\n\nfunction ExpansionPanelBase(props) {\n let {\n title,\n titleComponent = \"h3\",\n children,\n expanded,\n helpText,\n onChange = () => {},\n sideComponent = null,\n className,\n } = props;\n const [isOpen, setOpen] = useState(expanded || false);\n\n const onChange_ = () => {\n onChange();\n setOpen(!isOpen);\n };\n\n return h(\n \"div.expansion-panel-base\",\n {\n className: classNames(className, {\n expanded: isOpen,\n collapsed: !isOpen,\n }),\n },\n [\n h(\n ExpansionPanelSummary,\n {\n onChange: onChange_,\n expanded: isOpen,\n title,\n titleComponent,\n },\n h(\"div.expansion-summary-title-help\", [\n h(\"span.expansion-panel-subtext\", helpText),\n \" \",\n sideComponent,\n ])\n ),\n h(Collapse, { isOpen }, h(\"div.expansion-children\", null, children)),\n ]\n );\n}\n\nexport function InfoPanelSection(props) {\n let { title, children, className, headerElement = null } = props;\n return h(\"div.info-panel-section\", { className }, [\n h(\"div.panel-subhead\", null, headerElement ?? h(\"h3\", title)),\n h(\"div.panel-content\", null, children),\n ]);\n}\n\nfunction ExpansionPanel(props) {\n return h(ExpansionPanelBase, {\n ...props,\n className: \"expansion-panel\",\n });\n}\n\nfunction SubExpansionPanel(props) {\n return h(ExpansionPanelBase, {\n ...props,\n className: \"expansion-panel sub-expansion-panel\",\n titleComponent: \"h4\",\n });\n}\n\nfunction ExpandableDetailsPanel(props) {\n let { title, children, value, headerElement, className } = props;\n const [isOpen, setIsOpen] = useState(false);\n headerElement ??= h([h(\"div.title\", title), value]);\n return h(\"div.expandable-details\", { className }, [\n h(\"div.expandable-details-main\", [\n h(\"div.expandable-details-header\", headerElement),\n h(\"div.expandable-details-toggle\", [\n h(Button, {\n small: true,\n minimal: true,\n active: isOpen,\n onClick: () => setIsOpen(!isOpen),\n icon: \"more\",\n }),\n ]),\n ]),\n h(\n Collapse,\n { isOpen },\n h(\"div.expandable-details-children\", null, children)\n ),\n ]);\n}\n\nfunction ExpansionBody({ title, className, children }) {\n return h(\"div.expansion-body\", { className }, [\n h(\"div.expansion-panel-detail-header\", title),\n h(\"div.expansion-panel-detail-body\", null, children),\n ]);\n}\n\nexport {\n ExpansionPanel,\n ExpansionPanelSummary,\n ExpandableDetailsPanel,\n SubExpansionPanel,\n ExpansionBody,\n PanelSubhead,\n};\n"],"names":[],"version":3,"file":"expansion-panel.465b822f.js.map"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import "../cjs/main.module.
|
|
2
|
-
import $fU9jX$
|
|
1
|
+
import "../cjs/main.module.3dbc089f.css";
|
|
2
|
+
import $fU9jX$mainmodule303f6d99js from "./main.module.303f6d99.js";
|
|
3
3
|
import {LngLatCoords as $4fae2d573d730db8$export$f195b3550849e560, Elevation as $4fae2d573d730db8$export$58bfb4f6ec5aa58d} from "./location-info.5543bb05.js";
|
|
4
4
|
import {Button as $fU9jX$Button, Icon as $fU9jX$Icon} from "@blueprintjs/core";
|
|
5
5
|
import $fU9jX$macrostrathyper from "@macrostrat/hyper";
|
|
6
6
|
import {useToaster as $fU9jX$useToaster} from "@macrostrat/ui-components";
|
|
7
7
|
import {useFocusState as $fU9jX$useFocusState, isCentered as $fU9jX$isCentered, LocationFocusButton as $fU9jX$LocationFocusButton} from "@macrostrat/mapbox-react";
|
|
8
|
+
import $fU9jX$classnames from "classnames";
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
function $parcel$interopDefault(a) {
|
|
@@ -16,7 +17,8 @@ function $parcel$interopDefault(a) {
|
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
|
|
21
|
+
const $427faf94283514d4$var$h = (0, $fU9jX$macrostrathyper).styled((0, ($parcel$interopDefault($fU9jX$mainmodule303f6d99js))));
|
|
20
22
|
function $427faf94283514d4$var$PositionButton({ position: position, bounds: bounds, showCopyLink: showCopyLink = false }) {
|
|
21
23
|
const focusState = (0, $fU9jX$useFocusState)(position);
|
|
22
24
|
const copyLinkIsVisible = (0, $fU9jX$isCentered)(focusState) && showCopyLink;
|
|
@@ -66,14 +68,18 @@ function $427faf94283514d4$var$CopyLinkButton({ itemName: itemName, children: ch
|
|
|
66
68
|
}, children ?? "Copy link");
|
|
67
69
|
}
|
|
68
70
|
function $427faf94283514d4$export$e9ff14c4822c2e8c(props) {
|
|
69
|
-
const { onClose: onClose, position: position, bounds: bounds, zoom: zoom = 7, elevation: elevation, showCopyPositionButton: showCopyPositionButton, children: children } = props;
|
|
71
|
+
const { onClose: onClose, position: position, bounds: bounds, zoom: zoom = 7, elevation: elevation, showCopyPositionButton: showCopyPositionButton, fixedHeight: fixedHeight = false, children: children, className: className } = props;
|
|
70
72
|
let leftButton = null;
|
|
71
73
|
if (bounds != null || position != null) leftButton = $427faf94283514d4$var$h($427faf94283514d4$var$PositionButton, {
|
|
72
74
|
position: position,
|
|
73
75
|
bounds: bounds,
|
|
74
76
|
showCopyLink: showCopyPositionButton
|
|
75
77
|
});
|
|
76
|
-
return $427faf94283514d4$var$h("header.location-panel-header",
|
|
78
|
+
return $427faf94283514d4$var$h("header.location-panel-header", {
|
|
79
|
+
className: (0, $fU9jX$classnames)(className, {
|
|
80
|
+
"fixed-height": fixedHeight
|
|
81
|
+
})
|
|
82
|
+
}, [
|
|
77
83
|
leftButton,
|
|
78
84
|
children,
|
|
79
85
|
$427faf94283514d4$var$h("div.spacer"),
|
|
@@ -96,4 +102,4 @@ function $427faf94283514d4$export$e9ff14c4822c2e8c(props) {
|
|
|
96
102
|
|
|
97
103
|
|
|
98
104
|
export {$427faf94283514d4$export$e9ff14c4822c2e8c as InfoDrawerHeader};
|
|
99
|
-
//# sourceMappingURL=header.
|
|
105
|
+
//# sourceMappingURL=header.b4aa864a.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;AAYA,MAAM,0BAAI,CAAA,GAAA,sBAAI,EAAE,MAAM,CAAC,CAAA,GAAA,sEAAK;AAE5B,SAAS,qCAAe,YAAE,QAAQ,UAAE,MAAM,gBAAE,eAAe,OAAO;IAChE,MAAM,aAAa,CAAA,GAAA,oBAAY,EAAE;IAEjC,MAAM,oBAAoB,CAAA,GAAA,iBAAS,EAAE,eAAe;IAEpD,OAAO,wBAAE,yBAAyB;QAChC,wBAAE,CAAA,GAAA,0BAAkB,GAAG;YAAE,UAAU;oBAAU;wBAAQ;QAAW,GAAG,EAAE;QACrE,wBAAE,EAAE,CAAC,qBAAqB,YAAY,MAAM,sCAAgB;YAC1D,UAAU;QACZ;K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;QACA,wBAAE,EAAE,CAAC,WAAW,MAAM,CAAA,GAAA,aAAK,GAAG;YAC5B,SAAS;YACT,MAAM;YACN,SAAS;QACX;KACD;AAEL","sources":["packages/map-interface/src/location-panel/header.ts"],"sourcesContent":["import { Icon, Button } from \"@blueprintjs/core\";\nimport hyper from \"@macrostrat/hyper\";\nimport styles from \"./main.module.sass\";\nimport { useToaster } from \"@macrostrat/ui-components\";\nimport { LngLatCoords, Elevation } from \"../location-info\";\nimport {\n LocationFocusButton,\n useFocusState,\n isCentered,\n} from \"@macrostrat/mapbox-react\";\nimport classNames from \"classnames\";\n\nconst h = hyper.styled(styles);\n\nfunction PositionButton({ position, bounds, showCopyLink = false }) {\n const focusState = useFocusState(position);\n\n const copyLinkIsVisible = isCentered(focusState) && showCopyLink;\n\n return h(\"div.position-controls\", [\n h(LocationFocusButton, { location: position, bounds, focusState }, []),\n h.if(copyLinkIsVisible && position != null)(CopyLinkButton, {\n itemName: \"position\",\n }),\n ]);\n}\n\nfunction CopyLinkButton({ itemName, children, onClick, ...rest }) {\n const toaster = useToaster();\n\n let message = `Copied link`;\n if (itemName != null) {\n message += ` to ${itemName}`;\n }\n message += \"!\";\n\n return h(\n Button,\n {\n className: \"copy-link-button\",\n rightIcon: h(Icon, { icon: \"link\", size: 12 }),\n minimal: true,\n small: true,\n onClick() {\n navigator.clipboard.writeText(window.location.href).then(\n () => {\n toaster?.show({\n message,\n intent: \"success\",\n icon: \"clipboard\",\n timeout: 1000,\n });\n onClick?.();\n },\n () => {\n toaster?.show({\n message: \"Failed to copy link\",\n intent: \"danger\",\n icon: \"error\",\n timeout: 1000,\n });\n }\n );\n },\n ...rest,\n },\n children ?? \"Copy link\"\n );\n}\n\nexport interface InfoDrawerHeaderProps {\n onClose?: () => void;\n position?: mapboxgl.LngLat;\n zoom?: number;\n elevation?: number;\n showCopyPositionButton?: boolean;\n bounds?: mapboxgl.LngLatBounds;\n fixedHeight?: boolean;\n children?: React.ReactNode;\n className?: string;\n}\n\nexport function InfoDrawerHeader(props: InfoDrawerHeaderProps) {\n const {\n onClose,\n position,\n bounds,\n zoom = 7,\n elevation,\n showCopyPositionButton,\n fixedHeight = false,\n children,\n className,\n } = props;\n\n let leftButton = null;\n if (bounds != null || position != null) {\n leftButton = h(PositionButton, {\n position,\n bounds,\n showCopyLink: showCopyPositionButton,\n });\n }\n\n return h(\n \"header.location-panel-header\",\n {\n className: classNames(className, { \"fixed-height\": fixedHeight }),\n },\n [\n leftButton,\n children,\n h(\"div.spacer\"),\n h.if(position != null)(LngLatCoords, {\n position,\n zoom,\n className: \"infodrawer-header-item\",\n }),\n h.if(elevation != null)(Elevation, {\n elevation,\n className: \"infodrawer-header-item\",\n }),\n h.if(onClose != null)(Button, {\n minimal: true,\n icon: \"cross\",\n onClick: onClose,\n }),\n ]\n );\n}\n"],"names":[],"version":3,"file":"header.b4aa864a.js.map"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import $1ittv$
|
|
2
|
-
import "../cjs/main.module.
|
|
1
|
+
import $1ittv$mainmodule58922c04js from "./main.module.58922c04.js";
|
|
2
|
+
import "../cjs/main.module.338867af.css";
|
|
3
3
|
import $1ittv$macrostrathyper from "@macrostrat/hyper";
|
|
4
4
|
|
|
5
5
|
|
|
@@ -8,7 +8,7 @@ function $parcel$interopDefault(a) {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
const $72e497a412b1da0a$var$h = (0, $1ittv$macrostrathyper).styled((0, ($parcel$interopDefault($1ittv$
|
|
11
|
+
const $72e497a412b1da0a$var$h = (0, $1ittv$macrostrathyper).styled((0, ($parcel$interopDefault($1ittv$mainmodule58922c04js))));
|
|
12
12
|
function $72e497a412b1da0a$export$ed081779ec3709aa(props) {
|
|
13
13
|
const { title: title, component: component = "h3", children: children, ...rest } = props;
|
|
14
14
|
return $72e497a412b1da0a$var$h("div.panel-subhead", rest, [
|
|
@@ -21,4 +21,4 @@ function $72e497a412b1da0a$export$ed081779ec3709aa(props) {
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
export {$72e497a412b1da0a$export$ed081779ec3709aa as PanelSubhead};
|
|
24
|
-
//# sourceMappingURL=headers.
|
|
24
|
+
//# sourceMappingURL=headers.32db7784.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;AAGA,MAAM,0BAAI,CAAA,GAAA,sBAAI,EAAE,MAAM,CAAC,CAAA,GAAA,sEAAK;AAErB,SAAS,0CAAa,KAAK;IAChC,MAAM,SAAE,KAAK,aAAE,YAAY,gBAAM,QAAQ,EAAE,GAAG,MAAM,GAAG;IACvD,OAAO,wBAAE,qBAAqB,MAAM;QAClC,wBACE,WACA;YACE,WAAW;QACb,GACA;QAEF;KACD;AACH","sources":["packages/map-interface/src/expansion-panel/headers.ts"],"sourcesContent":["import hyper from \"@macrostrat/hyper\";\nimport styles from \"./main.module.sass\";\n\nconst h = hyper.styled(styles);\n\nexport function PanelSubhead(props) {\n const { title, component = \"h3\", children, ...rest } = props;\n return h(\"div.panel-subhead\", rest, [\n h(\n component,\n {\n className: \"title\",\n },\n title\n ),\n children,\n ]);\n}\n"],"names":[],"version":3,"file":"headers.
|
|
1
|
+
{"mappings":";;;;;;;;;;AAGA,MAAM,0BAAI,CAAA,GAAA,sBAAI,EAAE,MAAM,CAAC,CAAA,GAAA,sEAAK;AAErB,SAAS,0CAAa,KAAK;IAChC,MAAM,SAAE,KAAK,aAAE,YAAY,gBAAM,QAAQ,EAAE,GAAG,MAAM,GAAG;IACvD,OAAO,wBAAE,qBAAqB,MAAM;QAClC,wBACE,WACA;YACE,WAAW;QACb,GACA;QAEF;KACD;AACH","sources":["packages/map-interface/src/expansion-panel/headers.ts"],"sourcesContent":["import hyper from \"@macrostrat/hyper\";\nimport styles from \"./main.module.sass\";\n\nconst h = hyper.styled(styles);\n\nexport function PanelSubhead(props) {\n const { title, component = \"h3\", children, ...rest } = props;\n return h(\"div.panel-subhead\", rest, [\n h(\n component,\n {\n className: \"title\",\n },\n title\n ),\n children,\n ]);\n}\n"],"names":[],"version":3,"file":"headers.32db7784.js.map"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InputHTMLAttributes, DetailedReactHTMLElement, FunctionComponentElement, JSXElementConstructor, ReactElement, DOMAttributes, DOMElement, ReactNode } from "react";
|
|
1
|
+
import { InputHTMLAttributes, DetailedReactHTMLElement, FunctionComponentElement, JSXElementConstructor, ReactElement, DOMAttributes, DOMElement, ReactNode, ComponentType } from "react";
|
|
2
2
|
import { ParsedQuery } from "query-string";
|
|
3
3
|
import { CardProps } from "@blueprintjs/core";
|
|
4
4
|
import mapboxgl from "mapbox-gl";
|
|
@@ -103,6 +103,9 @@ interface InfoDrawerHeaderProps {
|
|
|
103
103
|
elevation?: number;
|
|
104
104
|
showCopyPositionButton?: boolean;
|
|
105
105
|
bounds?: mapboxgl.LngLatBounds;
|
|
106
|
+
fixedHeight?: boolean;
|
|
107
|
+
children?: React.ReactNode;
|
|
108
|
+
className?: string;
|
|
106
109
|
}
|
|
107
110
|
export function MapBottomControls({ children }: {
|
|
108
111
|
children: any;
|
|
@@ -123,11 +126,13 @@ export function MapStyledContainer({ className, children }: MapContainerProps):
|
|
|
123
126
|
className: string;
|
|
124
127
|
}, HTMLElement>;
|
|
125
128
|
export function InfoDrawerContainer(props: any): FunctionComponentElement<any>;
|
|
129
|
+
type Component = string | ComponentType<any>;
|
|
126
130
|
interface BaseInfoDrawerProps extends InfoDrawerHeaderProps {
|
|
127
131
|
className?: string;
|
|
128
132
|
title?: string;
|
|
129
133
|
headerElement?: JSX.Element;
|
|
130
134
|
children?: React.ReactNode;
|
|
135
|
+
contentContainer?: Component;
|
|
131
136
|
}
|
|
132
137
|
export function BaseInfoDrawer(props: BaseInfoDrawerProps): FunctionComponentElement<any>;
|
|
133
138
|
export const DetailsPanel: typeof BaseInfoDrawer;
|
|
@@ -210,9 +215,10 @@ export interface MapboxOptionsExt extends MapboxCoreOptions {
|
|
|
210
215
|
mapPosition?: MapPosition;
|
|
211
216
|
}
|
|
212
217
|
export function MapView(props: MapViewProps): DOMElement<DOMAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
213
|
-
export function MapTerrainManager({ mapUse3D, terrainSourceID, }: {
|
|
218
|
+
export function MapTerrainManager({ mapUse3D, terrainSourceID, style, }: {
|
|
214
219
|
mapUse3D?: boolean;
|
|
215
220
|
terrainSourceID?: string;
|
|
221
|
+
style?: mapboxgl.Style | string;
|
|
216
222
|
}): any;
|
|
217
223
|
type TileIndex = {
|
|
218
224
|
x: number;
|