diff --git a/test/openlayers/mapping/WebMapSpec.js b/test/openlayers/mapping/WebMapSpec.js index ee333dcf0..28825f4cf 100644 --- a/test/openlayers/mapping/WebMapSpec.js +++ b/test/openlayers/mapping/WebMapSpec.js @@ -1579,27 +1579,4 @@ describe('openlayers_WebMap', () => { done(); } }); - - it('createBaseLayer-SUPERMAP_REST-token', (done) => { - spyOn(FetchRequest, 'get').and.callFake((url, params, options) => { - if (url.indexOf('map.json') > -1) { - var mapJson = datavizWebMap_RestMap_token; - return Promise.resolve(new Response(mapJson)); - } else if (url.indexOf('content.json') > -1) { - expect(url.indexOf('testtoken')).toBe(-1); - return Promise.resolve(new Response(geojsonData)); - } else { - expect(url.indexOf('testtoken')).not.toBe(-1); - return Promise.resolve() - } - }); - var datavizWebmap = new WebMap(id, {successCallback, errorCallback, server: defaultServer }); - function successCallback(map, mapInfo, layers, baseLayer){ - expect(baseLayer.credential).toEqual({token: 'testtoken'}); - done(); - } - function errorCallback(error) { - console.log(error); - } - }); }); diff --git a/test/resources/WebMapV5.js b/test/resources/WebMapV5.js index d2c88bafa..50eb76090 100644 --- a/test/resources/WebMapV5.js +++ b/test/resources/WebMapV5.js @@ -185,8 +185,6 @@ var datavizWebMap_Marker = '{"version":"6.0","title":"标注图层","description var datavizWebMap_RestMap = '{"version":"6.0","title":"RestMap","description":"restMap from jingjin","projection":"EPSG:3857","center":{"x":13010199.082679197,"y":4882852.518868368},"level":7,"extent":{"leftBottom":{"x":-20037508.3427892,"y":-20037508.3427892},"rightTop":{"x":20037508.3427892,"y":20037508.3427892}},"baseLayer":{"layerType":"CLOUD","name":"高德地图"},"layers":[{"layerType":"TILE","name":"京津地区土地利用现状图","visible":true,"credential":"credential","url":"https://www.supermapol.com/iserver/services/map-jingjin/rest/maps/京津地区土地利用现状图","projection":"EPSG:3857"}],"sourceType":"DataViz","thumbnail":"http://127.0.0.1:8090/iportal/static/dataviz/static/imgs/thumbnail_default.png"}'; -var datavizWebMap_RestMap_token = '{"version":"6.0","title":"RestMap","description":"restMap from jingjin","projection":"EPSG:3857","center":{"x":13010199.082679197,"y":4882852.518868368},"level":7,"extent":{"leftBottom":{"x":-20037508.3427892,"y":-20037508.3427892},"rightTop":{"x":20037508.3427892,"y":20037508.3427892}},"baseLayer":{"layerType":"TILE","name":"jingjin","url":"https://www.supermapol.com/iserver/services/map-jingjin/rest/maps/京津地区土地利用现状图?token=testtoken","visible":true},"layers":[{"layerType":"MARKER","name":"未命名标注图层1","visible":true,"projection":"EPSG:4326","dataSource":{"type":"PORTAL_DATA","serverId":"699444680"}}],"sourceType":"DataViz","thumbnail":"http://127.0.0.1:8090/iportal/static/dataviz/static/imgs/thumbnail_default.png"}'; - var datavizWebMap_RestMap1 = '{"extent":{"leftBottom":{"x":-20037508.3427892,"y":-20037508.3427892},"rightTop":{"x":20037508.3427892,"y":20037508.3427892}},"level":9,"center":{"x":12965020.337824289,"y":4888953.101710811},"baseLayer":{"layerType":"CLOUD_BLACK","name":"涓浗钃濋粦"},"layers":[{"layerType":"VECTOR","visible":true,"name":"rest_map_datasource","featureType":"POINT","style":{"fillColor":"#ff0000","strokeWidth":1,"fillOpacity":0.9,"radius":6,"strokeColor":"#ffffff","type":"BASIC_POINT","strokeOpacity":1},"projection":"EPSG:3857","dataSource":{"layerName":"rest_map_datasource","type":"REST_MAP","url":"https://www.supermapol.com/iserver/services/map_ShiLiShuJu/rest/maps/rest_map_datasource"}}],"description":"","projection":"EPSG:3857","title":"RestMap","version":"1.0"}' var datavizWebMap_RestData = '{"version":"6.0","title":"RestData","description":"","projection":"EPSG:3857","center":{"x":13013201.402643811,"y":4822518.728777889},"level":9,"extent":{"leftBottom":{"x":-20037508.3427892,"y":-20037508.3427892},"rightTop":{"x":20037508.3427892,"y":20037508.3427892}},"baseLayer":{"layerType":"CLOUD","name":"高德地图"},"layers":[{"layerType":"VECTOR","name":"Jingjin:BaseMap_P","visible":true,"featureType":"POINT","projection":"EPSG:4326","style":{"radius":6,"fillColor":"#ff0000","fillOpacity":0.9,"strokeColor":"#ffffff","strokeWidth":1,"strokeOpacity":1,"lineDash":"solid","symbolType":"svg","type":"BASIC_POINT"},"dataSource":{"type":"REST_DATA","url":"http://fakeiserver/iserver/services/data-jingjin/rest/data","dataSourceName":"Jingjin:BaseMap_P"}}],"sourceType":"DataViz","thumbnail":"http://127.0.0.1:8090/iportal/static/dataviz/static/imgs/thumbnail_default.png"}'; diff --git a/test/test-main-openlayers.js b/test/test-main-openlayers.js index 9848dc8e8..bbaa2cb9e 100644 --- a/test/test-main-openlayers.js +++ b/test/test-main-openlayers.js @@ -1,85 +1,85 @@ -// /*openlayers -- control*/ -// import './openlayers/control/ChangeTileVersionSpec.js'; -// import './openlayers/control/ScaleLineSpec'; +/*openlayers -- control*/ +import './openlayers/control/ChangeTileVersionSpec.js'; +import './openlayers/control/ScaleLineSpec'; -// /*openlayers -- core*/ -// import './openlayers/core/StyleUtilsSpec.js'; -// import './openlayers/core/UtilSpec.js'; -// import './openlayers/core/MapExtendSpec.js'; +/*openlayers -- core*/ +import './openlayers/core/StyleUtilsSpec.js'; +import './openlayers/core/UtilSpec.js'; +import './openlayers/core/MapExtendSpec.js'; -// // /*openlayers -- mapping*/ -// import './openlayers/mapping/ImageSuperMapRestSpec.js'; -// import './openlayers/mapping/TileSuperMapRestSpec.js'; +// /*openlayers -- mapping*/ +import './openlayers/mapping/ImageSuperMapRestSpec.js'; +import './openlayers/mapping/TileSuperMapRestSpec.js'; import './openlayers/mapping/WebMapSpec.js'; -// import './openlayers/mapping/ImageTileSuperMapRestSpec.js'; -// import './openlayers/mapping/initMapSpec.js'; +import './openlayers/mapping/ImageTileSuperMapRestSpec.js'; +import './openlayers/mapping/initMapSpec.js'; -// /*openlayers -- overlay*/ -// import './openlayers/overlay/DataFlowSpec.js'; -// import './openlayers/overlay/graphic/GraphicSpec.js'; -// import './openlayers/overlay/GraphicSpec.js'; -// import './openlayers/overlay/graphic/CanvasRendererSpec'; +/*openlayers -- overlay*/ +import './openlayers/overlay/DataFlowSpec.js'; +import './openlayers/overlay/graphic/GraphicSpec.js'; +import './openlayers/overlay/GraphicSpec.js'; +import './openlayers/overlay/graphic/CanvasRendererSpec'; -// import './openlayers/overlay/GraphSpec.js'; -// import './openlayers/overlay/HeatMapSpec.js'; -// import './openlayers/overlay/LabelSpec.js'; -// import './openlayers/overlay/MapvSpec.js'; -// import './openlayers/overlay/RangeSpec.js'; -// import './openlayers/overlay/RankSymbolSpec.js'; -// import './openlayers/overlay/UniqueSpec.js'; -// import './openlayers/overlay/VectorTileSuperMapRestMapboxstyleSpec.js'; -// import './openlayers/overlay/VectorTileSuperMapRestSpec.js'; -// import './openlayers/overlay/theme/GeoFeatureSpec.js'; -// import './openlayers/overlay/theme/ThemeFeatureSpec.js'; -// import './openlayers/overlay/theme/ThemeSpec.js'; -// import './openlayers/overlay/vectortile/VectorTileStylesSpec.js'; -// import './openlayers/overlay/vectortile/MapboxStylesSpec.js'; -// import './openlayers/overlay/TurfSpec.js'; -// import './openlayers/overlay/FGBSpec.js'; -// import './openlayers/overlay/GraphMapSpec'; +import './openlayers/overlay/GraphSpec.js'; +import './openlayers/overlay/HeatMapSpec.js'; +import './openlayers/overlay/LabelSpec.js'; +import './openlayers/overlay/MapvSpec.js'; +import './openlayers/overlay/RangeSpec.js'; +import './openlayers/overlay/RankSymbolSpec.js'; +import './openlayers/overlay/UniqueSpec.js'; +import './openlayers/overlay/VectorTileSuperMapRestMapboxstyleSpec.js'; +import './openlayers/overlay/VectorTileSuperMapRestSpec.js'; +import './openlayers/overlay/theme/GeoFeatureSpec.js'; +import './openlayers/overlay/theme/ThemeFeatureSpec.js'; +import './openlayers/overlay/theme/ThemeSpec.js'; +import './openlayers/overlay/vectortile/VectorTileStylesSpec.js'; +import './openlayers/overlay/vectortile/MapboxStylesSpec.js'; +import './openlayers/overlay/TurfSpec.js'; +import './openlayers/overlay/FGBSpec.js'; +import './openlayers/overlay/GraphMapSpec'; -// // /**openlayers --services**/ -// import './openlayers/services/BufferAnalysisSpec.js'; -// import './openlayers/services/DensityAnalysisSpec.js'; -// import './openlayers/services/EditFeaturesSpec.js'; -// import './openlayers/services/FieldServiceSpec.js'; -// import './openlayers/services/GenerateSpatialDataSpec.js'; -// import './openlayers/services/GeoRelationAnalysisSpec.js'; -// import './openlayers/services/GeometryBatchAnalysisSpec.js'; -// import './openlayers/services/GetFeaturesByBoundsSpec.js'; -// import './openlayers/services/GetFeaturesByBufferSpec.js'; -// import './openlayers/services/GetFeaturesByGeometrySpec.js'; -// import './openlayers/services/GetFeaturesByIDsSpec.js'; -// import './openlayers/services/GetFeaturesBySQLSpec.js'; -// import './openlayers/services/GeoprocessingServiceSpec.js'; +// /**openlayers --services**/ +import './openlayers/services/BufferAnalysisSpec.js'; +import './openlayers/services/DensityAnalysisSpec.js'; +import './openlayers/services/EditFeaturesSpec.js'; +import './openlayers/services/FieldServiceSpec.js'; +import './openlayers/services/GenerateSpatialDataSpec.js'; +import './openlayers/services/GeoRelationAnalysisSpec.js'; +import './openlayers/services/GeometryBatchAnalysisSpec.js'; +import './openlayers/services/GetFeaturesByBoundsSpec.js'; +import './openlayers/services/GetFeaturesByBufferSpec.js'; +import './openlayers/services/GetFeaturesByGeometrySpec.js'; +import './openlayers/services/GetFeaturesByIDsSpec.js'; +import './openlayers/services/GetFeaturesBySQLSpec.js'; +import './openlayers/services/GeoprocessingServiceSpec.js'; -// import './openlayers/services/InterpolationAnalysisSpec.js'; -// import './openlayers/services/LayerInfoServiceSpec.js'; -// import './openlayers/services/MathExpressionAnalysisSpec.js'; -// import './openlayers/services/MeasureServiceSpec.js'; -// import './openlayers/services/NetworkAnalystServiceSpec.js'; -// import './openlayers/services/OverlayAnalysisSpec.js'; -// import './openlayers/services/ProcessingServiceSpec.js'; -// import './openlayers/services/QueryServiceSpec.js'; -// import './openlayers/services/RouteCalculateMeasureSpec.js'; -// import './openlayers/services/RouteLocateSpec.js'; -// import './openlayers/services/SurfaceAnalysisSpec.js'; -// import './openlayers/services/TerrainCurvatureCalculateSpec.js'; -// import './openlayers/services/TerrainAspectCalculateSpec.js'; -// import './openlayers/services/TerrainSlopeCalculateSpec.js'; -// import './openlayers/services/TerrainCutFillCalculateSpec.js'; -// import './openlayers/services/MinDistanceAnalysisSpec.js'; -// import './openlayers/services/ConvexHullAnalysisSpec.js'; -// import './openlayers/services/ThemeServiceSpec.js'; -// import './openlayers/services/ThiessenAnalysisSpec.js'; -// import './openlayers/services/TrafficTransferAnalystServiceSpec.js'; -// import './openlayers/services/AddressMatchServiceSpec.js'; -// import './openlayers/services/GridCellInfosServiceSpec.js'; -// import './openlayers/services/WebPrintingJobServiceSpec.js'; -// import './openlayers/services/DatasetServiceSpec.js'; -// import './openlayers/services/DatasourceServiceSpec.js'; -// import './openlayers/services/ImageServiceSpec'; -// import './openlayers/services/ImageCollectionServiceSpec'; -// import './openlayers/services/KnowledgeGraphServiceSpec.js'; -// import './openlayers/services/ChartServiceSpec.js'; +import './openlayers/services/InterpolationAnalysisSpec.js'; +import './openlayers/services/LayerInfoServiceSpec.js'; +import './openlayers/services/MathExpressionAnalysisSpec.js'; +import './openlayers/services/MeasureServiceSpec.js'; +import './openlayers/services/NetworkAnalystServiceSpec.js'; +import './openlayers/services/OverlayAnalysisSpec.js'; +import './openlayers/services/ProcessingServiceSpec.js'; +import './openlayers/services/QueryServiceSpec.js'; +import './openlayers/services/RouteCalculateMeasureSpec.js'; +import './openlayers/services/RouteLocateSpec.js'; +import './openlayers/services/SurfaceAnalysisSpec.js'; +import './openlayers/services/TerrainCurvatureCalculateSpec.js'; +import './openlayers/services/TerrainAspectCalculateSpec.js'; +import './openlayers/services/TerrainSlopeCalculateSpec.js'; +import './openlayers/services/TerrainCutFillCalculateSpec.js'; +import './openlayers/services/MinDistanceAnalysisSpec.js'; +import './openlayers/services/ConvexHullAnalysisSpec.js'; +import './openlayers/services/ThemeServiceSpec.js'; +import './openlayers/services/ThiessenAnalysisSpec.js'; +import './openlayers/services/TrafficTransferAnalystServiceSpec.js'; +import './openlayers/services/AddressMatchServiceSpec.js'; +import './openlayers/services/GridCellInfosServiceSpec.js'; +import './openlayers/services/WebPrintingJobServiceSpec.js'; +import './openlayers/services/DatasetServiceSpec.js'; +import './openlayers/services/DatasourceServiceSpec.js'; +import './openlayers/services/ImageServiceSpec'; +import './openlayers/services/ImageCollectionServiceSpec'; +import './openlayers/services/KnowledgeGraphServiceSpec.js'; +import './openlayers/services/ChartServiceSpec.js';