Apply MapXtreme2004 Developing GIS Code (C #) Search Elements in Tab Tables
Note: This post with the last post "MapXtreme2004 code read the element in the TAB table" is directly related, please see the blog. Http://blog.9cbs.net/arui319/rchive/2005/02/26/302859.aspx
Private void Findyuansu ()
{
Find Find = NULL;
Try
{
MapInfo.mapping.map map = null;
// Get a map
IF (MapInfo.Engine.Session.Current.mapFactory.count == 0 ||
(Map = mapinfo.Engine.Session.current.mapFactory [0]) == null)
{
Return;
}
// Start search
MapInfo.mapping.featurelayer Findlayer = (mapinfo.mapping.featurelayer) map.layers [_findlayername];
Find = new find (Findlayer.Table, Findlayer.table.tableinfo.columns [_findcolumnname]);
FindResult Result = Find.Search (DropDownList1.SelectedItem.text);
IF (Result.exactMatch)
{
/ / Reset the map
Map.center = new dpoint (result.foundpoint.x, result.foundpoint.y);
MapInfo.geetry.distance d = new mapinfo.geetry.distance (30, map.zoom.Unit);
Map.zoom = D;
}
Else
{
Response.write ("No Search!");
}
Find.dispose ();
}
Catch (Exception)
{
IF (Find! = NULL) Find.dispose ();
}
}