File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,11 @@ export class ViewService {
103103 */
104104 public autoLayoutImmersiveMode = true ;
105105
106+ /**
107+ * Automatically style layer elements
108+ */
109+ public autoStyleLayerElements = true ;
110+
106111 /**
107112 * Automatically publish the viewport of the element during PresentationMode.EMBEDDED
108113 */
@@ -360,6 +365,19 @@ export class ViewService {
360365 } )
361366 }
362367
368+ if ( this . layers && this . autoStyleLayerElements ) {
369+ requestAnimationFrame ( ( ) => {
370+ for ( const layer of this . _layers ) {
371+ const layerStyle = layer . source . style ;
372+ layerStyle . position = 'absolute' ;
373+ layerStyle . left = viewport . x + 'px' ;
374+ layerStyle . bottom = viewport . y + 'px' ;
375+ layerStyle . width = viewport . width + 'px' ;
376+ layerStyle . height = viewport . height + 'px' ;
377+ }
378+ } )
379+ }
380+
363381 this . viewportChangeEvent . raiseEvent ( viewport ) ;
364382 }
365383 }
You can’t perform that action at this time.
0 commit comments