VERIFIED SOLUTION i
X

Creating the MapX SearchAtPoint function in MapXtreme .NET

UPDATED: September 24, 2018


The following example will search a given table (Layer), in MapXtreme .NET, for objects that intersect with the given point, will create a Feature Collection that contains the object(objects) and will then change the view to centre on the object(objects) in the Feature Collection:


public static void MapInfo_Data_SearchInfoFactorySearchIntersectsGeometry(Map map) {

Table ti = MapInfo.Engine.Session.Current.Catalog.GetTable("usa");

MapInfo.Mapping.FeatureLayer lParks=(MapInfo.Mapping.FeatureLayer)map.Layers["USA"];

MapInfo.Geometry.FeatureGeometry g = new MapInfo.Geometry.Point(map.GetDisplayCoordSys (), -98, 34);

SearchInfo si = MapInfo.Data.SearchInfoFactory.SearchIntersectsGeometry(g, MapInfo.Data.IntersectType.Geometry );

IResultSetFeatureCollection fc = Session.Current.Catalog.Search("usa", si);

map.SetView (fc.Envelope);

Environment Details

Products affected: MapXtreme .NET

Downloads

  • No Downloads