@osm-editor-kit/street-imagery-react 0.1.0-alpha.9 → 1.1.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 +115 -10
- package/dist/MapillaryPanel-SOHGB7JA.js +3 -0
- package/dist/PanoramaxPanel-5P5LWMRY.js +3 -0
- package/dist/StreetLevelImageryViewer.d.ts +19 -5
- 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 +12 -12
- package/dist/index.js +3835 -1563
- package/dist/mapillary/lookAt.d.ts +26 -0
- package/dist/mapillary/useMapillaryFeatures.d.ts +5 -5
- package/dist/panels/MapillaryPanel.d.ts +8 -3
- package/dist/panels/PanoramaxPanel.d.ts +16 -9
- package/dist/panels/PanoramaxWebViewerPanel.d.ts +25 -0
- package/dist/panels/mapillaryLookAt.d.ts +2 -26
- 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/index.d.ts +1 -0
- package/dist/viewer-panels/index.d.ts +3 -1
- package/dist/viewer-panels.js +4 -3
- package/dist/viewer.js +98 -0
- 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 +38 -7
- package/dist/MapillaryPanel-FAXVZH37.js +0 -2
- package/dist/PanoramaxPanel-BTHEMKYY.js +0 -2
- package/dist/chunk-SGIB7AVC.js +0 -309
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { LngLat, TargetShape } from '@osm-editor-kit/street-imagery';
|
|
2
|
+
/** A place the Mapillary viewer should turn to: a sign, a traffic light, a junction … */
|
|
3
|
+
export type MapillaryLookAt = {
|
|
4
|
+
lngLat: LngLat;
|
|
5
|
+
/** Size and height of the target; decides zoom and vertical position. Default: a traffic sign. */
|
|
6
|
+
shape?: TargetShape;
|
|
7
|
+
/** The target's outline in the shown image, if known; it is more exact than the location. */
|
|
8
|
+
outline?: [number, number][];
|
|
9
|
+
/**
|
|
10
|
+
* Mapillary value of the target (`regulatory--bicycles-only--g1`). Without an `outline`, the
|
|
11
|
+
* image's own detection of this value is used: Mapillary links a map feature to few of its
|
|
12
|
+
* images, but almost every image has a detection of it. With several, the one nearest to the
|
|
13
|
+
* computed position wins (the computed position alone can be far off in 360° images).
|
|
14
|
+
*/
|
|
15
|
+
value?: string;
|
|
16
|
+
/** Label for the outline drawn around the target. */
|
|
17
|
+
label?: string;
|
|
18
|
+
};
|
|
19
|
+
export type MapillaryViewerOutline = {
|
|
20
|
+
id: string;
|
|
21
|
+
/** Image ("basic") coordinates, `[0, 0]` top left to `[1, 1]` bottom right. */
|
|
22
|
+
outline: [number, number][];
|
|
23
|
+
label?: string;
|
|
24
|
+
/** CSS color number, e.g. `0xffff00`. Default yellow. */
|
|
25
|
+
color?: number;
|
|
26
|
+
};
|
|
@@ -6,7 +6,7 @@ import { type LngLat, type TargetShape } from '@osm-editor-kit/street-imagery';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare const useMapillaryMapFeatureImages: (featureId: string | null | undefined, { shape }?: {
|
|
8
8
|
shape?: TargetShape;
|
|
9
|
-
}) => import("@tanstack/react-query").UseQueryResult<
|
|
9
|
+
}) => import("@tanstack/react-query").UseQueryResult<import("@osm-editor-kit/street-imagery").MapFeatureImages | null, Error>;
|
|
10
10
|
/**
|
|
11
11
|
* Map features within `radiusMeters` of a point (Graph API), nearest first, e.g. the traffic
|
|
12
12
|
* lights and markings at a junction. `objectValues` accepts wildcards (`object--traffic-light--*`).
|
|
@@ -15,7 +15,7 @@ export declare const useMapillaryMapFeaturesNear: (lngLat: LngLat | null | undef
|
|
|
15
15
|
radiusMeters?: number;
|
|
16
16
|
objectValues?: string[];
|
|
17
17
|
enabled?: boolean;
|
|
18
|
-
}) => import("@tanstack/react-query").UseQueryResult<
|
|
18
|
+
}) => import("@tanstack/react-query").UseQueryResult<{
|
|
19
19
|
id: string;
|
|
20
20
|
value: string;
|
|
21
21
|
lngLat: LngLat;
|
|
@@ -24,7 +24,7 @@ export declare const useMapillaryMapFeaturesNear: (lngLat: LngLat | null | undef
|
|
|
24
24
|
facing: number | null;
|
|
25
25
|
imageIds: string[];
|
|
26
26
|
distanceMeters: number;
|
|
27
|
-
}[]
|
|
27
|
+
}[], Error>;
|
|
28
28
|
/**
|
|
29
29
|
* Detection outlines of one image, for `outlines` of the Mapillary viewer. An image has ~500
|
|
30
30
|
* detections; pass `filter` (e.g. `matchesAnyGroup(JUNCTION_DETECTION_GROUPS)`) and name it with
|
|
@@ -33,7 +33,7 @@ export declare const useMapillaryMapFeaturesNear: (lngLat: LngLat | null | undef
|
|
|
33
33
|
export declare const useMapillaryImageDetections: (imageId: string | null | undefined, { filter, filterKey }?: {
|
|
34
34
|
filter?: (value: string) => boolean;
|
|
35
35
|
filterKey?: string;
|
|
36
|
-
}) => import("@tanstack/react-query").UseQueryResult<
|
|
36
|
+
}) => import("@tanstack/react-query").UseQueryResult<import("@osm-editor-kit/street-imagery").MapillaryDetection[], Error>;
|
|
37
37
|
/**
|
|
38
38
|
* A selected Mapillary map feature (sign, object) for a host's feature + photo selection: all its
|
|
39
39
|
* photos by day, the photo that is shown (`shownPhotoId`), and the one to open first — the best of
|
|
@@ -46,7 +46,7 @@ export declare const useSelectedMapillaryFeature: ({ featureId, shownPhotoId, mi
|
|
|
46
46
|
minCapturedAt?: number | null;
|
|
47
47
|
shape?: TargetShape;
|
|
48
48
|
}) => {
|
|
49
|
-
data:
|
|
49
|
+
data: import("@osm-editor-kit/street-imagery").MapFeatureImages | null;
|
|
50
50
|
isLoading: boolean;
|
|
51
51
|
isError: boolean;
|
|
52
52
|
shownImage: import("@osm-editor-kit/street-imagery").TargetImage | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { NormalizedPhoto } from '@osm-editor-kit/street-imagery';
|
|
1
|
+
import type { NormalizedPhoto, PhotoView } from '@osm-editor-kit/street-imagery';
|
|
2
2
|
import 'mapillary-js/dist/mapillary.css';
|
|
3
|
+
import type { MapillaryLookAt, MapillaryViewerOutline } from '../mapillary/lookAt';
|
|
3
4
|
import type { StreetImageryPhotoSelection } from '../types';
|
|
4
|
-
import { type MapillaryLookAt, type MapillaryViewerOutline } from './mapillaryLookAt';
|
|
5
5
|
type MapillaryPanelProps = {
|
|
6
6
|
photo: NormalizedPhoto;
|
|
7
7
|
groupPhotos: NormalizedPhoto[];
|
|
@@ -9,6 +9,11 @@ type MapillaryPanelProps = {
|
|
|
9
9
|
onEaseMapToPoint: (lng: number, lat: number) => void;
|
|
10
10
|
/** Full photo data for each image the viewer shows (incl. native prev/next navigation). */
|
|
11
11
|
onViewerPhoto?: (photo: NormalizedPhoto) => void;
|
|
12
|
+
/**
|
|
13
|
+
* The view inside the shown photo, after it has stopped moving and when the photo changes. Pass
|
|
14
|
+
* it to `providerExternalLink` for a link that opens the same view.
|
|
15
|
+
*/
|
|
16
|
+
onViewerView?: (view: PhotoView) => void;
|
|
12
17
|
/** 360° photos: turn the view to this map bearing when `photo` opens (e.g. a suggested view). */
|
|
13
18
|
lookAtBearing?: number | null;
|
|
14
19
|
/**
|
|
@@ -25,5 +30,5 @@ type MapillaryPanelProps = {
|
|
|
25
30
|
*/
|
|
26
31
|
hideAttribution?: boolean;
|
|
27
32
|
};
|
|
28
|
-
export declare const MapillaryPanel: ({ photo, onPhotoSelected, onEaseMapToPoint, onViewerPhoto, lookAtBearing, lookAt, outlines, hideAttribution, }: MapillaryPanelProps) => import("react").JSX.Element;
|
|
33
|
+
export declare const MapillaryPanel: ({ photo, onPhotoSelected, onEaseMapToPoint, onViewerPhoto, onViewerView, lookAtBearing, lookAt, outlines, hideAttribution, }: MapillaryPanelProps) => import("react").JSX.Element;
|
|
29
34
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import '@
|
|
2
|
-
import
|
|
1
|
+
import type { NormalizedPhoto, PhotoView } from '@osm-editor-kit/street-imagery';
|
|
2
|
+
import 'mapillary-js/dist/mapillary.css';
|
|
3
3
|
import type { StreetImageryPhotoSelection } from '../types';
|
|
4
|
-
type PanoramaxPanelProps = {
|
|
4
|
+
export type PanoramaxPanelProps = {
|
|
5
5
|
photo: NormalizedPhoto;
|
|
6
6
|
groupPhotos: NormalizedPhoto[];
|
|
7
7
|
onPhotoSelected: (selection: StreetImageryPhotoSelection) => void;
|
|
@@ -9,11 +9,18 @@ type PanoramaxPanelProps = {
|
|
|
9
9
|
/** The shown picture with creator, licence, local capture time and camera. */
|
|
10
10
|
onViewerPhoto?: (photo: NormalizedPhoto) => void;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* `onViewerPhoto`. Stepping through a sequence still works with the arrows in the photo.
|
|
12
|
+
* The view inside the shown photo, after it has stopped moving and when the photo changes. Pass
|
|
13
|
+
* it to `providerExternalLink` for a link that opens the same view.
|
|
15
14
|
*/
|
|
16
|
-
|
|
15
|
+
onViewerView?: (view: PhotoView) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Hide the line with creator and licence. The host must then show both itself, from
|
|
18
|
+
* `onViewerPhoto`.
|
|
19
|
+
*/
|
|
20
|
+
hideAttribution?: boolean;
|
|
17
21
|
};
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Panoramax pictures in the Mapillary viewer (`mapillary-js` with a `PanoramaxDataProvider`): no
|
|
24
|
+
* second viewer engine to load, and the same handling as Mapillary photos.
|
|
25
|
+
*/
|
|
26
|
+
export declare const PanoramaxPanel: ({ photo, onPhotoSelected, onEaseMapToPoint, onViewerPhoto, onViewerView, hideAttribution, }: PanoramaxPanelProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import '@panoramax/web-viewer';
|
|
2
|
+
import type { NormalizedPhoto, PhotoView } from '@osm-editor-kit/street-imagery';
|
|
3
|
+
import type { StreetImageryPhotoSelection } from '../types';
|
|
4
|
+
export type PanoramaxWebViewerPanelProps = {
|
|
5
|
+
photo: NormalizedPhoto;
|
|
6
|
+
groupPhotos: NormalizedPhoto[];
|
|
7
|
+
onPhotoSelected: (selection: StreetImageryPhotoSelection) => void;
|
|
8
|
+
onEaseMapToPoint: (lng: number, lat: number) => void;
|
|
9
|
+
/** The shown picture with creator, licence, local capture time and camera. */
|
|
10
|
+
onViewerPhoto?: (photo: NormalizedPhoto) => void;
|
|
11
|
+
/**
|
|
12
|
+
* The view inside the shown photo, after it has stopped moving and when the photo changes. Pass
|
|
13
|
+
* it to `providerExternalLink` for a link that opens the same view.
|
|
14
|
+
*/
|
|
15
|
+
onViewerView?: (view: PhotoView) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Leave out the viewer's own widgets: the legend (a bottom drawer in narrow containers), the
|
|
18
|
+
* player and the zoom buttons. The host must then show creator and licence itself, from
|
|
19
|
+
* `onViewerPhoto`. Stepping through a sequence still works with the arrows in the photo.
|
|
20
|
+
*/
|
|
21
|
+
hideLegend?: boolean;
|
|
22
|
+
/** Same as `hideLegend`; the name `StreetLevelImageryViewer` passes. */
|
|
23
|
+
hideAttribution?: boolean;
|
|
24
|
+
};
|
|
25
|
+
export declare const PanoramaxWebViewerPanel: ({ photo, onPhotoSelected, onEaseMapToPoint, onViewerPhoto, onViewerView, hideLegend: hideLegendProp, hideAttribution, }: PanoramaxWebViewerPanelProps) => import("react").JSX.Element;
|
|
@@ -1,30 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ViewTarget } from '@osm-editor-kit/street-imagery';
|
|
2
2
|
import { type Image, type Viewer } from 'mapillary-js';
|
|
3
|
-
|
|
4
|
-
export type MapillaryLookAt = {
|
|
5
|
-
lngLat: LngLat;
|
|
6
|
-
/** Size and height of the target; decides zoom and vertical position. Default: a traffic sign. */
|
|
7
|
-
shape?: TargetShape;
|
|
8
|
-
/** The target's outline in the shown image, if known; it is more exact than the location. */
|
|
9
|
-
outline?: [number, number][];
|
|
10
|
-
/**
|
|
11
|
-
* Mapillary value of the target (`regulatory--bicycles-only--g1`). Without an `outline`, the
|
|
12
|
-
* image's own detection of this value is used: Mapillary links a map feature to few of its
|
|
13
|
-
* images, but almost every image has a detection of it. With several, the one nearest to the
|
|
14
|
-
* computed position wins (the computed position alone can be far off in 360° images).
|
|
15
|
-
*/
|
|
16
|
-
value?: string;
|
|
17
|
-
/** Label for the outline drawn around the target. */
|
|
18
|
-
label?: string;
|
|
19
|
-
};
|
|
20
|
-
export type MapillaryViewerOutline = {
|
|
21
|
-
id: string;
|
|
22
|
-
/** Image ("basic") coordinates, `[0, 0]` top left to `[1, 1]` bottom right. */
|
|
23
|
-
outline: [number, number][];
|
|
24
|
-
label?: string;
|
|
25
|
-
/** CSS color number, e.g. `0xffff00`. Default yellow. */
|
|
26
|
-
color?: number;
|
|
27
|
-
};
|
|
3
|
+
import type { MapillaryLookAt, MapillaryViewerOutline } from '../mapillary/lookAt';
|
|
28
4
|
/**
|
|
29
5
|
* Where the target is in the image: from its outline, else computed from the locations
|
|
30
6
|
* (360°: the viewer's own projection; flat: a pinhole model). `undefined` when a flat image does
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { DataProviderBase, type ClusterContract, type CoreImagesContract, type ImagesContract, type ImageTilesContract, type ImageTilesRequestContract, type MeshContract, type SequenceContract, type SpatialImagesContract } from 'mapillary-js';
|
|
2
|
+
import { type PanoramaxItem } from './panoramaxItem';
|
|
3
|
+
export type PanoramaxDataProviderOptions = {
|
|
4
|
+
/** The Panoramax API, e.g. `https://api.panoramax.xyz/api`. */
|
|
5
|
+
endpoint: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Lets a mapillary-js `Viewer` show Panoramax pictures: pass it as the viewer's `dataProvider`.
|
|
9
|
+
*
|
|
10
|
+
* A picture opens with its `sd` file (2048 px wide). The viewer then asks for tiles of the part in
|
|
11
|
+
* view; they are cut here, in the browser. Only when the view needs more detail than `sd` has is
|
|
12
|
+
* the original file loaded for that, once. (Panoramax has tiles of its own for 360° pictures only,
|
|
13
|
+
* in another layout.)
|
|
14
|
+
*
|
|
15
|
+
* Panoramax has no 3D reconstruction, so the viewer places each picture by its compass direction
|
|
16
|
+
* and offers the steps along the sequence only, not the arrows to pictures nearby.
|
|
17
|
+
*
|
|
18
|
+
* A Panoramax sequence can hold thousands of pictures and the API has no short list of them, so
|
|
19
|
+
* the viewer never gets the whole sequence. Every picture gets a short one of its own: the
|
|
20
|
+
* picture before, the picture, the picture after. `Image.sequenceId` of the viewer is therefore
|
|
21
|
+
* not the Panoramax sequence; use `getItem(id).collection`.
|
|
22
|
+
*/
|
|
23
|
+
export declare class PanoramaxDataProvider extends DataProviderBase {
|
|
24
|
+
private readonly endpoint;
|
|
25
|
+
private readonly items;
|
|
26
|
+
private readonly itemRequests;
|
|
27
|
+
private readonly imageBuffers;
|
|
28
|
+
private readonly pictures;
|
|
29
|
+
constructor({ endpoint }: PanoramaxDataProviderOptions);
|
|
30
|
+
/** The Panoramax data of a picture the viewer has loaded. */
|
|
31
|
+
getItem(imageId: string): PanoramaxItem | undefined;
|
|
32
|
+
getCoreImages(cellId: string): Promise<CoreImagesContract>;
|
|
33
|
+
getImages(imageIds: string[]): Promise<ImagesContract>;
|
|
34
|
+
getSpatialImages(imageIds: string[]): Promise<SpatialImagesContract>;
|
|
35
|
+
getSequence(sequenceId: string): Promise<SequenceContract>;
|
|
36
|
+
getImageBuffer(url: string): Promise<ArrayBuffer>;
|
|
37
|
+
getImageTiles({ imageId, z, }: ImageTilesRequestContract): Promise<ImageTilesContract>;
|
|
38
|
+
private cutTile;
|
|
39
|
+
private loadPicture;
|
|
40
|
+
getMesh(): Promise<MeshContract>;
|
|
41
|
+
getCluster(url: string): Promise<ClusterContract>;
|
|
42
|
+
private loadItems;
|
|
43
|
+
private toImageEnt;
|
|
44
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { NormalizedPhoto } from '@osm-editor-kit/street-imagery';
|
|
2
|
+
/** The parts of a Panoramax picture (a STAC item of `/api/search`) the viewer reads. */
|
|
3
|
+
export type PanoramaxItem = {
|
|
4
|
+
id: string;
|
|
5
|
+
collection?: string;
|
|
6
|
+
geometry: {
|
|
7
|
+
type: 'Point';
|
|
8
|
+
coordinates: [number, number];
|
|
9
|
+
};
|
|
10
|
+
links?: {
|
|
11
|
+
rel: string;
|
|
12
|
+
href?: string;
|
|
13
|
+
/** `prev` and `next` name the neighbour in the sequence. */
|
|
14
|
+
id?: string;
|
|
15
|
+
/** `via` names the server the picture is stored on. */
|
|
16
|
+
instance_name?: string;
|
|
17
|
+
}[];
|
|
18
|
+
assets?: Partial<Record<'hd' | 'sd' | 'thumb', {
|
|
19
|
+
href: string;
|
|
20
|
+
}>>;
|
|
21
|
+
providers?: {
|
|
22
|
+
name: string;
|
|
23
|
+
roles?: string[];
|
|
24
|
+
}[];
|
|
25
|
+
properties?: {
|
|
26
|
+
datetime?: string;
|
|
27
|
+
datetimetz?: string;
|
|
28
|
+
created?: string;
|
|
29
|
+
license?: string;
|
|
30
|
+
exif?: Record<string, unknown>;
|
|
31
|
+
'view:azimuth'?: number | null;
|
|
32
|
+
'geovisio:producer'?: string;
|
|
33
|
+
'geovisio:rank_in_collection'?: number;
|
|
34
|
+
'original_file:name'?: string;
|
|
35
|
+
'original_file:size'?: number;
|
|
36
|
+
'quality:horizontal_accuracy'?: number;
|
|
37
|
+
'pers:interior_orientation'?: {
|
|
38
|
+
camera_manufacturer?: string;
|
|
39
|
+
camera_model?: string;
|
|
40
|
+
focal_length?: number;
|
|
41
|
+
/** Horizontal field of view in degrees; 360 for a 360° picture. */
|
|
42
|
+
field_of_view?: number | null;
|
|
43
|
+
/** Width and height of the picture in pixels. */
|
|
44
|
+
sensor_array_dimensions?: [number, number];
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export declare const isPanoramaxItemSpherical: (item: PanoramaxItem) => boolean;
|
|
49
|
+
/** Horizontal field of view in degrees. */
|
|
50
|
+
export declare const panoramaxItemFieldOfView: (item: PanoramaxItem) => number;
|
|
51
|
+
/** Width and height in pixels; a guess when the picture does not state them. */
|
|
52
|
+
export declare const panoramaxItemSize: (item: PanoramaxItem) => [number, number];
|
|
53
|
+
/** Neighbour in the sequence, from the item's `prev` / `next` link. */
|
|
54
|
+
export declare const panoramaxItemNeighbour: (item: PanoramaxItem, rel: 'prev' | 'next') => string | null;
|
|
55
|
+
/** The file a picture opens with: `sd`, 2048 px wide. */
|
|
56
|
+
export declare const panoramaxItemImageUrl: (item: PanoramaxItem) => string;
|
|
57
|
+
type PictureSize = [width: number, height: number];
|
|
58
|
+
/**
|
|
59
|
+
* The size to tell mapillary-js: the real proportions, with the longer side raised to the next
|
|
60
|
+
* power of two. Its tile levels halve from that power of two, so a picture of 8704 px would get
|
|
61
|
+
* levels of 4352, 2176, 1088 px, the low ones coarser than the `sd` file. This way they are
|
|
62
|
+
* 8192, 4096, 2048 px.
|
|
63
|
+
*/
|
|
64
|
+
export declare const panoramaxViewerSize: (item: PanoramaxItem) => PictureSize;
|
|
65
|
+
/** Whether level `z` shows more detail than the `sd` file; only then the original is needed. */
|
|
66
|
+
export declare const panoramaxLevelNeedsOriginal: (size: PictureSize, z: number) => boolean;
|
|
67
|
+
/** The tiles of a picture at level `z`. */
|
|
68
|
+
export declare const panoramaxTilesOfLevel: (size: PictureSize, z: number) => {
|
|
69
|
+
x: number;
|
|
70
|
+
y: number;
|
|
71
|
+
}[];
|
|
72
|
+
/**
|
|
73
|
+
* Where to cut a tile from a file of the picture, and how large to draw it. `original` is the
|
|
74
|
+
* size of that file; the cut is scaled when it differs from the stated `size`.
|
|
75
|
+
*/
|
|
76
|
+
export declare const panoramaxTileRect: (size: PictureSize, tile: {
|
|
77
|
+
x: number;
|
|
78
|
+
y: number;
|
|
79
|
+
z: number;
|
|
80
|
+
}, original: {
|
|
81
|
+
width: number;
|
|
82
|
+
height: number;
|
|
83
|
+
}) => {
|
|
84
|
+
x: number;
|
|
85
|
+
y: number;
|
|
86
|
+
width: number;
|
|
87
|
+
height: number;
|
|
88
|
+
outWidth: number;
|
|
89
|
+
outHeight: number;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Focal length of a flat picture as mapillary-js wants it: relative to the longer side. A
|
|
93
|
+
* picture without a field of view gets a common one.
|
|
94
|
+
*/
|
|
95
|
+
export declare const panoramaxItemFocal: (item: PanoramaxItem) => number;
|
|
96
|
+
/** The picture as a photo with creator, licence, local capture time and camera. */
|
|
97
|
+
export declare const panoramaxPhotoFromItem: (item: PanoramaxItem) => NormalizedPhoto;
|
|
98
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { PhotoView } from '@osm-editor-kit/street-imagery';
|
|
2
|
+
import type { Viewer } from 'mapillary-js';
|
|
3
|
+
/**
|
|
4
|
+
* The Panoramax viewer's zoom level (0–100) for a vertical field of view in mapillary-js, from
|
|
5
|
+
* that viewer's own limits, so that both show the same height of the picture. In a flat picture
|
|
6
|
+
* the degrees differ: mapillary-js draws it through a lens, the Panoramax viewer as part of a
|
|
7
|
+
* sphere, where each degree has the same width.
|
|
8
|
+
*/
|
|
9
|
+
export declare const panoramaxZoomLevel: (verticalFov: number, horizontalFovOfPicture: number) => number;
|
|
10
|
+
/**
|
|
11
|
+
* Calls `report` once the view has stopped changing, and only when it differs from the last one.
|
|
12
|
+
* `viewChanged` is cheap enough for every frame of a drag.
|
|
13
|
+
*/
|
|
14
|
+
export declare const createPhotoViewReporter: (read: () => Promise<PhotoView | null>, report: (view: PhotoView) => void, delayMs?: number) => {
|
|
15
|
+
viewChanged: () => void;
|
|
16
|
+
stop: () => void;
|
|
17
|
+
};
|
|
18
|
+
/** Runs the reporter on a mapillary-js viewer until the returned function is called. */
|
|
19
|
+
export declare const watchMapillaryJsView: (viewer: Viewer, read: () => Promise<PhotoView | null>, report: (view: PhotoView) => void) => (() => void);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PanoramaxWebViewerPanel } from '../panels/PanoramaxWebViewerPanel';
|