0

I try to receive the coordinates in lon/lat form an OpenLayer 5 map when i click on the map as an array or json with the values in order to set the map center to this clicked coordinates. I tried to get the coordinates by this

var mousePosition = new OlMousePosition({
  coordinateFormat: createStringXY(2),
  projection: 'EPSG:25832',
});

But where in mousePosition are the coordinates stored? All examples I have found send the values via target: into a HTML element.

1 Answers1

0

As i got the Pixel coordinates I used now getCoordinateFromPixel from ol/Map to get the specific values and map.getView().setCenter(coordinates) to set the center.