Select to view content in your preferred language

Trying to display a feature layer

1050
9
01-05-2011 11:52 AM
PhilDegler
Emerging Contributor
Hello,

I'm trying to add a feature layer to a map in a silverlight application.  I need to be able to display attributes, map tips etc. and individual selections using point geometry.

I'm currently pointing the feature layer to a rest service which does "not" have feature access enabled.  Running the application does not produce an error, but does not display any of the point data.

On the other hand, if I create a dynamic layer and point toward the same service, the points show up.

I'm assuming my issue is related to the lack of feature access in my map service.  Is that correct?

If that is correct, is there any way to create a feature layer with SQL Server data that is not registered with SDE?  This is the reason that I cannot enable feature access when creating my service.

I would greatly appreciate any help with this.  Also, I would appreciate if anyone has a better way of accomplishing my goal.
0 Kudos
9 Replies
dotMorten_esri
Esri Notable Contributor
You need to make the SHAPE field visible, or the client API will not be able to query for the geometries.
0 Kudos
PhilDegler
Emerging Contributor
Thankyou for your response,

Just to clarify...are saying that I can do all of these things in a silverlight map feature layer without the need to have feature access available in the service?  The table I'm using doesn't have a shape field...I'm assuming that I'll need to add one.  Is that correct?
0 Kudos
DominiqueBroux
Esri Frequent Contributor
Just to clarify...are saying that I can do all of these things in a silverlight map feature layer without the need to have feature access available in the service?

Right, Feature access is only needed for editinf not for viewing.


The table I'm using doesn't have a shape field...I'm assuming that I'll need to add one. Is that correct?


On the other hand, if I create a dynamic layer and point toward the same service, the points show up.


Strange that your dynamic map service is able to show up your features if there is no SHAPE field.
The SHAPE field is containing the geometry and is needed if you want to be able to display your feature on the map.
0 Kudos
PhilDegler
Emerging Contributor
I thought that was strange also...the symbology that appears in the dynamic layer is the same that I have setup in the map service.

So I don't need to do anything with ARCSDE to get the functionality that I am proposing?  That is my main concern at this point.
0 Kudos
DominiqueBroux
Esri Frequent Contributor
For what I know of the functionalities you are proposing, you don't need ArcSDE.

As Mortem mentionned, check that your SHAPE field is visible in the mxd you have used to publish your service (in ArcMap, right click the feature layer--> Fields Tab-> check visibility of SHAPE field).
0 Kudos
dotMorten_esri
Esri Notable Contributor
Strange that your dynamic map service is able to show up your features if there is no SHAPE field.
The SHAPE field is containing the geometry and is needed if you want to be able to display your feature on the map.


The SHAPE field can be hidden from publishing to the REST service, but that doesn't mean its hidden from the MapService when it needs to generate the map image server side.
0 Kudos
PhilDegler
Emerging Contributor
I'm still not having any luck...I checked the shape field (evidently ARCMAP added this for me to the layer) and it is visible.

There is no display of the points in my silverlight app when I point to the service as a feature layer. 

One thing that I noticed when I navigated to my service URL is that there is nothing listed as the  display field.  Could this be a problem?
0 Kudos
PhilDegler
Emerging Contributor
I have attached a listing of the service I'm trying to use as a feature layer.  Is there anything in the listing that would indicate a problem?

By the way...I noticed that I cannot view the attribute table in ARCMAP.  The points display fine in ARCMAP, but I can't pull up the attributes.  Not sure if this has anything to do with the issue in silverlight.
0 Kudos
PhilDegler
Emerging Contributor
I found a work around.  In my initial problem, I was importing two SQL server 2008 tables and then joining them in arc map and displaying the data on the map.  The map worked fine, but publishing this as a map service would not display the data in a feature layer in my silverlight app.

I decided to build a separate SQL table, consolidate the data and bring just that one table into ARCMAP to display my data.  This allowed me to pull up the attribute table in ARCMAP and I was then able to publish a map service that could be displayed in a feature layer.
0 Kudos