9

Is it possible to get the current position (lat/lng/zoom) in OpenLayers 3 (Like map.getCenter() in Leaflet)? I couldn't find anything in the docs.

1 Answer 1

14

Just type:

map.getView().getCenter()

You should look at official examples source code: they will really help you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.