From 5cf97265d3d9d92de63684e164be74de4a049671 Mon Sep 17 00:00:00 2001 From: Wensheng Yan Date: Sun, 2 Jul 2017 13:32:59 -0400 Subject: [PATCH] performance update for marker --- src/scripts/Components/Marker.js | 3 +-- src/scripts/Components/MarkerGroup.js | 2 ++ src/scripts/Panorama.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/scripts/Components/Marker.js b/src/scripts/Components/Marker.js index 553f870..a756334 100644 --- a/src/scripts/Components/Marker.js +++ b/src/scripts/Components/Marker.js @@ -69,8 +69,7 @@ class Marker extends Component{ x: (vector.x + 1) / 2 * width, y: - (vector.y - 1) / 2 * canvas._height }; - this.el().style.left = `${point.x}px`; - this.el().style.top = `${point.y}px`; + this.el().style.transform = `translate(${point.x}px, ${point.y}px)`; } } diff --git a/src/scripts/Components/MarkerGroup.js b/src/scripts/Components/MarkerGroup.js index c78fe32..3cbaa6d 100644 --- a/src/scripts/Components/MarkerGroup.js +++ b/src/scripts/Components/MarkerGroup.js @@ -29,6 +29,8 @@ class MarkerGroup extends Component{ this.options.markers.forEach((markSetting)=>{ this.addMarker(markSetting); }); + + this.renderMarkers(); } attachEvents(){ diff --git a/src/scripts/Panorama.js b/src/scripts/Panorama.js index 4db0f2c..db6e76f 100644 --- a/src/scripts/Panorama.js +++ b/src/scripts/Panorama.js @@ -54,7 +54,7 @@ export const defaults: Settings = { mobileVibrationValue: isIos()? 0.022 : 1, VREnable: runOnMobile, - VRGapDegree: 2.5, + VRGapDegree: 0.5, VRFullscreen: true,//auto fullscreen when in vr mode PanoramaThumbnail: false,