I have a flat game-world map that I've rastered with gdal2tiles.py (-p raster, obviously, as it has not geolocation info). Displaying it as a TMS layer works just fine.
I also have vector data I want to overlay. Through trial and error, I've found a configuration that almost works:
var scales = [0.692, 1.384, 2.768, 5.536, 11.072];
var options = {
controls: [],
maxExtent: mapBounds,
scales: scales,
units: 'm'
};
But I wonder why the values are so strange and if they are really correct. So basically the question is: What IS the actual scale of an OpenLayers map? How long is a linestring from 0,0 to 1,0 and how long to 0,1 ? What is the unit? Obviously it's not metres, and the documentation doesn't explain it anywhere, either.
In case it matters, my vector data is stored in a PostGIS database. It is generated, not from any real-world source.