Select to view content in your preferred language

RelationshipQuery outSpatialReference

922
1
08-28-2013 10:27 AM
AndrewLaux
Occasional Contributor
I am having trouble setting the outSpatialReference property on the RelationshipQuery object.  I am querying a featurelayer with a wkid of 102300, and want it to return in 102100.  It appears the outSpatialReference property has been applied, but whenever the results come back, they are always in 102300.  The outSR property is not included in the outgoing REST request, even after setting this property in code.

When running the same query in the ArcGIS Server Rest html interface, the outSR param is properly appended and executed.  Has anybody else experienced this behavior in the javascript API?

I can't figure out any other solution except to change the spatial reference of my map service to 102100.

var relatedTopsQuery = new RelationshipQuery();
                relatedTopsQuery.outFields = ["*"];
                relatedTopsQuery.relationshipId = this.activeRelationshipId;
                relatedTopsQuery.returnGeometry = true;
                relatedTopsQuery.outSpatialReference = this.map.spatialReference;
                relatedTopsQuery.objectIds = [this.selectedRouteId];

                this.routeFeatureLayer.queryRelatedFeatures(relatedTopsQuery, lang.hitch(this, this.relatedFeaturesQueryComplete));
0 Kudos
1 Reply
JohnGravois
Deactivated User
i reproed this problem and notified the development team.  until the problem is resolved, please consider using setPreRequestCallback to add the appropriate parameter immediately before the request is sent.

//esri.setRequestPreCallback(myCallbackFunction);

function myCallbackFunction(ioArgs) {
       if (ioArgs.url == "http://[server]/ArcGIS/rest/services/[servicename]/MapServer/0/queryRelatedRecords") {
        //outSR is the parameter name understood by the service itself.  set the wkid as a number
                ioArgs.content.outSR = 102100;
       }
       // don't forget to return ioArgs.
       return ioArgs;
}


thanks for bringing this issue to our attention.
0 Kudos