Select to view content in your preferred language

Feature layer publish, Display in WPF app

4305
30
06-13-2010 10:55 PM
xariaD
by
Occasional Contributor
We have a feature layer, which we intend to publish using ArcGIS Server.
We have a WPF application which displays maps. This feature layer is to be overlayed upon the map.
The feature layers represents certain units installed at particular locations. We have the co-ordinates of these units.

The units have different state eg Enabled/disabled. We wish to represent the enabled units with different icon and disabled with different icon. Obviously the state is obtained dynamically. How to achieve this?
Also, Upon clicking these units on the map some function should be performed.
How do we determine which unit has been clicked?
0 Kudos
30 Replies
DominiqueBroux
Esri Frequent Contributor
At first it looks like a renderer question.
An 'UniqueValueRenderer' which allows to change the symbol depending on the value of a field should be what you are looking for.

Also, Upon clicking these units on the map some function should be performed.
How do we determine which unit has been clicked?


MouseLeftButtonDown event on a feature layer is called with a GraphicMouseButtonEventArgs which is giving the clicked graphic/feature.
0 Kudos
xariaD
by
Occasional Contributor
Thank you so much, I am not a GIS Developer and this is my first encounter with ESRI and WPF.

I know this is not the right forum but since we are at it, I have converted a CAD file to ARCMap layers.
This map has 2 layers, polyline and polygon, from CAD file.
Now I selected the units in question and converted the selection to a new layer. Presently the units are represented as circle. How do I replace this with some symbol?
0 Kudos
DominiqueBroux
Esri Frequent Contributor
You can either change the symbology in ArcMap (so this symbology will become the default symbology for your published service), or change the symbology on the client side by using the renderer classes of the silverlight API.

To change the symbology in ArcMap :
  - right click on the layer
  - select 'Properties'
  - go to 'Symbology' tab
  - define the symbology you need.

To redefine the symbology on the client side, here is a sample http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#FeatureLayerRendering
0 Kudos
xariaD
by
Occasional Contributor
I have added two layers to my map.
ArcGISDynamicMapServiceLayer and Featurelayer.
But the feature layer is not displayed. 😞

However, if I create a Web application using the ArcGIS Server then both the layers are displayed.

Also, The Feature layer MouseLeftButtonDown is created with MouseButonEventArgs
private void Feature_MouseLeftButtonDown(object sender, Graphic graphic, MouseButtonEventArgs args)
{
}
0 Kudos
dotMorten_esri
Esri Notable Contributor
I'm guessing you are still using v1.2?
0 Kudos
xariaD
by
Occasional Contributor
Yeah, we are using 1.2. How to proceed in that case?
0 Kudos
DominiqueBroux
Esri Frequent Contributor
1) First option : migrate to 2.0 🙂

2) With 1.2, the symbology defined on the server side is not used by the silverlight API (so 'Change the symbology in ArcMap' is no longer an option).
You have to define the symbology on the client side. Here is a sample : http://resources.esri.com/help/9.3/arcgisserver/apis/silverlight/samples/start.htm#FeatureLayerRende...

That being said, this doesn't explain why your feature layer is not displayed.
Perhaps comparing your code with the sample will give some clue.
0 Kudos
xariaD
by
Occasional Contributor
But does 2.0 support VS 2008? I see the minimum install is VS 2010 and I m using WPF not silverlight.
We are using Expression Blend 3 .
So I don't think upgrading to 2.0 is possible at this time.
I have checked with the sample and my code and it is similar I cannot figure out why the features layer is not rendered. 😞

Where is the code for web application created by ArcGIS server stored. Maybe I can compare those two codes.
😞

I really need to get this working.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
But does 2.0 support VS 2008? I see the minimum install is VS 2010 and I m using WPF not silverlight.
We are using Expression Blend 3 .
So I don't think upgrading to 2.0 is possible at this time.

You are right.

I have checked with the sample and my code and it is similar I cannot figure out why the features layer is not rendered.


First, you have to figure out if the issue is coming from the server or from the client.
Try to request your service directly from your browser.
A request like http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/Map... must return the layer information.
A request like http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/Map... must return a list of features.

If it's working well at the server level, there is probably an issue in your client code.
  - verify the symbology you gave to your layer
  - use fiddler (or firebug) to analyze the requests send to the server
0 Kudos