alon

Using MapDocument without controls

Discussion created by alon on Jul 28, 2011
Latest reply on Aug 1, 2011 by alon
Hi,
Using ArcEngine V9.3 I need to create a service (console appliction) that can retrieve the nearest feature out of lat/lon. All is working perfectly when testing the code with Map control and manual pointing the map for the desired lat/lon.
The problem starts when I remove the UI and keep only the required GIS code (for testing purpose, with fixed lat/lon), on that case, the MapDocument object that holds the map (
Dim md As IMapDocument = New MapDocument
md.Open(PathMXD)
), even though it holds valid map (I can query for
md.Map(0).Layer(0)
and getting a valid response), but when trying to get the related FeatureClass, it comes as null. Any idea why?

Thanks,

Alon

Outcomes