Fix setting center to undefined

It only worked when the coordinate warning was shown, but
fromUserCoordinate shouldn't have been called with undefined in
the first place.
This commit is contained in:
Maximilian Krög
2022-02-17 23:05:47 +01:00
parent 57e9a4d1a8
commit 19c034fd12

View File

@@ -1636,7 +1636,9 @@ class View extends BaseObject {
* @api
*/
setCenter(center) {
this.setCenterInternal(fromUserCoordinate(center, this.getProjection()));
this.setCenterInternal(
center ? fromUserCoordinate(center, this.getProjection()) : center
);
}
/**