| 133 | | t.eq(layer.minResolution.toPrecision(9), (1).toPrecision(9), |
|---|
| 134 | | "layer minResolution preserved"); |
|---|
| 135 | | t.eq(layer.maxResolution.toPrecision(9), (10).toPrecision(9), |
|---|
| 136 | | "layer maxResolution preserved"); |
|---|
| 137 | | t.eq(layer.numZoomLevels, 5, "layer numZoomLevels preserved"); |
|---|
| | 136 | t.eq(layer.minResolution.toPrecision(6), (1.5).toPrecision(6), |
|---|
| | 137 | "(with numZoomLevels) layer minResolution preserved"); |
|---|
| | 138 | t.eq(layer.maxResolution.toPrecision(6), (10.5).toPrecision(6), |
|---|
| | 139 | "(with numZoomLevels) layer maxResolution preserved"); |
|---|
| | 140 | t.eq(layer.numZoomLevels, 5, "(with numZoomLevels) layer numZoomLevels preserved"); |
|---|
| | 141 | |
|---|
| | 142 | // three tests for minResolution, and maxResolution |
|---|
| | 143 | options = { |
|---|
| | 144 | minResolution: 1.5, |
|---|
| | 145 | maxResolution: 10.5, |
|---|
| | 146 | map: map |
|---|
| | 147 | }; |
|---|
| | 148 | layer = new OpenLayers.Layer("test", options); |
|---|
| | 149 | layer.initResolutions(); |
|---|
| | 150 | t.eq(layer.minResolution.toPrecision(6), (1.5).toPrecision(6), |
|---|
| | 151 | "(without numZoomLevels) layer minResolution preserved"); |
|---|
| | 152 | t.eq(layer.maxResolution.toPrecision(6), (10.5).toPrecision(6), |
|---|
| | 153 | "(without numZoomLevels) layer maxResolution preserved"); |
|---|
| | 154 | t.eq(layer.numZoomLevels, 3, "(without numZoomLevels) layer numZoomLevels calculated"); |
|---|
| | 155 | |
|---|
| | 156 | // three tests for minScale, maxScale, and numZoomLevels |
|---|
| | 157 | options = { |
|---|
| | 158 | minScale: 105, |
|---|
| | 159 | maxScale: 15, |
|---|
| | 160 | numZoomLevels: 10, |
|---|
| | 161 | map: map |
|---|
| | 162 | }; |
|---|
| | 163 | layer = new OpenLayers.Layer("test", options); |
|---|
| | 164 | layer.initResolutions(); |
|---|
| | 165 | t.eq(layer.minScale.toPrecision(6), (105).toPrecision(6), |
|---|
| | 166 | "(with numZoomLevels) layer minScale preserved"); |
|---|
| | 167 | t.eq(layer.maxScale.toPrecision(6), (15).toPrecision(6), |
|---|
| | 168 | "(with numZoomLevels) layer maxScale preserved"); |
|---|
| | 169 | t.eq(layer.numZoomLevels, 10, "(with numZoomLevels) layer numZoomLevels preserved"); |
|---|
| | 170 | |
|---|
| | 171 | // three tests for minScale, and maxScale |
|---|
| | 172 | options = { |
|---|
| | 173 | minScale: 1555, |
|---|
| | 174 | maxScale: 155, |
|---|
| | 175 | map: map |
|---|
| | 176 | }; |
|---|
| | 177 | layer = new OpenLayers.Layer("test", options); |
|---|
| | 178 | layer.initResolutions(); |
|---|
| | 179 | t.eq(layer.minScale.toPrecision(6), (1555).toPrecision(6), |
|---|
| | 180 | "(without numZoomLevels) layer minScale preserved"); |
|---|
| | 181 | t.eq(layer.maxScale.toPrecision(6), (155).toPrecision(6), |
|---|
| | 182 | "(without numZoomLevels) layer maxScale preserved"); |
|---|
| | 183 | t.eq(layer.numZoomLevels, 4, "(without numZoomLevels) layer numZoomLevels calculated"); |
|---|
| | 184 | |
|---|
| | 185 | map.destroy(); |
|---|
| | 186 | |
|---|
| | 187 | |
|---|