This function takes the resolution as the input and returns the zoom level according to the Zoom Level Resolution table. The resolution which increases exponentially in the Zoom Level Resolution table can use any values as input. And returns the nearest corresponding zoom level.
public TGetLevelByResolution(resolution):Number
<div id="mapContainer" style="width: 640px; height: 400px;"></div> <script type="text/javascript"> var resolution=150; var level=TGetLevelByResolution(resolution); </script>