2

I'm attempting to query a polyline layer using the ArcGIS Javascript API I all ready have a lot of experience doing this with Point layers. So I set my Polyline layer up the same way and stopped and started my service again to get every thing going. When I run the query (specifically when I run PolylineQueryTask.execute()) I get an error that just says the operation can't be completed. There is some code below that shows how I'm setting my query layer up. Any ideas on what I can do to fix this issue or things I should try?

PolylineQueryTask = new esri.tasks.QueryTask("http://" + DomainAddress + "/ArcGIS/rest/services/SNND/MapServer/1");

PolylineQuery = new esri.tasks.Query();
PolylineQuery.returnGeometry = true;
PolylineQuery.outFields = ["ObjID"];

PolylineQuery.where = 'where 1 = 1';
PolylineQueryTask.execute(PolylineQuery, ShowPolylineResults, FatlError);

So as you can see from my code I should be getting all my polylines back. Any thoughts are very appreciated.

1 Answer 1

5

Found my problem and I feel like a complete moron for my screw up seeing as how I've used this function so many times before.

PolylineQuery.where = 'where 1 = 1';

the above line should be

PolylineQuery.where = '1 = 1';

I don't need to specify the word 'where'

I'm an idiot :)

1
  • Upvote for himself 'idiot' epiphany.
    – Magno C
    Commented Feb 6, 2013 at 11:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.