Select to view content in your preferred language

Feature Layer - Spatial Data Service URL not working when using LineStrings

608
2
10-10-2011 04:55 PM
CharlotteCrawford
Emerging Contributor
Hi all,

I am attempting to get a mapit application working. I've set up a database table with some SQL Geography points in it for one FeatureLayer and it works fine.  I am now trying to do another featurelayer using SQL Geography LineStrings, but I am getting a problem when calling the Spatial Data service.  The query string that is being put on the url is "query?returnGeometry=true&spatialRel=esriSpatialRelIntersects&where=1%3d1&outSR=102100&f=json&". When I run this I get "Unable to perform query. Please check your parameters".  If I remove the outSR argument from the query string I can call the Spatial data service and get some results back.  Is there a way of removing this argument from a setting in either the FeatureLayer xaml or in code?

Thanks
CC
0 Kudos
2 Replies
JenniferNery
Esri Regular Contributor
I think this is a service-related issue if passing outSR worked for your points and not for lines.

In a FeatureLayer, OutSpatialReference is always included in the QueryTask, this is the Map's SpatialReference.

If you want this property skipped, you have to use QueryTask instead and add the results to GraphicsLayer. When setting Query properties, do not set OutSpatialReference and it will not be included in the query. There are some Query samples in the SDK: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#AttributeQuery
0 Kudos
CharlotteCrawford
Emerging Contributor
Thanks very much, I will give that a try.

CC
0 Kudos