HOW to: Query task with polygon graphic created.

Discussion created by mravichandran on Jul 2, 2013
Latest reply on Jul 7, 2013 by vinaybansal
dear Readers,

thank you reading this question of mine. Using (without undo and redo), we had created the application and integrating the 2nd link:, we were able to do a map click as explained in the 2nd link to query our layer exposed by webservice.

1.  instead of sending a evt.MapPoint as indicated in the query buffer lnk with a predetermined buffer, how to send a polygon or a polyline intersect - we want the result as it comes out from query buffer.

2.  another question i had was: in that query_buffer example, example run as-is, returns only Object id for our server - even though i had set query out params = ["*"] and verified that rest service /0 layer queried had all columns exposed in a queriable fashion.

I have 1 idea, i can disable the map-click function in the query buffer and try to use the graphics point button to do the selection.  but i am not still sure about how to set up the query task to ensure that it does not fail.

when i try to send the polyon geometry in the query buffer code, it does not return anything.

wanted to see whether there are any examples that i can use to move forward.

 function addToMap(geometry) {
        var symbol;
        //   map.showZoomSlider();
        switch (geometry.type) {
            case "point":
                symbol = new esri.symbol.SimpleMarkerSymbol();
            case "multipoint":
                symbol = new esri.symbol.SimpleMarkerSymbol();
            case "polyline":
                symbol = new esri.symbol.SimpleLineSymbol();
                symbol = new esri.symbol.SimpleFillSymbol();
        var graphic = new esri.Graphic(geometry, symbol);
        graphicsDrawnOnScreen = graphic;
        var params = new esri.tasks.BufferParameters();
        //params.distances = [100];
        params.geometries = graphicsDrawnOnScreen;
      //  params.unit = esri.tasks.GeometryService.UNIT_METER;
        //params.geometries = [evt.mapPoint];     
        //params.unit = esri.tasks.GeometryService.UNIT_STATUTE_MILE;
        toolbarItemClicked == false;      
i tried the above code without commenting out the above lines.