Skip to content

Commit aa2ef32

Browse files
authored
Fix collab view bug (#450)
* Fix collab view bug * Fix?
1 parent e4fb2f5 commit aa2ef32

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/base/src/mainview/mainView.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,9 +1323,10 @@ export class MainView extends React.Component<IProps, IStates> {
13231323
};
13241324

13251325
private _onSharedOptionsChanged(): void {
1326-
if (!this.state.remoteUser) {
1326+
if (!this._isPositionInitialized) {
13271327
const options = this._model.getOptions();
13281328
this.updateOptions(options);
1329+
this._isPositionInitialized = true;
13291330
}
13301331
}
13311332

@@ -1339,7 +1340,6 @@ export class MainView extends React.Component<IProps, IStates> {
13391340
zoom,
13401341
bearing
13411342
} = options;
1342-
13431343
let view = this._Map.getView();
13441344
const currentProjection = view.getProjection().getCode();
13451345

@@ -1788,6 +1788,7 @@ export class MainView extends React.Component<IProps, IStates> {
17881788

17891789
private _clickCoords: Coordinate;
17901790
private _commands: CommandRegistry;
1791+
private _isPositionInitialized = false;
17911792
private divRef = React.createRef<HTMLDivElement>(); // Reference of render div
17921793
private _Map: OlMap;
17931794
private _model: IJupyterGISModel;

0 commit comments

Comments
 (0)