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 committed 2022-02-18 00:06:56 +01:00
1 parent 57e9a4d1a8
commit 19c034fd12
1 file changed
+3 -1
+3 -1
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
);
}
/**