獲取Map中選擇的要素

2021-07-02 13:31:09 字數 953 閱讀 2366

1、使用ienumfeturea物件獲取map中的featureselection,該方法可以獲取所有圖層的選擇要素。imap中的featureselection可不是ifeatureselection,而是iselection。

2、使用iselectionset,ienumids,featureclass.getfeature()方法獲取某個圖層中的選擇要素

在map中獲取要素時,這樣是可以的,不過不能得到要素的完整屬性資訊,貌似只能拿到id值。

iselection pselection = pmap.featureselection;

ienumfeature enumfeature = pselection asienumfeature;

ifeature feature = enumfeature.next();

while (feature != null)

那如果要得到完整的屬性資訊怎麼辦呢?ienumfeaturesetup起到大作用了。如下所示:

iselection selection = pmap.featureselection;

ienumfeaturesetup enumfeaturesetup = selection as ienumfeaturesetup;//這裡很必要

enumfeaturesetup.allfields = true; //這裡很必要

ienumfeature enumfeature = enumfeaturesetup as ienumfeature;

enumfeature.reset();

ifeature feature = enumfeature.next();

while (feature != null)

**

獲取jqGrid中選擇的行的資料(附例項)

如何獲取jqgrid中選擇的行的資料?下面可以獲取選擇一行的id,如果你選擇多行,那下面的id是最後選擇的行的id var id gridtable jqgrid getgridparam selrow 如果想要獲取選擇多行的id,那這些id便封裝成乙個id陣列,那可以使用以下 var ids gr...

Delphi中選擇語句的使用

if then語句的使用 方式一 if then.這裡又可以寫成兩種,但是建議一句的不加begin 多句的加begin if a 0 then 語句1 或if a 0 then begin 語句1 這裡說明一下如果只有乙個語句也可以用begin.但是語句後邊 可寫可不寫.建議按規定的來.語句1 en...

PyChorm中選擇Python版本的問題

如果變成環境中有多個python版本的時候,如果安裝某些python依賴工具的時候,會選擇不同的python安裝路徑來安裝。要注意的點有 1.環境變數的設定 環境變數的設定決定你在cmd控制台上使用python時使用的python版本,所以記得設定好 將所有的python版本的安裝路徑都寫入環境變數...