I have an OpenLayers based web app, map object is initialized like this:
p4326 = new OpenLayers.Projection('EPSG:4326');
p3857 = new OpenLayers.Projection('EPSG:3857');
//initialize map object, bind it to map_canvas div
map = new OpenLayers.Map('map_canvas',
{
//allOverlays: true,
projection: p3857,
displayProjection: p4326,
maxExtent: new OpenLayers.Bounds(-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892),
numZoomLevels:20,
maxResolution:156543.0339,
units:'m',
projection: p3857});
I have a pre-rendered map from levels 8-16, however, in order to view zoom level 16 of the map, I have to initialize its layer like this:
var osm = new OpenLayers.Layer.XYZ("OSM Mapnik", "http://localhost/osm_tiles/osm/${z}/${x}/${y}.png", { isBaseLayer: true, sphericalMercator: true, numZoomLevels: 17});
map.addLayer(osm);
Notice, that I set the zoom level 17 (or I can't zoom and view level 16 of the map). Can someone tell me why?