I have the following code:
Proj4js.defs["EPSG:31258"] = "+proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1 +x_0=450000 +y_0=-5000000 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m +no_defs"; +lon_0=0.0 +x_0=0.0 +y_0=0 +units=m +k=1.0 +nadgrids=@null +no_defs"
var googleProj = new OpenLayers.Projection("EPSG:900913");
var salzburgProj = new OpenLayers.Projection("EPSG:31258");
var bounds = new OpenLayers.Bounds(426249,294999,426251,295001);
var maxZoom = 19;
var minZoom = 11;
var res = [76.4370282714844,38.2185141357422,19.1092570678711,9.55462853393555,4.77731426696777,2.38865713348389,1.194328566741945,0.5971642833709725];
mapCOD = new OpenLayers.Map({
div: "map1",
allOverlays: true,
maxExtent: bounds,
projection: salzburgProj,
displayProjection: salzburgProj,
allowSelection: true,
units: 'm',
controls: [new OpenLayers.Control.PanZoomBar(), new OpenLayers.Control.Navigation()]
});
var layer = new OpenLayers.Layer.XYZ(
layer_dir,
"tiles/${z}/${x}/${y}.png",
{
zoomLevels: maxZoom,
zoomOffset: minZoom,
resolutions: res,
sphericalMercator: true,
crossOriginKeyword: null,
buffer: 1
});
mapCOD.addLayer(layer);
The problem is that for example, when I load the map at zoom 11, I expect to get tiles
- 11/1097/713.png
- 11/1098/713.png
Instead I get:
- 11/1044/1008.png
- 11/1044/1010.png
- 11/1043/1008.png
- 11/1043/1009.png
- ...and so on
So the way OpenLayers calculates tiles URLs seems wrong or not properly configured.
I have produced tiles with mapnik using "EPSG:31258": so my tiles have the same directory/name structure of Open Street Map, but with a different projection than the default 900913.
Where is the problem and how can I solve this?
