search with reprojection
Hi All,
I've created a "Search Locality" workflow based on the "searchParcelsID.xaml" sample.
However, my search layer is in a different coordinate system (4283), then the map (102100), and the returned "FeatureSet" are not being reprojected-on-fly.
I've noticed that in the "QueryTask", there is an option to set the "Out Spatial Reference", but I cannot get that to work.
Has anybody been able to create a search workflow with reprojection??
Regards,
Yi Lik
-
Is there a spatialReference variable in that workflow? If so, set the default attribute of that to your coordinate system...
0 -
You can create a new spatial reference object, which takes either a well-known ID or well-known text.
new ESRI.ArcGIS.Client.Geometry.SpatialReference(102100)
0 -
It wasn't working because my "Return Geometry" was set to False , once I set it to True . It is projecting.
Instead of hard coding the coordinate system into the workflow, is there a way for the workflow to work out the SilverLight Viewer projection?
0 -
Yes, if you have a geometry from the map already, you can ask it for its spatial reference. So in the Out Spatial Reference box, you would put (assuming your variable is named 'geometry'):
geometry.SpatialReference
0 -
So how do I get a geometry from the map, and pass that into the workflow?
0 -
If you have a featureset being returned you have everything you need. Ask for the spatial reference of the geometry for the first feature in the featureset. Assuming you have a featureset variable called 'featureSet' you can access it like this:
featureSet.Features.first().Geometry.SpatialReference
0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
6 kommentarer