| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ca27681 commit 6d09580
35 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | require('../../../src/openlayers/control/ChangeTileVersion'); | |
| 2 | 2 | ||
| 3 | - describe('openlayers_testChangeTileVersion', function () { | ||
| 3 | + describe('openlayers_ChangeTileVersion', function () { | ||
| 4 | 4 | var map, baseLayer; | |
| 5 | 5 | var tileVersions = [ | |
| 6 | 6 | { | |
@@ -18,7 +18,7 @@ describe('openlayers_testChangeTileVersion', function () { | |||
| 18 | 18 | top: 66.826881183998 | |
| 19 | 19 | }, | |
| 20 | 20 | resolutions: [0.15211472144423888, 0.07605736072211941, 0.03802868036105977], | |
| 21 | - scaleDenominators: [64000000, 32000000, 16000000], | ||
| 21 | + scaleDenominators: [64000000, 32000000, 16000000] | ||
| 22 | 22 | } | |
| 23 | 23 | }, { | |
| 24 | 24 | desc: "V2", | |
@@ -32,7 +32,7 @@ describe('openlayers_testChangeTileVersion', function () { | |||
| 32 | 32 | leftBottom: {x: 73.45169014635671, y: 3.853726078199864}, | |
| 33 | 33 | right: 134.9754744676044, | |
| 34 | 34 | rightTop: {x: 134.9754744676044, y: 66.826881183998}, | |
| 35 | - top: 66.826881183998, | ||
| 35 | + top: 66.826881183998 | ||
| 36 | 36 | }, | |
| 37 | 37 | resolutions: [0.15211472144423888, 0.07605736072211941, 0.03802868036105977], | |
| 38 | 38 | scaleDenominators: [64000000, 32000000, 16000000] | |
@@ -48,7 +48,6 @@ describe('openlayers_testChangeTileVersion', function () { | |||
| 48 | 48 | testDiv.style.width = "500px"; | |
| 49 | 49 | testDiv.style.height = "500px"; | |
| 50 | 50 | window.document.body.appendChild(testDiv); | |
| 51 | - | ||
| 52 | 51 | var url = GlobeParameter.China4326URL; | |
| 53 | 52 | map = new ol.Map({ | |
| 54 | 53 | target: 'map', | |
@@ -60,20 +59,18 @@ describe('openlayers_testChangeTileVersion', function () { | |||
| 60 | 59 | projection: 'EPSG:4326' | |
| 61 | 60 | }) | |
| 62 | 61 | }); | |
| 63 | - | ||
| 64 | 62 | baseLayer = new ol.source.TileSuperMapRest({ | |
| 65 | 63 | origin: [-180, 90], | |
| 66 | 64 | url: url, | |
| 67 | 65 | wrapX: true | |
| 68 | 66 | }); | |
| 69 | - | ||
| 70 | 67 | map.addLayer(new ol.layer.Tile({ | |
| 71 | 68 | source: baseLayer, | |
| 72 | 69 | projection: 'EPSG:4326' | |
| 73 | 70 | })); | |
| 74 | 71 | }); | |
| 75 | 72 | ||
| 76 | - it("constructor", function () { | ||
| 73 | + it("initialize", function () { | ||
| 77 | 74 | var options = { | |
| 78 | 75 | layer: baseLayer, | |
| 79 | 76 | orientation: "horizontal" | |
@@ -183,7 +180,6 @@ describe('openlayers_testChangeTileVersion', function () { | |||
| 183 | 180 | changetileversion.update(tileVersions); | |
| 184 | 181 | var result = changetileversion.getVersion(); | |
| 185 | 182 | expect(result).toBe('63477488-e91e-41a1-b029-c1c7b476a64d'); | |
| 186 | - | ||
| 187 | 183 | }); | |
| 188 | 184 | }); | |
| 189 | 185 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,12 +2,12 @@ require('../../../src/openlayers/core/StyleUtils.js'); | |||
| 2 | 2 | require('../../resources/china_cartoCSS.js'); | |
| 3 | 3 | require('../../resources/china_layers.js'); | |
| 4 | 4 | require('../../resources/iPortal_maps.js'); | |
| 5 | - var fetch=require('whatwg-fetch-importable'); | ||
| 5 | + var fetch = require('whatwg-fetch-importable'); | ||
| 6 | 6 | ||
| 7 | 7 | var StyleUtils = ol.supermap.StyleUtils; | |
| 8 | 8 | var layersInfo, cartoCSSShaders, iPortalLayersInfo; | |
| 9 | 9 | var mapUrl = GlobeParameter.ChinaURL; | |
| 10 | - describe('openlayers_testStyleUtils', function () { | ||
| 10 | + describe('openlayers_StyleUtils', function () { | ||
| 11 | 11 | var originalTimeout; | |
| 12 | 12 | beforeEach(function () { | |
| 13 | 13 | originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL; | |
@@ -36,14 +36,11 @@ describe('openlayers_testStyleUtils', function () { | |||
| 36 | 36 | expect(style.getStroke()).toBeNull(); | |
| 37 | 37 | expect(style.getText()).toBeNull(); | |
| 38 | 38 | expect(style.getFill()).toBeNull(); | |
| 39 | - | ||
| 40 | 39 | var imageStyle = style.getImage(); | |
| 41 | 40 | expect(imageStyle).not.toBeNull(); | |
| 42 | 41 | expect(imageStyle.getOpacity()).toBe(1); | |
| 43 | - | ||
| 44 | 42 | expect(imageStyle.getSrc()).not.toBeNull(); | |
| 45 | 43 | expect(imageStyle.getImage(imageStyle.getSrc())).not.toBeNull(); | |
| 46 | - | ||
| 47 | 44 | done(); | |
| 48 | 45 | } catch (exception) { | |
| 49 | 46 | console.error("openlayers_StyleUtils': getValidStyleFromLayerInfo_point'案例失败:" + exception.name + ":" + exception.message); | |
@@ -65,7 +62,6 @@ describe('openlayers_testStyleUtils', function () { | |||
| 65 | 62 | var style = StyleUtils.getValidStyleFromLayerInfo(layerInfo, feature, mapUrl); | |
| 66 | 63 | expect(style).not.toBeNull(); | |
| 67 | 64 | expect(style.getFill()).toBeNull(); | |
| 68 | - | ||
| 69 | 65 | var strokeStyle = style.getStroke(); | |
| 70 | 66 | expect(strokeStyle).not.toBeNull(); | |
| 71 | 67 | expect(strokeStyle.getColor()).toBe('rgba(0,128,0,1)'); | |
@@ -99,7 +95,6 @@ describe('openlayers_testStyleUtils', function () { | |||
| 99 | 95 | expect(style.getFill()).not.toBeNull(); | |
| 100 | 96 | //此处由于StyleUtils内部处理fillSymbolID有一个缺陷,故不判断具体值 | |
| 101 | 97 | expect(style.getFill().getColor()).not.toBeNull(); | |
| 102 | - | ||
| 103 | 98 | var strokeStyle = style.getStroke(); | |
| 104 | 99 | expect(strokeStyle).not.toBeNull(); | |
| 105 | 100 | expect(strokeStyle.getColor()).toBe('rgba(110,84,90,1)'); | |
@@ -157,7 +152,6 @@ describe('openlayers_testStyleUtils', function () { | |||
| 157 | 152 | var feature = getFeature(layerName, features); | |
| 158 | 153 | var style = StyleUtils.getValidStyleFromLayerInfo(layerInfo, feature, mapUrl); | |
| 159 | 154 | expect(style).not.toBeNull(); | |
| 160 | - | ||
| 161 | 155 | var textStyle = style.getText(); | |
| 162 | 156 | expect(textStyle).not.toBeNull(); | |
| 163 | 157 | expect(textStyle.getText()).toBe("太平洋"); | |
@@ -187,15 +181,12 @@ describe('openlayers_testStyleUtils', function () { | |||
| 187 | 181 | var shader = getShader(layerName); | |
| 188 | 182 | var style = StyleUtils.getStyleFromCarto(10, 8.653637486605572e-7, shader, feature, true, mapUrl); | |
| 189 | 183 | expect(style).not.toBeNull(); | |
| 190 | - | ||
| 191 | 184 | expect(style.getStroke()).toBeNull(); | |
| 192 | 185 | expect(style.getText()).toBeNull(); | |
| 193 | 186 | expect(style.getFill()).toBeNull(); | |
| 194 | - | ||
| 195 | 187 | var imageStyle = style.getImage(); | |
| 196 | 188 | expect(imageStyle).not.toBeNull(); | |
| 197 | 189 | expect(imageStyle.getOpacity()).toBe(1); | |
| 198 | - | ||
| 199 | 190 | expect(imageStyle.getSrc()).not.toBeNull(); | |
| 200 | 191 | expect(imageStyle.getImage(imageStyle.getSrc())).not.toBeNull(); | |
| 201 | 192 | done(); | |
@@ -221,11 +212,9 @@ describe('openlayers_testStyleUtils', function () { | |||
| 221 | 212 | expect(style.getStroke()).toBeNull(); | |
| 222 | 213 | expect(style.getText()).toBeNull(); | |
| 223 | 214 | expect(style.getFill()).toBeNull(); | |
| 224 | - | ||
| 225 | 215 | var imageStyle = style.getImage(); | |
| 226 | 216 | expect(imageStyle).not.toBeNull(); | |
| 227 | 217 | expect(imageStyle.getOpacity()).toBe(1); | |
| 228 | - | ||
| 229 | 218 | expect(imageStyle.getSrc()).not.toBeNull(); | |
| 230 | 219 | expect(imageStyle.getImage(imageStyle.getSrc())).not.toBeNull(); | |
| 231 | 220 | done(); | |
@@ -249,7 +238,6 @@ describe('openlayers_testStyleUtils', function () { | |||
| 249 | 238 | var style = StyleUtils.getStyleFromCarto(10, 8.653637486605572e-7, shader, feature, true, mapUrl); | |
| 250 | 239 | expect(style).not.toBeNull(); | |
| 251 | 240 | expect(style.getFill()).toBeNull(); | |
| 252 | - | ||
| 253 | 241 | var strokeStyle = style.getStroke(); | |
| 254 | 242 | expect(strokeStyle).not.toBeNull(); | |
| 255 | 243 | expect(strokeStyle.getColor()).toBe('rgba(0,0,0,0)'); | |
@@ -280,7 +268,6 @@ describe('openlayers_testStyleUtils', function () { | |||
| 280 | 268 | expect(style).not.toBeNull(); | |
| 281 | 269 | expect(style.getFill()).not.toBeNull(); | |
| 282 | 270 | expect(style.getFill().getColor()).toBe('rgba(145, 185, 234, 1)'); | |
| 283 | - | ||
| 284 | 271 | var strokeStyle = style.getStroke(); | |
| 285 | 272 | expect(strokeStyle).not.toBeNull(); | |
| 286 | 273 | expect(strokeStyle.getColor()).toBe('rgba(0, 0, 0, 0)'); | |
@@ -312,29 +299,24 @@ describe('openlayers_testStyleUtils', function () { | |||
| 312 | 299 | expect(style.getStroke()).toBeNull(); | |
| 313 | 300 | expect(style.getText()).toBeNull(); | |
| 314 | 301 | expect(style.getFill()).toBeNull(); | |
| 315 | - | ||
| 316 | 302 | var imageStyle = style.getImage(); | |
| 317 | 303 | expect(imageStyle).not.toBeNull(); | |
| 318 | 304 | expect(imageStyle.getOpacity()).toBe(1); | |
| 319 | 305 | expect(imageStyle.getRadius()).toBe(3); | |
| 320 | 306 | expect(imageStyle.getPoints()).toBePositiveInfinity(); | |
| 321 | 307 | expect(imageStyle.getImage()).not.toBeNull(); | |
| 322 | - | ||
| 323 | 308 | var size = imageStyle.getSize(); | |
| 324 | 309 | expect(size).not.toBeNull(); | |
| 325 | 310 | expect(size[0]).toBe(9); | |
| 326 | 311 | expect(size[1]).toBe(9); | |
| 327 | - | ||
| 328 | 312 | var anchor = imageStyle.getAnchor(); | |
| 329 | 313 | expect(anchor).not.toBeNull(); | |
| 330 | 314 | expect(anchor[0]).toBe(4.5); | |
| 331 | 315 | expect(anchor[1]).toBe(4.5); | |
| 332 | - | ||
| 333 | 316 | var stroke = imageStyle.getStroke(); | |
| 334 | 317 | expect(stroke).not.toBeNull(); | |
| 335 | 318 | expect(stroke.getColor()).toBe("#c33"); | |
| 336 | 319 | expect(stroke.getWidth()).toBe(1); | |
| 337 | - | ||
| 338 | 320 | var fill = imageStyle.getFill(); | |
| 339 | 321 | expect(fill.getColor()).toBe("#fc0"); | |
| 340 | 322 | done(); | |
@@ -357,25 +339,22 @@ describe('openlayers_testStyleUtils', function () { | |||
| 357 | 339 | var iPortalStyle = iPortalLayersInfo[key][2].style; | |
| 358 | 340 | var style = StyleUtils.getStyleFromiPortalStyle(iPortalStyle, feature.getGeometry().getType(), feature.getProperties().style); | |
| 359 | 341 | expect(style).not.toBeNull(); | |
| 360 | - | ||
| 361 | 342 | expect(style.getStroke()).toBeNull(); | |
| 362 | 343 | expect(style.getText()).toBeNull(); | |
| 363 | 344 | expect(style.getFill()).toBeNull(); | |
| 364 | - | ||
| 365 | 345 | var imageStyle = style.getImage(); | |
| 366 | 346 | expect(imageStyle).not.toBeNull(); | |
| 367 | 347 | expect(imageStyle.getOpacity()).toBe(1); | |
| 368 | - | ||
| 369 | 348 | expect(imageStyle.getSrc()).not.toBeNull(); | |
| 370 | 349 | expect(imageStyle.getImage(imageStyle.getSrc())).not.toBeNull(); | |
| 371 | - | ||
| 372 | 350 | done(); | |
| 373 | 351 | } catch (exception) { | |
| 374 | 352 | console.error("openlayers_StyleUtils': getStyleFromiPortalStyle_point'案例失败:" + exception.name + ":" + exception.message); | |
| 375 | 353 | expect(false).toBeTruthy(); | |
| 376 | 354 | done(); | |
| 377 | 355 | } | |
| 378 | 356 | }); | |
| 357 | + | ||
| 379 | 358 | //测试从iPortalLayers中获取style | |
| 380 | 359 | it('getStyleFromiPortalStyle_polyLine', function (done) { | |
| 381 | 360 | var key = 'iPortalMaps47'; | |
@@ -387,15 +366,12 @@ describe('openlayers_testStyleUtils', function () { | |||
| 387 | 366 | var iPortalStyle = iPortalLayersInfo[key][3].style; | |
| 388 | 367 | var style = StyleUtils.getStyleFromiPortalStyle(iPortalStyle, feature.getGeometry().getType(), feature.getProperties().style); | |
| 389 | 368 | expect(style).not.toBeNull(); | |
| 390 | - | ||
| 391 | 369 | expect(style.getText()).toBeNull(); | |
| 392 | 370 | expect(style.getFill()).toBeNull(); | |
| 393 | - | ||
| 394 | 371 | var strokeStyle = style.getStroke(); | |
| 395 | 372 | expect(strokeStyle).not.toBeNull(); | |
| 396 | 373 | expect(strokeStyle.getColor()).toBe('rgba(52,219,103,1)'); | |
| 397 | 374 | expect(strokeStyle.getWidth()).toBe(4); | |
| 398 | - | ||
| 399 | 375 | var lineDash = strokeStyle.getLineDash(); | |
| 400 | 376 | expect(lineDash).not.toBeNull(); | |
| 401 | 377 | expect(lineDash[0]).toBe(16); | |
@@ -407,8 +383,8 @@ describe('openlayers_testStyleUtils', function () { | |||
| 407 | 383 | done(); | |
| 408 | 384 | } | |
| 409 | 385 | }); | |
| 410 | - | ||
| 411 | 386 | }); | |
| 387 | + | ||
| 412 | 388 | function initLayersInfo() { | |
| 413 | 389 | var layersInfo = {}; | |
| 414 | 390 | var layers = ChinaLayersInfo.subLayers.layers; | |
@@ -458,7 +434,6 @@ function getLayerInfo(layerName) { | |||
| 458 | 434 | if (layersInfo === undefined) { | |
| 459 | 435 | return null; | |
| 460 | 436 | } | |
| 461 | - | ||
| 462 | 437 | var layerInfo = layersInfo[layerName]; | |
| 463 | 438 | if (!layerInfo)return null; | |
| 464 | 439 | var layerInfo_simple = {layerIndex: layerInfo.layerIndex, ugcLayerType: layerInfo.ugcLayerType}; | |
@@ -504,7 +479,6 @@ function getShader(layerName) { | |||
| 504 | 479 | //请求tileFeature获取测试用ol feature对象 | |
| 505 | 480 | function requestFeature(url) { | |
| 506 | 481 | var tileFormat = new ol.format.GeoJSON(); | |
| 507 | - | ||
| 508 | 482 | return fetch(url, {method: 'GET', timeout: 10000}) | |
| 509 | 483 | .then(function (response) { | |
| 510 | 484 | return response.json(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | require('../../../src/openlayers/core/Util.js'); | |
| 2 | 2 | ||
| 3 | - describe('openlayers_testUtil', function () { | ||
| 3 | + describe('openlayers_Util', function () { | ||
| 4 | 4 | var originalTimeout; | |
| 5 | 5 | beforeEach(function () { | |
| 6 | 6 | originalTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL; | |
@@ -10,10 +10,6 @@ describe('openlayers_testUtil', function () { | |||
| 10 | 10 | jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout; | |
| 11 | 11 | }); | |
| 12 | 12 | ||
| 13 | - it('init', function () { | ||
| 14 | - new ol.supermap.Util(); | ||
| 15 | - }); | ||
| 16 | - | ||
| 17 | 13 | it('toGeoJSON', function () { | |
| 18 | 14 | var smObj = [{ | |
| 19 | 15 | attributes: { | |
@@ -35,7 +31,7 @@ describe('openlayers_testUtil', function () { | |||
| 35 | 31 | id: "SuperMap.Geometry.Point_6", | |
| 36 | 32 | type: "NONE", | |
| 37 | 33 | x: 258, | |
| 38 | - y: 258, | ||
| 34 | + y: 258 | ||
| 39 | 35 | }, { | |
| 40 | 36 | id: "SuperMap.Geometry.Point_7", | |
| 41 | 37 | type: "NONE", | |
@@ -88,17 +84,14 @@ describe('openlayers_testUtil', function () { | |||
| 88 | 84 | expect(result.id).not.toBeNull(); | |
| 89 | 85 | expect(result.components).not.toBeNull(); | |
| 90 | 86 | expect(result.components.length).toBe(1); | |
| 91 | - | ||
| 92 | 87 | var polygon = result.components[0]; | |
| 93 | 88 | expect(polygon instanceof SuperMap.Geometry.Polygon).toBeTruthy(); | |
| 94 | 89 | expect(polygon.components).not.toBeNull(); | |
| 95 | 90 | expect(polygon.components.length).toBe(1); | |
| 96 | - | ||
| 97 | 91 | var lineString = polygon.components[0]; | |
| 98 | 92 | expect(lineString instanceof SuperMap.Geometry.LinearRing).toBeTruthy(); | |
| 99 | 93 | expect(lineString.components).not.toBeNull(); | |
| 100 | 94 | expect(lineString.components.length).toBe(3); | |
| 101 | - | ||
| 102 | 95 | var point = lineString.components[0]; | |
| 103 | 96 | expect(point instanceof SuperMap.Geometry.Point).toBeTruthy(); | |
| 104 | 97 | expect(point.x).toBe(-2); | |
@@ -180,7 +173,6 @@ describe('openlayers_testUtil', function () { | |||
| 180 | 173 | expect(result.type).toBe("FeatureCollection"); | |
| 181 | 174 | expect(result.features).not.toBeNull(); | |
| 182 | 175 | expect(result.features.length).toBe(5); | |
| 183 | - | ||
| 184 | 176 | var feature = result.features[0]; | |
| 185 | 177 | expect(feature).not.toBeNull(); | |
| 186 | 178 | expect(feature.type).toBe('Feature'); | |
@@ -203,5 +195,4 @@ describe('openlayers_testUtil', function () { | |||
| 203 | 195 | expect(result.canvas.width).toBe(360); | |
| 204 | 196 | expect(result.canvas.height).toBe(580); | |
| 205 | 197 | }); | |
| 206 | - | ||
| 207 | 198 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | require('../../../src/openlayers/mapping/ImageSuperMapRest'); | |
| 2 | 2 | ||
| 3 | 3 | var url = GlobeParameter.imageURL; | |
| 4 | - describe('openlayers_ImageSuperMapRestTest', function() { | ||
| 4 | + describe('openlayers_ImageSuperMapRest', function () { | ||
| 5 | 5 | var originalTimeout; | |
| 6 | 6 | var testDiv, map, imageTileOptions, imageTileSource; | |
| 7 | 7 | beforeAll(function () { | |
@@ -13,7 +13,6 @@ describe('openlayers_ImageSuperMapRestTest', function() { | |||
| 13 | 13 | testDiv.style.width = "500px"; | |
| 14 | 14 | testDiv.style.height = "500px"; | |
| 15 | 15 | document.body.appendChild(testDiv); | |
| 16 | - | ||
| 17 | 16 | //只测了serverType为iserver得情况 | |
| 18 | 17 | new ol.supermap.MapService(url).getMapInfo(function (serviceResult) { | |
| 19 | 18 | map = new ol.Map({ | |
@@ -26,7 +25,7 @@ describe('openlayers_ImageSuperMapRestTest', function() { | |||
| 26 | 25 | }) | |
| 27 | 26 | }); | |
| 28 | 27 | imageTileOptions = ol.source.ImageSuperMapRest.optionsFromMapJSON(url, serviceResult.result); | |
| 29 | - imageTileSource = new ol.source.ImageSuperMapRest(imageTileOptions); | ||
| 28 | + imageTileSource = new ol.source.ImageSuperMapRest(imageTileOptions); | ||
| 30 | 29 | var imageLayer = new ol.layer.Tile({ | |
| 31 | 30 | source: imageTileSource | |
| 32 | 31 | }); | |
@@ -44,39 +43,36 @@ describe('openlayers_ImageSuperMapRestTest', function() { | |||
| 44 | 43 | document.body.removeChild(testDiv); | |
| 45 | 44 | }); | |
| 46 | 45 | ||
| 47 | - it('constructor and static test', function (done) { | ||
| 46 | + it('initialize', function (done) { | ||
| 48 | 47 | setTimeout(function () { | |
| 49 | 48 | try { | |
| 50 | 49 | expect(imageTileOptions).not.toBeNull(); | |
| 51 | 50 | expect(imageTileOptions.serverType).toBe("ISERVER"); | |
| 52 | 51 | expect(imageTileOptions.crossOrigin).toBe("anonymous"); | |
| 53 | - | ||
| 54 | 52 | expect(imageTileSource).not.toBeNull(); | |
| 55 | 53 | expect(imageTileSource.urls.length).toBe(1); | |
| 56 | 54 | done(); | |
| 57 | - }catch(exception) { | ||
| 58 | - console.log("'constructor and static test'案例失败:" + exception.name + ":" + exception.message); | ||
| 55 | + } catch (exception) { | ||
| 56 | + console.log("'initialize'案例失败:" + exception.name + ":" + exception.message); | ||
| 59 | 57 | expect(false).toBeTruthy(); | |
| 60 | 58 | done(); | |
| 61 | 59 | } | |
| 62 | - },6000); | ||
| 60 | + }, 6000); | ||
| 63 | 61 | ||
| 64 | 62 | }); | |
| 65 | 63 | ||
| 66 | - it('tileUrlFunction test', function () { | ||
| 64 | + it('tileUrlFunction', function () { | ||
| 67 | 65 | var tempOptions = { | |
| 68 | - redirect:true, | ||
| 66 | + redirect: true, | ||
| 69 | 67 | prjCoordSys: {"epsgCode": 4326} | |
| 70 | 68 | }; | |
| 71 | 69 | /*expect(imageLayerObject).not.toBeNull(); | |
| 72 | - expect(imageLayerObject.options.redirect).toBe(true); | ||
| 73 | - expect(imageLayerObject.options.prjCoordSys.epsgCode).toBe(4326);*/ | ||
| 74 | - | ||
| 70 | + expect(imageLayerObject.options.redirect).toBe(true); | ||
| 71 | + expect(imageLayerObject.options.prjCoordSys.epsgCode).toBe(4326);*/ | ||
| 75 | 72 | var pixelRatio = "245"; | |
| 76 | 73 | var coords = new ol.geom.Point(120.14, 30.24); | |
| 77 | 74 | var tileUrl = imageTileSource.tileUrlFunction(coords, pixelRatio, tempOptions); | |
| 78 | - | ||
| 79 | - expect(tileUrl).toBe("http://localhost:8090/iserver/services/map-world/rest/maps/%E4%B8%96%E7%95%8C%E5%9C%B0%E5%9B%BE_Day/image.png?&transparent=true&cacheEnabled=false&width=256&height=256&viewBounds=%7B%22leftBottom%22%20:%20%7B%22x%22:NaN,%22y%22:NaN%7D,%22rightTop%22%20:%20%7B%22x%22:NaN,%22y%22:NaN%7D%7D"); | ||
| 75 | + expect(tileUrl).toBe(GlobeParameter.mapServiceURL + "%E4%B8%96%E7%95%8C%E5%9C%B0%E5%9B%BE_Day/image.png?&transparent=true&cacheEnabled=false&width=256&height=256&viewBounds=%7B%22leftBottom%22%20:%20%7B%22x%22:NaN,%22y%22:NaN%7D,%22rightTop%22%20:%20%7B%22x%22:NaN,%22y%22:NaN%7D%7D"); | ||
| 80 | 76 | expect(imageTileSource.tileGrid.tileSize_).toEqual(256); | |
| 81 | 77 | }); | |
| 82 | 78 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments