From 9ffac265bc76445b136d10de287bc95ecab9a3ac Mon Sep 17 00:00:00 2001 From: OSHistory Date: Wed, 14 Sep 2022 13:02:59 +0200 Subject: [PATCH] fix: use ol.proj.fromLonLat in the OL snippet The center is passed as geographical coordinates (WGS84) whereas the View is configured in Web-Mercator --- src/InfoWidget.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/InfoWidget.js b/src/InfoWidget.js index 4ece980..224c654 100644 --- a/src/InfoWidget.js +++ b/src/InfoWidget.js @@ -125,7 +125,7 @@ class InfoWidget extends Component { ], target: 'map', view: new ol.View({ - center: [${center[0]},${center[1]}], + center: ol.proj.fromLonLat([${center[0]},${center[1]}]), zoom: ${this.props.zoom} }) });