@wemap/viewer 14.8.0-beta.3 → 14.8.0-beta.5
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/README.md +22 -0
- package/dist/cdn/wemap-viewer.umd.js +8 -8
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +417 -335
- package/dist/src/WemapViewer.d.ts +11 -1
- package/dist/src/WemapViewer.d.ts.map +1 -1
- package/dist/src/frame/SceneFrame.d.ts +10 -0
- package/dist/src/frame/SceneFrame.d.ts.map +1 -1
- package/dist/src/graph/PanoramaPointer.d.ts +2 -0
- package/dist/src/graph/PanoramaPointer.d.ts.map +1 -1
- package/dist/src/graph/PolygonOverlay.d.ts +22 -0
- package/dist/src/graph/PolygonOverlay.d.ts.map +1 -0
- package/dist/src/types/index.d.ts +31 -0
- package/dist/src/types/index.d.ts.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -115,6 +115,26 @@ viewer.setClickMode('measure');
|
|
|
115
115
|
viewer.on('measure', ({ distance }) => showLabel(`${distance.toFixed(2)} m`));
|
|
116
116
|
```
|
|
117
117
|
|
|
118
|
+
## Drawing over the panorama
|
|
119
|
+
|
|
120
|
+
`setPolygons` draws polygons anchored in the real world: a shelf front, an area
|
|
121
|
+
on the floor, a door. Each vertex needs an altitude, in the same reference as
|
|
122
|
+
the graph nodes'. The polygons follow the user from node to node; a new call
|
|
123
|
+
replaces them, an empty list clears them. The panorama has no depth: a polygon
|
|
124
|
+
behind a wall still shows.
|
|
125
|
+
|
|
126
|
+
```ts
|
|
127
|
+
viewer.setPolygons([{
|
|
128
|
+
coordinates: [
|
|
129
|
+
new Coordinates(48.99068, 2.20736, -1.41),
|
|
130
|
+
new Coordinates(48.99067, 2.20742, -1.41),
|
|
131
|
+
new Coordinates(48.99067, 2.20742, 1.24),
|
|
132
|
+
new Coordinates(48.99068, 2.20736, 1.24),
|
|
133
|
+
],
|
|
134
|
+
color: '#3860BE',
|
|
135
|
+
}]);
|
|
136
|
+
```
|
|
137
|
+
|
|
118
138
|
## Events
|
|
119
139
|
|
|
120
140
|
Each constructor callback (`onNavigate`, `onHeadingChange`, `onReady`,
|
|
@@ -133,12 +153,14 @@ off();
|
|
|
133
153
|
| `heading` | `number` (degrees) | The look heading changes |
|
|
134
154
|
| `locate` | `LocatedPoint` | A click in `locate` mode was located |
|
|
135
155
|
| `measure` | `Measurement` | Two clicks in `measure` mode were measured |
|
|
156
|
+
| `click` | `ViewerClick` | A click in `navigate` mode walked nowhere (above the horizon, or no node there): its heading, pitch and node, to pick your own geometry |
|
|
136
157
|
|
|
137
158
|
## Options
|
|
138
159
|
|
|
139
160
|
| Option | Type | Default | Description |
|
|
140
161
|
| -------------------- | --------------------------- | ------- | --------------------------------------------- |
|
|
141
162
|
| `zoom` | `boolean` | `true` | Mouse-wheel zoom |
|
|
163
|
+
| `maxFov` | `number` | `80` | Widest vertical field of view, in degrees |
|
|
142
164
|
| `navigation` | `boolean` | `true` | Click the floor to walk to the nearest node |
|
|
143
165
|
| `onNavigate` | `(nodeId: number) => void` | | A move to a node starts |
|
|
144
166
|
| `onHeadingChange` | `(heading: number) => void` | | The look heading changes |
|