Select to view content in your preferred language

How to open shape file in ArcGIS Runtime WPF SDK as Graphics/Feature layer

11431
24
01-23-2013 06:23 AM
KevinChan
Emerging Contributor
I googled and followed this tutorial http://www.arcgis.com/home/item.html?id=953a530ada30477d95cc69e788268bc9 and figured out how to import Shape files and Rasters into Runtime.

However, it seems most of the functionality uses a FeatureLayer/GraphicLayer instead an ArcGISLocalDynamicMapServiceLayer that the sample uses.

My question is if there is a way I can import the shape file as a graphics layer or if i can somehow cast my ArcGISLocalDynamicMapServiceLayer as a Graphics layer because shape file is essentially the same as a shape file.

An example is i'm trying to use the FeatureDataGrid() to show the attribute table of my shapep file, but I can't since it requires a graphics layer, not an ArcGISLocalDynamicMapServiceLayer.

Thanks and Regards, Kev
0 Kudos
24 Replies
GeorgeFaraj
Frequent Contributor
Hey Dominique,

So this worked for the Rectangle selection tool of the Editor control, but doesn't work with the Line selection tool. Any ideas how to make this work? No features get selected by the line tool.

Thanks,
George
0 Kudos
DominiqueBroux
Esri Frequent Contributor
How do you set the line selection tool?
What happens exactly?

Also is it working with others selection modes such as circle:  editor.SelectionMode = DrawMode.Circle; ?
0 Kudos
GeorgeFaraj
Frequent Contributor
Hi Dominique, sorry for taking so long to respond, but was tied up in something else.

I have a toolbar, and on one of its buttons click event handler:

if (MapEditor.Select.CanExecute("Keyboard"))
{
 MapEditor.SelectionMode = DrawMode.LineSegment;
 //MapEditor.Select.Execute("Keyboard");
}


When I click the toolbar icon, I can click and drag to draw a line, release the mouse click and nothing happens.

Only Rectangle and Point selection modes work, then others do nothing after I release the mouse click.
0 Kudos
SaranPon
Emerging Contributor
Thanks Mike, that resolved the problem with the layer not being visible. I can label its features, but I can't select anything with the Editor toolkit control. Why could that be?

I should note that I also add the dynamic service layer onto the map in addition to the feature layer, because the layer has too many features, so I show both with the feature layer set to OnDemand mode.


Hi George,

how did you Label the features of a feature layer? Using a Graphics Layer?

How did you pass the features for that? did you QueryTask?

Currently we are having trouble with this. Could you please let us know your approach which might help us solve our issue?

thanks,
Saravanan
0 Kudos
SaranPon
Emerging Contributor
Hi,

I have loaded a shape file / File GDB file successfully using the method specified here. Is it possible to apply symbology - using ClassificationMethod or some other way?

Please help.

Thanks,
Saravanan
0 Kudos