Use validity extent to generate default resolutions

Previously, the TiledWMS source generated a resolutions array
derived from the world extent in meters, to match the default
Web Mercator resolutions of the map. This wouldn't work for
projections with distance units different than meters. It is
better to commit to a default resolutions array where zoom level
0 is the validity extent of the projection (not the Web Mercator
world extent!) at a 256 pixel tile size.
This commit is contained in:
ahocevar
2013-01-14 16:10:55 +01:00
parent 57b25693af
commit 87ce763ccb
4 changed files with 37 additions and 19 deletions

View File

@@ -51,14 +51,14 @@ var layers = new ol.Collection([
]);
var map = new ol.Map({
projection: epsg21781,
// By setting userProjection to the same as projection, we do not need
// proj4js because we do not need any transforms.
userProjection: epsg21781,
layers: layers,
target: 'map',
view: new ol.View2D({
projection: epsg21781,
center: new ol.Coordinate(660000, 190000),
zoom: 9
zoom: 2
})
});