你好,webgl,http://support.supermap.com.cn:8090/webgl/examples/webgl/editor.html#MVT
通过
//修改要素风格
$("#changeFeatureStyle").on("click", function () {
// 创建填充临时图层
var layerSetting = selectLayer;
var highlightLayerID = selectLayer.id + "_highlight";
var highlightLayer = highlightLayers[highlightLayerID];
if (!Cesium.defined(highlightLayer)) {
var highlightLayerSetting = Cesium.clone(layerSetting, true);
highlightLayerSetting.id = highlightLayerID;
if (selectLayer.type == "line") { // 线
highlightLayerSetting.paint["line-width"] = 2.0;
highlightLayerSetting.paint["line-color"] = "rgba(255,0,0,1.00)";
} else if (selectLayer.type == "fill") { // 面
highlightLayerSetting.paint["fill-color"] = "rgba(255,0,0,1.00)";
}
mvtMap.addLayer(highlightLayerSetting);
// 设置过滤条件,只显示图层中ID=1的要素
mvtMap.setFilter(highlightLayerSetting.id, ["in", "$id", 1]);
highlightLayers[highlightLayerID] = true;
}
});
1.修改要素风格后只能修改一个级别的样式。怎么可以统一设置每个级别的样式
2. 如果不能设置每个级别的样式。有没有直接设置显示高亮的(鼠标点击的高亮效果),比如查询到 ID = 1的要素高亮