Been researching this for a while and nothing has come to fruition. Best I could find was:

OpenLayers.Control.ZoomStatus = OpenLayers.Class(OpenLayers.Control, {
  autoActivate: true,
  element: null

But 'ZoomStatus' isn't even mentioned in the documentation (maybe it is but can't seem to find it). Found it at this link: http://trac.osgeo.org/openlayers/attachment/ticket/3629/OpenLayers.Control.ZoomStatus.js

Can anyone offer some insight as to how to display the zoom level/status in the browser?

3 Answers 3


For OpenLayers3 (v.3.4.0) I will modify @kryger answer:

    <div id="zoomlevel"></div>
        map.on("moveend", function() {
            var zoom = map.getView().getZoom(); 
            var zoomInfo = 'Zoom level = ' + zoom;
            document.getElementById('zoomlevel').innerHTML = zoomInfo;

But 'ZoomStatus' isn't even mentioned in the documentation

According to http://trac.osgeo.org/openlayers/ticket/3629 it's scheduled for 2.13 (but the current dev version still doesn't feature it).

The fact is that it does little more than call map.getZoom() anyway, so you're probably better off implementing a custom handler. Example:

Go to http://dev.openlayers.org/releases/OpenLayers-2.12/examples/osm.html and execute the following script in Firebug/Chrome dev tools JS console:

map.events.register('zoomend', map, function() {
  var zoomInfo = 'Zoom level=' + map.getZoom() + '/' + (map.numZoomLevels + 1);
  document.getElementById('shortdesc').innerHTML = 'Show a Simple OSM Map --- ' + zoomInfo;

And zoom in/out.

  • 1
    Yep you're 100% right. Finally found the getZoom method, worked fine. Thanks for your answer, I would upvote you if I had 15 rep!
    – Nubtacular
    Jun 6, 2013 at 22:30

how about using GeoExt for this:

  • Ah, I guess you can use getZoom. Didn't know that.
    – Nubtacular
    Jun 6, 2013 at 21:16
  • it's quite simple, you just need to copy the HTML content of that example in your PC and that's all. Now, if you want to add that code in your application, you need to arrange things, probably copy/paste at the beginning and then post here if you have problems.
    – Gery
    Jun 6, 2013 at 21:17

Your Answer

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

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