首页 / 浏览问题 / WebGIS / 问题详情
Classic中使用SelectFeature控件怎么用代码取消某个元素的选中状态
45EXP 2025年04月28日


SuperMap iClient Classic:11i(2024) R2

查询交互该实例中可以通过鼠标点击来添加feature的选择状态,我现在可以通过SmID筛选到feature,但是怎么通过代码来修改feature的选择状态呢?
我翻阅了SuperMap.Control.SelectFeature - SuperMapSuperMap.Feature.Vector - SuperMap等等API没有找到可用的function。

1个回答

您说的选中状态是指点击要素显示的弹窗吗?您可以设置鼠标移动,将popup从map中移除

popup = new SuperMap.Popup.FramedCloud("chicken",
    feature.geometry.getBounds().getCenterLonLat(),
    null,
    contentHTML,
    null,
    true,
    null,
    true);
feature.popup = popup;

map.addPopup(popup);
1,261EXP 2025年04月28日
我指的不是feature.popup,是feature本身,SelectFeature控件有一个属性是selectStyle,这个selectStyle样式会在feature为选中时生效,取消选中时不生效,但是只能通过鼠标点击来变更feature的选择状态,我想通过代码来设置feature的选择状态,在某些时刻来控制feature的选中状态。
...