hart-estate-widget 0.0.29 → 0.0.30

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.
@@ -206,12 +206,30 @@ const PanoramaTab = _ref3 => {
206
206
  };
207
207
 
208
208
  (0, _react.useEffect)(() => {
209
+ const container = document.querySelector('.widget-tab__panorama-overlay');
209
210
  const newViewer = new PANOLENS.Viewer({
210
- container: document.querySelector('.widget-tab__panorama-overlay'),
211
+ container,
211
212
  autoHideInfospot: false,
212
213
  controlButtons: [],
213
214
  cameraFov: 90
214
215
  });
216
+ container.addEventListener('mousewheel', e => {
217
+ e.preventDefault();
218
+ e.stopPropagation();
219
+ const scope = newViewer.getControl();
220
+ const fovStep = 2;
221
+
222
+ if (e.deltaY > 0) {
223
+ const newFov = scope.object.fov + fovStep;
224
+ scope.object.fov = newFov < scope.maxFov ? newFov : scope.maxFov;
225
+ scope.object.updateProjectionMatrix();
226
+ return;
227
+ }
228
+
229
+ const newFov = scope.object.fov - fovStep;
230
+ scope.object.fov = newFov > scope.minFov ? newFov : scope.minFov;
231
+ scope.object.updateProjectionMatrix();
232
+ });
215
233
  panoramas.forEach(panorama => {
216
234
  if (!panorama.panorama_id) return;
217
235
  panorama.addEventListener('enter', _ref4 => {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "HART Estate widget",
4
4
  "author": "HART",
5
5
  "keywords": [],
6
- "version": "0.0.29",
6
+ "version": "0.0.30",
7
7
  "private": false,
8
8
  "main": "build/index.js",
9
9
  "module": "build/index.js",