From 86e79b9b2c0819b60ad9201d16f758ff5d5afd79 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 19 Aug 2011 14:46:43 -0400 Subject: [PATCH] Fixing high zoom levels, adding test. Addresses #48, needs confirmation --- lib/carto/tree/zoom.js | 10 +++---- test/rendering/highzooms.mml | 14 +++++++++ test/rendering/highzooms.mss | 9 ++++++ test/rendering/highzooms.result | 51 +++++++++++++++++++++++++++++++++ 4 files changed, 79 insertions(+), 5 deletions(-) create mode 100644 test/rendering/highzooms.mml create mode 100644 test/rendering/highzooms.mss create mode 100644 test/rendering/highzooms.result diff --git a/lib/carto/tree/zoom.js b/lib/carto/tree/zoom.js index be2b62b..bb4cce1 100644 --- a/lib/carto/tree/zoom.js +++ b/lib/carto/tree/zoom.js @@ -54,11 +54,11 @@ tree.Zoom.ranges = { 16: 12500, 17: 5000, 18: 2500, - 19: 1000, - 20: 500, - 21: 250, - 22: 100, - 23: 50 + 19: 1500, + 20: 750, + 21: 500, + 22: 250, + 23: 100 }; // Only works for single range zooms. `[XXX....XXXXX.........]` is invalid. diff --git a/test/rendering/highzooms.mml b/test/rendering/highzooms.mml new file mode 100644 index 0000000..b90d7ce --- /dev/null +++ b/test/rendering/highzooms.mml @@ -0,0 +1,14 @@ +{ + "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", + "Stylesheet": [ + "highzooms.mss" + ], + "Layer": [{ + "name": "world", + "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/highzooms.mss b/test/rendering/highzooms.mss new file mode 100644 index 0000000..bfc40d5 --- /dev/null +++ b/test/rendering/highzooms.mss @@ -0,0 +1,9 @@ +#world { + polygon-fill: #000; + [zoom=22] { polygon-fill: #f00000; } + [zoom=21] { polygon-fill: #0f0000; } + [zoom=20] { polygon-fill: #00f000; } + [zoom=19] { polygon-fill: #000f00; } + [zoom=18] { polygon-fill: #0000f0; } + [zoom=17] { polygon-fill: #00000f; } +} diff --git a/test/rendering/highzooms.result b/test/rendering/highzooms.result new file mode 100644 index 0000000..39c12f7 --- /dev/null +++ b/test/rendering/highzooms.result @@ -0,0 +1,51 @@ + + + + + + + + world + + + + + + +