@osm-editor-kit/street-imagery-react 0.1.0-alpha.9 → 1.0.0
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/LICENSE +21 -0
- package/README.md +113 -8
- package/dist/MapillaryPanel-SOHGB7JA.js +3 -0
- package/dist/PanoramaxPanel-5P5LWMRY.js +3 -0
- package/dist/StreetLevelImageryViewer.d.ts +18 -4
- package/dist/{chunk-6EMFFIL2.js → chunk-3DFVM6VK.js} +57 -13
- package/dist/{chunk-25UGGXIE.js → chunk-GYUS2JVV.js} +24 -4
- package/dist/chunk-LZR5SZDS.js +498 -0
- package/dist/chunk-R6BDVYWM.js +665 -0
- package/dist/chunk-XLBFXACK.js +56 -0
- package/dist/filters/PhotoDateRangeFilter.d.ts +4 -1
- package/dist/filters/dateSliderPointer.d.ts +21 -0
- package/dist/hooks/useMapViewportBbox.d.ts +3 -5
- package/dist/hooks/useProviderData.d.ts +9 -3
- package/dist/index.d.ts +11 -10
- package/dist/index.js +3921 -1558
- package/dist/mapillary/useMapillaryFeatures.d.ts +5 -5
- package/dist/panels/MapillaryPanel.d.ts +7 -2
- package/dist/panels/PanoramaxPanel.d.ts +16 -9
- package/dist/panels/PanoramaxWebViewerPanel.d.ts +25 -0
- package/dist/panels/panoramaxDataProvider.d.ts +44 -0
- package/dist/panels/panoramaxItem.d.ts +98 -0
- package/dist/panels/photoView.d.ts +19 -0
- package/dist/panoramax-web-viewer/index.d.ts +1 -0
- package/dist/{chunk-KZTMKQT5.js → panoramax-web-viewer.js} +299 -93
- package/dist/photo-details.js +222 -151
- package/dist/viewer-panels/index.d.ts +3 -1
- package/dist/viewer-panels.js +4 -3
- package/dist/viewpoints/FloatingPhotoViewer.d.ts +22 -7
- package/dist/viewpoints/floatingViewerPosition.d.ts +18 -0
- package/dist/viewpoints/usePhotosLookingAt.d.ts +26 -0
- package/package.json +24 -6
- package/dist/MapillaryPanel-FAXVZH37.js +0 -2
- package/dist/PanoramaxPanel-BTHEMKYY.js +0 -2
- package/dist/chunk-SGIB7AVC.js +0 -309
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Tobias Jordans / OSM Editor Kit
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
# `@osm-editor-kit/street-imagery-react`
|
|
2
2
|
|
|
3
|
+
React and MapLibre layers, hooks and photo viewers for street-level imagery (Mapillary, Panoramax), on top of `@osm-editor-kit/street-imagery`. For apps that show photos on a `react-map-gl` map.
|
|
4
|
+
|
|
3
5
|
> [!NOTE]
|
|
4
|
-
>
|
|
6
|
+
> Claude Opus 5.5 wrote and reviewed the code of this package. [@tordans](https://github.com/tordans) specified what it should do and tested and verified its user-facing behavior.
|
|
5
7
|
|
|
6
|
-
##
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @osm-editor-kit/street-imagery-react
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Peer dependencies to install as well: `@osm-editor-kit/street-imagery`, `react`, `react-dom`, `maplibre-gl`, `react-map-gl`, `@tanstack/react-query`, `zustand`, `mapillary-js`. `@panoramax/web-viewer` is optional (see below). Wrap your app in a TanStack `QueryClientProvider`; the hooks use it.
|
|
7
15
|
|
|
8
|
-
|
|
16
|
+
## What it does
|
|
9
17
|
|
|
10
18
|
- Map sources and layers for photos, sequences, and viewfields
|
|
11
19
|
- Click handling and interactive layer ids
|
|
12
20
|
- TanStack Query hooks to load provider data for the viewport
|
|
13
|
-
- Lazy Mapillary and Panoramax viewer
|
|
21
|
+
- Lazy viewer panels: Mapillary and Panoramax photos in one viewer (`mapillary-js`)
|
|
14
22
|
- Helpers for selection, thumbnails, and easing the map to a photo
|
|
15
23
|
- Viewpoints + floating photo viewer: suggested views per direction, history, map layer
|
|
24
|
+
- Date range slider, photo details dialog, look at a place and outline detections, texts in English and German
|
|
16
25
|
|
|
17
26
|
## Usage
|
|
18
27
|
|
|
@@ -26,7 +35,8 @@ import {
|
|
|
26
35
|
} from '@osm-editor-kit/street-imagery-react'
|
|
27
36
|
import { createStreetImageryConfig } from '@osm-editor-kit/street-imagery'
|
|
28
37
|
|
|
29
|
-
|
|
38
|
+
// Inside <Map id="main">: the bbox follows the map
|
|
39
|
+
const bbox = useMapViewportBbox('main')
|
|
30
40
|
|
|
31
41
|
<StreetLevelImagerySourcesAndLayers
|
|
32
42
|
providers={['mapillary', 'panoramax']}
|
|
@@ -54,9 +64,28 @@ const hits = queryStreetImageryFeatures(event)
|
|
|
54
64
|
|
|
55
65
|
**Before photos are loaded:** where a provider has own vector tiles with its track lines (Mapillary: zoom 6 to 15), MapLibre reads those itself. Same colours and filters; the lines are not clickable. Zoomed far out these tiles are several MB each in dense areas; set `options.minZoom` to skip them.
|
|
56
66
|
|
|
57
|
-
**Mapillary:** `createStreetImageryConfig({ mapillaryToken })` or `setStreetImageryConfig` at boot (`@osm-editor-kit/street-imagery`). **Panoramax
|
|
67
|
+
**Mapillary:** `createStreetImageryConfig({ mapillaryToken })` or `setStreetImageryConfig` at boot (`@osm-editor-kit/street-imagery`). **Panoramax:** nothing to set up, the Mapillary viewer shows its pictures too (see below).
|
|
68
|
+
|
|
69
|
+
Also: `useAllProviderPhotos`, `useProviderPhotos` / `useProviderSequences` / `useProviderMapFeatures`, `usePhotoThumbnail` / `usePhotoFullUrl`, `resolveSelectedSequence`, `StreetLevelImageryViewCone`, `useViewerBearing` / `useViewerActions`. The panels themselves (`MapillaryPanel`, `PanoramaxPanel`) are in `@osm-editor-kit/street-imagery-react/viewer-panels`; `StreetLevelImageryViewer` loads them on demand, so `mapillary-js` is only loaded when a photo is shown.
|
|
70
|
+
|
|
71
|
+
### Panoramax in the Mapillary viewer
|
|
72
|
+
|
|
73
|
+
`PanoramaxPanel` is a `mapillary-js` viewer with a `PanoramaxDataProvider`, which reads the Panoramax API. One viewer engine for both providers: the same arrows, the same view cone on the map, no second engine to load and no build setup.
|
|
74
|
+
|
|
75
|
+
- A picture opens with its `sd` file (2048 px wide). When you zoom in, the original file is loaded once and the sharp parts are cut from it in the browser.
|
|
76
|
+
- Steps along the sequence work (previous, next, play). The arrows to pictures nearby do not: they need Mapillary's 3D reconstruction.
|
|
77
|
+
- The panel shows creator and licence in a line at the bottom; `hideAttribution` removes it.
|
|
78
|
+
- `PanoramaxDataProvider` is exported from `viewer-panels` for a `mapillary-js` `Viewer` you own: `new Viewer({ container, dataProvider: new PanoramaxDataProvider({ endpoint }), imageId })`.
|
|
79
|
+
|
|
80
|
+
**Panoramax's own viewer** (`@panoramax/web-viewer`) is still there as an option:
|
|
58
81
|
|
|
59
|
-
|
|
82
|
+
```tsx
|
|
83
|
+
import { PanoramaxWebViewerPanel } from '@osm-editor-kit/street-imagery-react/panoramax-web-viewer'
|
|
84
|
+
|
|
85
|
+
<StreetLevelImageryViewer panoramaxPanel={PanoramaxWebViewerPanel} … />
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Only then you need `@panoramax/web-viewer` (an optional peer dependency) and its Vite setup: see [`vite.config.ts` of the preview](https://github.com/osm-editor-kit/street-imagery/blob/main/apps/preview/vite.config.ts).
|
|
60
89
|
|
|
61
90
|
## Viewpoints and floating viewer
|
|
62
91
|
|
|
@@ -87,6 +116,60 @@ const { suggestions } = useViewSuggestions(viewpoints, { maxAgeYears: 2 })
|
|
|
87
116
|
Render `FloatingPhotoViewer` inside a positioned map container. Photos from suggestions open in
|
|
88
117
|
`StreetLevelImageryViewer` with `lookAtBearing={suggestion.direction.bearing}`.
|
|
89
118
|
|
|
119
|
+
A host without suggested views leaves out `suggestions`, `activeDirectionKey` and `onSelectSuggestion`; the chips are then not shown. Its own buttons and links go in `titleActions`. They keep their size next to a long title and do not start a drag.
|
|
120
|
+
|
|
121
|
+
For a free window over the whole page, use the viewport as container and let the box leave it until a share of it shows:
|
|
122
|
+
|
|
123
|
+
```tsx
|
|
124
|
+
<FloatingPhotoViewer position="fixed" minVisibleShare={0.2} onClose={close} title="Photo">
|
|
125
|
+
{viewer}
|
|
126
|
+
</FloatingPhotoViewer>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
`position="fixed"` (default `absolute`) needs an ancestor without `transform` or `filter`, and a stacking order that puts the box above the page. `minVisibleShare` (0–1) never lets the box go over the top edge, because the header is what moves it. The limit also holds when the box or the container changes size, and a minimized viewer stays within reach. Without `minVisibleShare` the box keeps 8px from the right and bottom edge.
|
|
130
|
+
|
|
131
|
+
To ask "who sees this spot" instead of "what looks north here", use `usePhotosLookingAt`: flat photos within `maxDistanceMeters` (50) whose heading points at the place within `maxFlatAngleDeg` (35), and 360° photos within the distance, best first. Each candidate has `bearingToPlace`.
|
|
132
|
+
|
|
133
|
+
```tsx
|
|
134
|
+
const [place, setPlace] = useState<LngLat | null>(null) // set on map click
|
|
135
|
+
const [index, setIndex] = useState(0)
|
|
136
|
+
const { candidates } = usePhotosLookingAt(place, { maxAgeYears: 2, enabled: place != null })
|
|
137
|
+
const candidate = candidates[index]
|
|
138
|
+
|
|
139
|
+
{candidate ? (
|
|
140
|
+
<FloatingPhotoViewer
|
|
141
|
+
title="Photos of this place"
|
|
142
|
+
onClose={() => setPlace(null)}
|
|
143
|
+
step={{
|
|
144
|
+
onPrevious: index > 0 ? () => setIndex(index - 1) : undefined,
|
|
145
|
+
onNext: index < candidates.length - 1 ? () => setIndex(index + 1) : undefined,
|
|
146
|
+
previousLabel: 'Previous photo',
|
|
147
|
+
nextLabel: 'Next photo',
|
|
148
|
+
}}
|
|
149
|
+
>
|
|
150
|
+
<StreetLevelImageryViewer
|
|
151
|
+
photo={candidate.photo}
|
|
152
|
+
lookAtBearing={candidate.bearingToPlace}
|
|
153
|
+
… />
|
|
154
|
+
</FloatingPhotoViewer>
|
|
155
|
+
) : null}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
The list needs no chips: `step` gives the `<` `>` buttons and Alt + arrow keys. `lookAtBearing` turns Mapillary 360° photos only. The pure ranking is `rankPhotosLookingAt(place, photos, options)` in the core package.
|
|
159
|
+
|
|
160
|
+
For a link that opens the same photo with the same zoom and pan, keep the view the viewer reports and pass it to `providerExternalLink`:
|
|
161
|
+
|
|
162
|
+
```tsx
|
|
163
|
+
const [view, setView] = useState<PhotoView | null>(null)
|
|
164
|
+
|
|
165
|
+
<StreetLevelImageryViewer onViewerView={setView} … />
|
|
166
|
+
<a href={providerExternalLink(photo, view)}>Open on Mapillary</a>
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
`onViewerView` runs when the view has stopped moving and when the photo changes, not during a drag, for Mapillary (`x`, `y`, `zoom`) and Panoramax (`heading`, `pitch`, `zoom`). A view of another photo is ignored by the link. What a link shows also depends on the size of the window it opens in. Panoramax in the default panel: the viewers differ, so direction and height of the view carry over, not every pixel.
|
|
170
|
+
|
|
171
|
+
**Styles:** the viewer panels import the CSS of `mapillary-js`, so your bundler must handle CSS imports.
|
|
172
|
+
|
|
90
173
|
**Tailwind:** components use Tailwind classes. Tailwind does not scan `node_modules`, so add to your CSS:
|
|
91
174
|
|
|
92
175
|
```css
|
|
@@ -130,6 +213,13 @@ const { data: detections } = useMapillaryImageDetections(photo.photoId, {
|
|
|
130
213
|
Keep the selected sign (`featureId`) and its shown photo in your own state or URL:
|
|
131
214
|
|
|
132
215
|
```tsx
|
|
216
|
+
import { targetImageToPhoto } from '@osm-editor-kit/street-imagery'
|
|
217
|
+
import {
|
|
218
|
+
MapillaryFeatureBar,
|
|
219
|
+
SelectedMapFeatureLayer,
|
|
220
|
+
useSelectedMapillaryFeature,
|
|
221
|
+
} from '@osm-editor-kit/street-imagery-react'
|
|
222
|
+
|
|
133
223
|
const { data, shownImage, firstImage } = useSelectedMapillaryFeature({
|
|
134
224
|
featureId,
|
|
135
225
|
shownPhotoId, // the photo the viewer shows now
|
|
@@ -149,6 +239,8 @@ A click on a sign dot: `queryStreetImageryFeatures(event).find((hit) => hit.kind
|
|
|
149
239
|
`PhotoDateRangeFilter` is the date filter of iD's photo panel as a controlled component: one slider with two handles on a scale that gives recent years more room. It works on plain `{ from?, to? }` days (`YYYY-MM-DD`), the same `DateRange` the layers take as `filter.date`.
|
|
150
240
|
|
|
151
241
|
```tsx
|
|
242
|
+
import { PhotoDateRangeFilter, useAllProviderPhotos } from '@osm-editor-kit/street-imagery-react'
|
|
243
|
+
|
|
152
244
|
const { photos } = useAllProviderPhotos(providers, bbox, zoom) // no date: all photos in view
|
|
153
245
|
|
|
154
246
|
<PhotoDateRangeFilter
|
|
@@ -162,13 +254,22 @@ const { photos } = useAllProviderPhotos(providers, bbox, zoom) // no date: all p
|
|
|
162
254
|
/>
|
|
163
255
|
```
|
|
164
256
|
|
|
165
|
-
A handle at its end means no limit, so the left end also shows photos older than the slider spans (`maxYears`, default 10). The scale itself is in the core package (`dateSliderPosition`, `dateSliderBins`, …) for a host that draws its own chart. The texts are in `messages.dateFilter`.
|
|
257
|
+
A click or tap on the chart moves the nearer handle to that exact place, and a press on the chart can go on as a drag. Handles on the same spot come apart in the direction of the drag. Handles stay separate targets for mouse and touch, at least 44px high and wide, and a vertical swipe on a phone scrolls the page. A handle at its end means no limit, so the left end also shows photos older than the slider spans (`maxYears`, default 10). The scale itself is in the core package (`dateSliderPosition`, `dateSliderBins`, …) for a host that draws its own chart. The texts are in `messages.dateFilter`.
|
|
258
|
+
|
|
259
|
+
## Language
|
|
260
|
+
|
|
261
|
+
Texts and dates are English by default. `StreetImageryLocaleProvider` sets `locale` (`'en'` or `'de'`) and can replace single texts with `messages`.
|
|
262
|
+
|
|
263
|
+
```tsx
|
|
264
|
+
<StreetImageryLocaleProvider locale="de">{children}</StreetImageryLocaleProvider>
|
|
265
|
+
```
|
|
166
266
|
|
|
167
267
|
## Pick a place on the map to open elsewhere
|
|
168
268
|
|
|
169
269
|
A button arms a location opener (see `@osm-editor-kit/street-imagery`), the next map click opens the clicked place in that service and disarms; Escape cancels.
|
|
170
270
|
|
|
171
271
|
```tsx
|
|
272
|
+
import { getLocationOpeners } from '@osm-editor-kit/street-imagery'
|
|
172
273
|
import {
|
|
173
274
|
LocationPickOnMap,
|
|
174
275
|
useArmedLocationOpenerId,
|
|
@@ -208,3 +309,7 @@ import { PHOTO_DETAILS_LABELS, PhotoDetailsDialog } from '@osm-editor-kit/street
|
|
|
208
309
|
```
|
|
209
310
|
|
|
210
311
|
`viewerPhoto` is what `onViewerPhoto` of the viewer gives (Mapillary, Panoramax).
|
|
312
|
+
|
|
313
|
+
## License
|
|
314
|
+
|
|
315
|
+
MIT
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type { NormalizedPhoto } from '@osm-editor-kit/street-imagery';
|
|
1
|
+
import type { NormalizedPhoto, PhotoView } from '@osm-editor-kit/street-imagery';
|
|
2
|
+
import { type ComponentType } from 'react';
|
|
2
3
|
import type { MapillaryLookAt, MapillaryViewerOutline } from './panels/mapillaryLookAt';
|
|
4
|
+
import type { PanoramaxPanelProps } from './panels/PanoramaxPanel';
|
|
3
5
|
import type { StreetImageryPhotoSelection } from './types';
|
|
4
6
|
type StreetLevelImageryViewerProps = {
|
|
5
7
|
photo: NormalizedPhoto;
|
|
@@ -8,6 +10,12 @@ type StreetLevelImageryViewerProps = {
|
|
|
8
10
|
onEaseMapToPoint: (lng: number, lat: number) => void;
|
|
9
11
|
/** Mapillary, Panoramax: full photo data (creator, licence …) for each image the viewer shows. */
|
|
10
12
|
onViewerPhoto?: (photo: NormalizedPhoto) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Mapillary, Panoramax: the view inside the shown photo (pan and zoom), after it has stopped
|
|
15
|
+
* moving and when the photo changes. Pass it to `providerExternalLink` for a link that opens the
|
|
16
|
+
* same view on the provider's site.
|
|
17
|
+
*/
|
|
18
|
+
onViewerView?: (view: PhotoView) => void;
|
|
11
19
|
/** Mapillary 360° photos: initial view bearing (e.g. a suggested view direction). */
|
|
12
20
|
lookAtBearing?: number | null;
|
|
13
21
|
/** Mapillary: turn and zoom to a place (sign, traffic light, junction); wins over `lookAtBearing`. */
|
|
@@ -15,10 +23,16 @@ type StreetLevelImageryViewerProps = {
|
|
|
15
23
|
/** Mapillary: outlines to draw in the shown image. */
|
|
16
24
|
outlines?: MapillaryViewerOutline[];
|
|
17
25
|
/**
|
|
18
|
-
* Hide the viewer's own attribution
|
|
19
|
-
*
|
|
26
|
+
* Hide the viewer's own attribution; the host must then show creator and licence itself, from
|
|
27
|
+
* `onViewerPhoto`.
|
|
20
28
|
*/
|
|
21
29
|
hideAttribution?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Another panel for Panoramax pictures, e.g. `PanoramaxWebViewerPanel` of the
|
|
32
|
+
* `panoramax-web-viewer` entry (Panoramax's own viewer). Default: the Mapillary viewer shows
|
|
33
|
+
* them too.
|
|
34
|
+
*/
|
|
35
|
+
panoramaxPanel?: ComponentType<PanoramaxPanelProps>;
|
|
22
36
|
};
|
|
23
|
-
export declare const StreetLevelImageryViewer: ({ photo, groupPhotos, onPhotoSelected, onEaseMapToPoint, onViewerPhoto, lookAtBearing, lookAt, outlines, hideAttribution, }: StreetLevelImageryViewerProps) => import("react").JSX.Element | null;
|
|
37
|
+
export declare const StreetLevelImageryViewer: ({ photo, groupPhotos, onPhotoSelected, onEaseMapToPoint, onViewerPhoto, onViewerView, lookAtBearing, lookAt, outlines, hideAttribution, panoramaxPanel: PanoramaxPanelOverride, }: StreetLevelImageryViewerProps) => import("react").JSX.Element | null;
|
|
24
38
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
1
2
|
import { DEFAULT_STREET_IMAGERY_LOCALE } from '@osm-editor-kit/street-imagery';
|
|
2
3
|
import { createContext, use } from 'react';
|
|
3
4
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -58,7 +59,12 @@ var en = {
|
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
};
|
|
61
|
-
var COMPASS_DE = {
|
|
62
|
+
var COMPASS_DE = {
|
|
63
|
+
N: "Norden",
|
|
64
|
+
E: "Osten",
|
|
65
|
+
S: "S\xFCden",
|
|
66
|
+
W: "Westen"
|
|
67
|
+
};
|
|
62
68
|
var de = {
|
|
63
69
|
viewer: {
|
|
64
70
|
regionLabel: "Fotoansicht",
|
|
@@ -125,23 +131,61 @@ var DEFAULT_I18N = {
|
|
|
125
131
|
var I18nContext = createContext(DEFAULT_I18N);
|
|
126
132
|
var mergeMessages = (base, overrides) => overrides ? {
|
|
127
133
|
unknownDate: overrides.unknownDate ?? base.unknownDate,
|
|
128
|
-
dateFilter: {
|
|
129
|
-
|
|
130
|
-
|
|
134
|
+
dateFilter: {
|
|
135
|
+
...base.dateFilter,
|
|
136
|
+
...overrides.dateFilter
|
|
137
|
+
},
|
|
138
|
+
viewer: {
|
|
139
|
+
...base.viewer,
|
|
140
|
+
...overrides.viewer
|
|
141
|
+
},
|
|
142
|
+
viewpointRole: {
|
|
143
|
+
...base.viewpointRole,
|
|
144
|
+
...overrides.viewpointRole
|
|
145
|
+
},
|
|
131
146
|
compass: overrides.compass?.length === 8 ? overrides.compass : base.compass,
|
|
132
147
|
viewDirection: overrides.viewDirection ?? base.viewDirection
|
|
133
148
|
} : base;
|
|
134
|
-
var StreetImageryLocaleProvider = ({
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
I18nContext,
|
|
140
|
-
{
|
|
141
|
-
value: { locale, messages: mergeMessages(STREET_IMAGERY_MESSAGES[locale], messages) },
|
|
149
|
+
var StreetImageryLocaleProvider = (t0) => {
|
|
150
|
+
const $ = c(9);
|
|
151
|
+
const {
|
|
152
|
+
locale,
|
|
153
|
+
messages,
|
|
142
154
|
children
|
|
155
|
+
} = t0;
|
|
156
|
+
const t1 = STREET_IMAGERY_MESSAGES[locale];
|
|
157
|
+
let t2;
|
|
158
|
+
if ($[0] !== messages || $[1] !== t1) {
|
|
159
|
+
t2 = mergeMessages(t1, messages);
|
|
160
|
+
$[0] = messages;
|
|
161
|
+
$[1] = t1;
|
|
162
|
+
$[2] = t2;
|
|
163
|
+
} else {
|
|
164
|
+
t2 = $[2];
|
|
165
|
+
}
|
|
166
|
+
let t3;
|
|
167
|
+
if ($[3] !== locale || $[4] !== t2) {
|
|
168
|
+
t3 = {
|
|
169
|
+
locale,
|
|
170
|
+
messages: t2
|
|
171
|
+
};
|
|
172
|
+
$[3] = locale;
|
|
173
|
+
$[4] = t2;
|
|
174
|
+
$[5] = t3;
|
|
175
|
+
} else {
|
|
176
|
+
t3 = $[5];
|
|
143
177
|
}
|
|
144
|
-
|
|
178
|
+
let t4;
|
|
179
|
+
if ($[6] !== children || $[7] !== t3) {
|
|
180
|
+
t4 = /* @__PURE__ */ jsx(I18nContext, { value: t3, children });
|
|
181
|
+
$[6] = children;
|
|
182
|
+
$[7] = t3;
|
|
183
|
+
$[8] = t4;
|
|
184
|
+
} else {
|
|
185
|
+
t4 = $[8];
|
|
186
|
+
}
|
|
187
|
+
return t4;
|
|
188
|
+
};
|
|
145
189
|
var useStreetImageryI18n = () => use(I18nContext);
|
|
146
190
|
|
|
147
191
|
export { STREET_IMAGERY_MESSAGES, StreetImageryLocaleProvider, useStreetImageryI18n };
|
|
@@ -17,9 +17,29 @@ var useViewerStore = create()((set) => ({
|
|
|
17
17
|
reset: () => set(initialState)
|
|
18
18
|
}
|
|
19
19
|
}));
|
|
20
|
-
var useViewerBearing = () =>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var
|
|
20
|
+
var useViewerBearing = () => {
|
|
21
|
+
return useViewerStore(_temp);
|
|
22
|
+
};
|
|
23
|
+
var useViewerHfov = () => {
|
|
24
|
+
return useViewerStore(_temp2);
|
|
25
|
+
};
|
|
26
|
+
var useViewerLngLat = () => {
|
|
27
|
+
return useViewerStore(_temp3);
|
|
28
|
+
};
|
|
29
|
+
var useViewerActions = () => {
|
|
30
|
+
return useViewerStore(_temp4);
|
|
31
|
+
};
|
|
32
|
+
function _temp(state) {
|
|
33
|
+
return state.bearing;
|
|
34
|
+
}
|
|
35
|
+
function _temp2(state) {
|
|
36
|
+
return state.hfov;
|
|
37
|
+
}
|
|
38
|
+
function _temp3(state) {
|
|
39
|
+
return state.lngLat;
|
|
40
|
+
}
|
|
41
|
+
function _temp4(state) {
|
|
42
|
+
return state.actions;
|
|
43
|
+
}
|
|
24
44
|
|
|
25
45
|
export { useViewerActions, useViewerBearing, useViewerHfov, useViewerLngLat };
|