Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
songyumeng committed Sep 13, 2017
1 parent f977317 commit e135252
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/leaflet/mapping/ImageMapLayerSpec.js
Original file line number Diff line number Diff line change
@@ -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 () {
Expand Down Expand Up @@ -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");
});
});
2 changes: 1 addition & 1 deletion test/leaflet/mapping/TiledMapLayerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion test/openlayers/mapping/ImageSuperMapRestSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});

0 comments on commit e135252

Please sign in to comment.