OpenLayers 3 how can I get the current center of the view?

المشرف العام

Administrator
طاقم الإدارة
I would like the get the center (coordinates) of the current view. I need it for the geoserver print modul.I've found the following code:

var center= ol.extent.getCenter({});

But it unfortunately doesnt work. Furthermore I've found a code in the API (getview.getcenter()), but its only shows the initial center, and it is not changing when i explore on the map.

Thank you for the help!



أكثر...
 
أعلى