I'm writing a WPF application, in C#, using ArcObjects.

I have an ESRI.ArcGIS.Controls.AxMapControl on my form, and I'm trying to draw some point features on top of it, in code.

It's been suggested that I create a point feature layer, in an InMemoryWorkspace, and add that to the map.

I've not been able to find any decent examples of how to do this, online.

Can anyone give me an example of how to create a point feature layer, in an InMemoryWorkspace, or point me to an example elsewhere?


It is unlikely that you want to create a featurelayer in an InMemoryWorkspace. More likely you want to store the data used by a featurelayer in memory instead of in a file geodatabase, shapefile, or sde workspace.

Search for InMemoryWorkspaceFactory and you should be able to find samples such as this.

| improve this answer | |
  • What I want is the ability to place markers and labels on the map at set locations, at a fixed size, independent of the zoom level of the map. And I need the locations of these markers and labels is determined by code, rather than in a geodatabase, shapefile, etc. – Jeff Dege Aug 11 '16 at 13:42
  • 1
    Typically this is done using IGraphicsContainer to add IMarkerElements to the map. See "Add Graphic to Map" here – Kirk Kuykendall Aug 11 '16 at 13:59
  • I tried that, but the markers scaled to the map - they drew at a fixed size relative to the map, and scaled in size as the map zoomed in and out. – Jeff Dege Aug 11 '16 at 14:14
  • Are you saying the dimensions in pixels for the symbol changed, or was constant? – Kirk Kuykendall Aug 11 '16 at 21:59
  • 1
    I'm saying that the dimension in map units is constant. If I draw with a size of 25 on a foot-dimensioned map, the marker is 25 feet across, which renders as a varying number of pixels depending upon the map zoom level. What I want is a constant number of pixels independent of map zoom. I was told this wasn't possible with IGraphicsContainer, and I needed to create a FeatureLayer with ScaleSymbols turned off. – Jeff Dege Aug 12 '16 at 13:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.