I'm developing a web map for my town. I made my own vector layers and, to avoid the too much "white", I decided to use as base layer OSM. The problem is that when I use the array of resolutions to set the zoom (in the other ways I'm not able to set the zoom) I get the cross-origin error. Here is the code of the osm layer I made:
var osm = new OpenLayers.Layer.OSM(
'OSM',
null,
{ zoomOffset: 4, resolutions: [4.777314267158508, 2.388657133579254, 1.194328566789627, 0.5971642833948135], tileOptions: { crossOriginKeyword: null }}
);
map.addLayer(osm);
With this, by setting the origin keyword on "null", I don't get the cross-origin problem, but it doesn't load the tiles (error 404). If I remove the resolutions array, the tiles are loaded correctly, but then the zoom is not controlled and user is free to zoom to the whole planet. I'm using Openlayers 2.13.1 with IIS Express and Geoserver 2.5.2. Of course, I'm already using a proxy. Any suggestions on where this problem comes from and how to fix it?