MapXtreme2004 Code Several Map Tools (C #)

xiaoxiao2021-03-06  15

The first DistanceToolControl, the map is measured. This is relatively simple.

Private void distanceToolControl1_distanceComputed (Object Sender, mapinfo.web.ui.webcontrols.distancetooleventargs e)

{

Label1.text = "Measurement distance is" E.Distance.tostring () "km!";

}

The second InfotoolControl, returns the designated map information, this complex, and the code in the MapXtreme2004 is incorrect, so many people will not be used. Here is yourself, you can use it.

Private Void InfotoolControl1_inforetrieved (Object Sender, mapinfo.web.ui.webcontrols.infotooleventargs e)

{

Label1.text = "";

Foreach (MapInfo.data.iResultSetFeatureCollection IResultsetFeatureCollection in E.FEATURES)

{

Foreach (MapInfo.data.feature Feature In IResultsetfeatureCollection)

{

Foreach (mapinfo.data.column column in feature.columns)

{

Label1.text = label1.text column.tostring (). TouPper () ": feature [column.tostring ()]. ​​TOSTRING () " / n ";

}

}

}

}

转载请注明原文地址:https://www.9cbs.com/read-46629.html

New Post(0)