Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into v11.2.0
  • Loading branch information
xilanhuaweidapao committed Jan 24, 2025
2 parents 158b5c3 + a9e00d8 commit bb509cd
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/openlayers/mapping/WebMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -1944,7 +1944,7 @@ export class WebMap extends Observable {
await that.addLayer(layer, null, layerIndex);
that.layerAdded++;
that.sendMapToUser(len);
return;
continue;
}
if (
layer.layerType === 'MARKER' ||
Expand Down
20 changes: 20 additions & 0 deletions test/openlayers/mapping/WebMapSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1785,4 +1785,24 @@ describe('openlayers_WebMap', () => {
}, 500);
}
});
it('datavizWebMap_noServerIdMarker', (done) => {
let options = {
server: server,
webMap: defaultServeRequest,
successCallback,
errorCallback: function () { }
};
spyOn(FetchRequest, 'get').and.callFake((url) => {
if (url.indexOf('map.json') > -1) {
var mapJson = datavizWebMap_noServerIdMarker;
return Promise.resolve(new Response(mapJson));
}
return Promise.resolve();
});
var datavizWebmap = new WebMap(options);
function successCallback() {
expect(datavizWebmap.server).toBe(server);
done();
}
});
});
1 change: 1 addition & 0 deletions test/resources/WebMapV5.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ var datavizWebMap_WMTS = '{"version":"6.0","title":"wmts","description":"","proj
var datavizWebMap_WMTS1 = '{ "extent": { "leftBottom": { "x": -20037508.3427892, "y": -20037508.3427892 }, "rightTop": { "x": 20037508.3427892, "y": 20037508.3427892 } }, "level": 1, "center": { "x": 8548489.791091159, "y": -2939180.84386342 }, "baseLayer": { "layerType": "TIANDITU_VEC_3857", "visible": true, "labelLayerVisible": true, "name": "天地图" }, "layers": [ { "layerType": "WMTS", "tileMatrixSet": "GoogleMapsCompatible_China_4326", "name": "China_4326", "url": "http://localhost:9876/iserver/services/map-china400/wmts100?", "layer": "China_4326" } ], "description": "", "projection": "EPSG:3857", "title": "3857", "version": "1.0" }'
var datavizWebMap_WMTS2 = '{ "extent": { "leftBottom": { "x": -20037508.3427892, "y": -20037508.3427892 }, "rightTop": { "x": 20037508.3427892, "y": 20037508.3427892 } }, "level": 1, "center": { "x": 8548489.791091159, "y": -2939180.84386342 }, "baseLayer": { "layerType": "TIANDITU_VEC_3857", "visible": true, "labelLayerVisible": false, "name": "天地图" }, "layers": [ { "layerType": "WMTS", "tileMatrixSet": "Custom_China_4326", "name": "China_4326", "url": "http://localhost:9876/iserver/services/map-china400/wmts100?", "layer": "China_4326" } ], "description": "", "projection": "EPSG:3857", "title": "3857", "version": "1.0" }'
var datavizWebMap_fiter = '{ "extent": { "leftBottom": { "x": -2.00375083427892E7, "y": -2.00375083427892E7 }, "rightTop": { "x": 2.00375083427892E7, "y": 2.00375083427892E7 } }, "level": 11, "center": { "x": 1.2980839382783111E7, "y": 4850526.359611664 }, "baseLayer": { "layerType": "TIANDITU_VEC_3857", "visible": true, "labelLayerVisible": true, "name": "天地图" }, "layers": [ { "layerType": "VECTOR", "visible": true, "filterCondition": "SmID>20", "name": "北京市轨道交通站点", "featureType": "LINE", "style": { "fillColor": "#ff0000", "strokeWidth": 1, "fillOpacity": 0.9, "type": "BASIC_POINT", "radius": 6, "strokeColor": "#ffffff", "strokeOpacity": 1 }, "projection": "EPSG:4326", "dataSource": { "type": "PORTAL_DATA", "serverId": "1276193546" } } ], "description": "", "projection": "EPSG:3857", "title": "filter", "version": "1.0" }'
var datavizWebMap_noServerIdMarker = '{"extent":{"leftBottom":{"x":-20037508.3427892,"y":-20037508.3427892},"rightTop":{"x":20037508.3427892,"y":20037508.3427892}},"maxScale":"1:144447.92746805","level":1,"center":{"x":0,"y":-7.081154551613622E-10},"baseLayer":{"layerType":"TILE","visible":true,"name":"中国暗色地图","url":"https://maptiles.supermapol.com/iserver/services/map_China/rest/maps/China_Dark"},"layers":[{"layerType":"MARKER","visible":true,"name":"未命名标注图层1"},{"layerType":"MARKER","visible":true,"name":"未命名标注图层2"}],"description":"","projection":"EPSG:3857","minScale":"1:591658710.909131","title":"无标题","version":"2.4.1","rootUrl":"http://127.0.0.1:8082/iportal/"}';

var xlsData = '{"fileName":"671个气象站观测数据(1).xlsx","type":"EXCEL","lineNumber":1,"content":{"colTitles":["区站号","站台","省份","X","Y","海拔","平均最低气温","最热七天气温","最高气温","最低气温","年均降雨"],"rows":[["50136","漠河","黑龙江","122.37","53.47","296","-47","29","33","-53","366.1"]]}}';
var csvData = '{"fileName":"北京市幼儿园_1.csv","type":"CSV","lineNumber":1,"content":{"colTitles":["名称","学校类别","电话","地址","学校类别_Num","X","Y","城市"],"rows":[["北京市顺义区汇佳东方幼儿园","61幼儿园","89431740","北京市顺义区东方太阳城万晴园54号","61","116.718806","40.086966","北京"]]}}';
Expand Down

0 comments on commit bb509cd

Please sign in to comment.