forked from JeremyHeleine/Photo-Sphere-Viewer
-
-
Notifications
You must be signed in to change notification settings - Fork 630
/
model.ts
180 lines (157 loc) · 3.36 KB
/
model.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
import { Point } from '@photo-sphere-viewer/core';
export type MapHotspotStyle = {
/**
* Size of the hotspot
* @default 15
*/
size?: number;
/**
* SVG or image URL used for hotspot
*/
image?: string;
/**
* Color of the hotspot when no image is provided
* @default 'white'
*/
color?: string;
/**
* Size on mouse hover
* @default null
*/
hoverSize?: number;
/**
* SVG or image URL on mouse hover
* @default null
*/
hoverImage?: string;
/**
* Color on mouse hover
* @default null
*/
hoverColor?: string;
/**
* Size of the border shown on mouse hover
* @default 4
*/
hoverBorderSize?: number;
/**
* Color of the border shown on mouse hover
* @default 'rgba(255, 255, 255, 0.6)'
*/
hoverBorderColor?: string;
};
export type MapHotspot = (Point | { yaw: number | string; distance: number }) & MapHotspotStyle & {
/**
* Unique identifier for the {@link SelectHotspot} event
*/
id?: string;
/**
* Tooltip visible on the map
*/
tooltip?: string | { content: string; className?: string };
};
export type MapPluginConfig = {
/**
* URL of the map
*/
imageUrl?: string;
/**
* The position of the panorama on the map
*/
center?: Point;
/**
* Rotation to apply to the image
* @default 0
*/
rotation?: string | number;
/**
* Size of the map
* @default '200px'
*/
size?: string;
/**
* Position of the map
* @default 'bottom left'
*/
position?: string | [string, string];
/**
* Displays the map when loading the first panorama
* @default true
*/
visibleOnLoad?: boolean;
/**
* SVG or image URL drawn on top of the map (must be square)
*/
overlayImage?: string;
/**
* SVG or image URL used for the central pin (must be square)
*/
pinImage?: string;
/**
* Size of the central pin
* @default 35
*/
pinSize?: number;
/**
* Color of the cone of the compass
* @default '#1E78E6'
*/
coneColor?: string;
/**
* Size of the cone of the compass
* @default 40
*/
coneSize?: number;
/**
* Default style of hotspots
*/
spotStyle?: MapHotspotStyle;
/**
* Make the map static and rotate the pin instead
* @default false
*/
static?: boolean;
/**
* Default zoom level
* @default 100
*/
defaultZoom?: number;
/**
* Minimum zoom level
* @default 20
*/
minZoom?: number;
/**
* Maximum zoom level
* @default 200
*/
maxZoom?: number;
/**
* Points of interest on the map
*/
hotspots?: MapHotspot[];
/**
* Configuration of map buttons
*/
buttons?: {
/** @default true */
maximize?: boolean;
/** @default true */
close?: boolean;
/** @default true */
reset?: boolean;
/** @default true */
north?: boolean;
};
};
export type ParsedMapPluginConfig = Omit<MapPluginConfig, 'position' | 'rotation'> & {
position: [string, string];
rotation: number;
};
export type UpdatableMapPluginConfig = Omit<
MapPluginConfig,
| 'imageUrl'
| 'visibleOnLoad'
| 'defaultZoom'
| 'buttons'
>;