Skip to content

Commit 958383a

Browse files
Jeremy EychenneYakoust
authored andcommitted
fix(view): set the center explicitly because it does not work via setProperties
1 parent f695cbe commit 958383a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

projects/ngx-openlayers/src/lib/view.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ export class ViewComponent implements OnInit, OnChanges, OnDestroy {
9696
this.instance = new View(this);
9797
this.host.instance.setView(this.instance);
9898
break;
99+
case 'center':
100+
/** Work-around: setting the center via setProperties does not work. */
101+
this.instance.setCenter(changes[key].currentValue);
102+
break;
99103
default:
100104
break;
101105
}

0 commit comments

Comments
 (0)