Example uses exported properties

This commit is contained in:
Éric Lemoine
2013-02-20 11:55:28 +01:00
parent cf6a27fca3
commit 2bc8e1a570

View File

@@ -29,9 +29,8 @@ ol.Projection.addProjection(epsg21781);
// We give the single image source a set of resolutions. This prevents the // We give the single image source a set of resolutions. This prevents the
// source from requesting images of arbitrary resolutions. // source from requesting images of arbitrary resolutions.
var projectionExtent = epsg21781.getExtent(); var projectionExtent = epsg21781.getExtent();
var maxResolution = Math.max( var maxResolution = Math.max(projectionExtent.getWidth(),
projectionExtent.maxX - projectionExtent.minX, projectionExtent.getHeight()) / 256;
projectionExtent.maxY - projectionExtent.minY) / 256;
var resolutions = new Array(10); var resolutions = new Array(10);
for (var i = 0; i < 10; ++i) { for (var i = 0; i < 10; ++i) {
resolutions[i] = maxResolution / Math.pow(2.0, i); resolutions[i] = maxResolution / Math.pow(2.0, i);