[GIS] OpenLayers: Possible to show zoom level

javascriptopenlayers-2

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?

Best Answer

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

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