carneiro04

Query using geometry(polygon) and js api 3.7

Discussion created by carneiro04 on Nov 6, 2013
Latest reply on Nov 19, 2013 by JGravois-esristaff
Hi,

I'm trying to do a query over a feature layer, using a geometry as filter. The geometry is a polygon, so it has rings and the json format should be like in the API reference examples: (http://sampleserver3.arcgisonline.com/ArcGIS/SDK/REST/index.html?query.html)

1) {"rings" : [
[ [<x11>, <y11>], [<x12>, <y12>], ..., [<x11>, <y11>] ],
[ [<x21>, <y21>], [<x22>, <y22>], ..., [<x21>, <y21>] ]
],
"spatialReference" : {<spatialReference>}
}

But, instead of that, the json built by the API is diferent, like this:

2){ "rings" : " [
[ [<x11>, <y11>], [<x12>, <y12>], ..., [<x11>, <y11>] ],
[ [<x21>, <y21>], [<x22>, <y22>], ..., [<x21>, <y21>] ]
]",
"spatialReference" : {<spatialReference>}
}

Trying to submit a query using this geometry to a AGS 10.1 , I've got this error: Invalid or missing input parameters
I also tried to submit a query using the same geometry to a AGS 10.2 and the result was ok, with no error.

My question is: if the documentation says the correct json format is like 1), why is theAPI building a json with extra double quotes?
Is it a bug?

Thanks in advance!

Anderson

Outcomes