Author: nannan
The dynamic map service means that the vector map is not tiled, and the map is saved directly to save the workspace, and the Rest map service can be released to the workspace on the iServer.
Attribute filtering is to filter and display the map service according to the value in the field, so that it is convenient for users to filter and display the map in a targeted manner based on the attribute value. Let's look at the implementation code:
function onload(Cesium) {
//初始化viewer部件
var viewer = new Cesium.Viewer('cesiumContainer');
var imageryLayers = viewer.imageryLayers;
//利用服务url创建SuperMapImageryProvider实例
var beijingProvider = new Cesium.SuperMapImageryProvider({
url: 'http://localhost:8090/iserver/services/map-BeiJing/rest/maps/Beijing@BeijingDEM',
//属性过滤参数设置
layerStatusParameters: [{
layerName: "Beijing@BeijingDEM#2",//图层名
isVisible: true,//是否可见
displayFilter: "Name='北京' or Name='密云'"//过滤属性值
}, {
layerName: "Beijing@BeijingDEM#1",
isVisible: true,
displayFilter: "Name='北京' or Name='密云'"
}]
});
var beijingimagery;
beijingimagery = imageryLayers.addImageryProvider(beijingProvider);
}
if (typeof Cesium !== 'undefined') {
window.startupCalled = true;
onload(Cesium);
}
The effect diagram before
filtering is as follows: the effect after filtering is as follows: