From e1352525185aefbaf4554edc53dd547138494b7b Mon Sep 17 00:00:00 2001 From: songyumeng Date: Wed, 13 Sep 2017 20:29:40 +0800 Subject: [PATCH] fix ut --- test/leaflet/mapping/ImageMapLayerSpec.js | 4 ++-- test/leaflet/mapping/TiledMapLayerSpec.js | 2 +- test/openlayers/mapping/ImageSuperMapRestSpec.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/leaflet/mapping/ImageMapLayerSpec.js b/test/leaflet/mapping/ImageMapLayerSpec.js index 847e69f1a0..99c4483111 100644 --- a/test/leaflet/mapping/ImageMapLayerSpec.js +++ b/test/leaflet/mapping/ImageMapLayerSpec.js @@ -1,7 +1,7 @@ require('../../../src/leaflet/mapping/ImageMapLayer'); var url = GlobeParameter.imageURL; -describe('leaflet_TiledMapLayer', function () { +describe('leaflet_ImageLayer', function () { var originalTimeout; var testDiv, map , imageLayerObject; beforeAll(function () { @@ -57,6 +57,6 @@ describe('leaflet_TiledMapLayer', function () { var coords = L.point(120.14, 30.24); var tileUrl = imageLayerObject.getTileUrl(coords); - expect(tileUrl).toBe("http://localhost:8090/iserver/services/map-world/rest/maps/世界地图_Day/image.png?width=256&height=256&redirect=true&transparent=false&cacheEnabled=true&prjCoordSys={\"epsgCode\":4326}&overlapDisplayed=true&viewBounds={\"leftBottom\" : {\"x\":2387268743.959911,\"y\":-20037508.34278071},\"rightTop\" : {\"x\":2407306252.3027,\"y\":-20037508.34278071}}"); + 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?width=256&height=256&redirect=true&transparent=false&cacheEnabled=true&prjCoordSys=%7B%22epsgCode%22:4326%7D&overlapDisplayed=true&viewBounds=%7B%22leftBottom%22%20:%20%7B%22x%22:2387268743.959911,%22y%22:-20037508.34278071%7D,%22rightTop%22%20:%20%7B%22x%22:2407306252.3027,%22y%22:-20037508.34278071%7D%7D"); }); }); \ No newline at end of file diff --git a/test/leaflet/mapping/TiledMapLayerSpec.js b/test/leaflet/mapping/TiledMapLayerSpec.js index b02af4dea0..905f8b85be 100644 --- a/test/leaflet/mapping/TiledMapLayerSpec.js +++ b/test/leaflet/mapping/TiledMapLayerSpec.js @@ -52,7 +52,7 @@ describe('leaflet_TiledMapLayer', function () { var tileUrl = tiledMapLayerObject.getTileUrl(coords); var tileUrlArray = tileUrl.split('?'); expect(tileUrlArray[0]).toBe('http://localhost:8090/iserver/services/map-china400/rest/maps/China/tileImage.png'); - expect(tileUrlArray[1]).toBe('width=256&height=256&redirect=false&transparent=false&cacheEnabled=true&prjCoordSys={"epsgCode":3857}&origin={"x":-20037508.342789244,"y":20037508.342789244}&overlapDisplayed=false&scale=3.3803271432053105e-9&x=1&y=4'); + expect(tileUrlArray[1]).toBe('width=256&height=256&redirect=false&transparent=false&cacheEnabled=true&prjCoordSys=%7B%22epsgCode%22:3857%7D&origin=%7B%22x%22:-20037508.342789244,%22y%22:20037508.342789244%7D&overlapDisplayed=false&scale=3.3803271432053105e-9&x=1&y=4'); var scale = tiledMapLayerObject.getScale(1); expect(scale).toBe(3.3803271432053105e-9); }); diff --git a/test/openlayers/mapping/ImageSuperMapRestSpec.js b/test/openlayers/mapping/ImageSuperMapRestSpec.js index cbcc2bf631..19fa89ce8c 100644 --- a/test/openlayers/mapping/ImageSuperMapRestSpec.js +++ b/test/openlayers/mapping/ImageSuperMapRestSpec.js @@ -76,7 +76,7 @@ describe('openlayers_ImageSuperMapRestTest', function() { var coords = new ol.geom.Point(120.14, 30.24); var tileUrl = imageTileSource.tileUrlFunction(coords, pixelRatio, tempOptions); - expect(tileUrl).toBe("http://localhost:8090/iserver/services/map-world/rest/maps/世界地图_Day/image.png?&transparent=true&cacheEnabled=false&width=256&height=256&viewBounds={\"leftBottom\" : {\"x\":NaN,\"y\":NaN},\"rightTop\" : {\"x\":NaN,\"y\":NaN}}"); + 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"); expect(imageTileSource.tileGrid.tileSize_).toEqual(256); }); }); \ No newline at end of file