AnsweredAssumed Answered

Feature Query Selection.

Question asked by Nadir_Hussain on Jan 31, 2016
Latest reply on Feb 1, 2016 by rscheitlin

Dear all

on my page load event i create one circle graphic using below code. in page load event

i add one feature layer.


           map.on("layers-add-result", drawCircle(evt));

function drawCircle(evt){

               var ptLayer = evt.layers[0].layer;

                var pt = new Point("45.42", "23.24", map.SpatialReference);

                var selectQuery = new Query();

                 circle = new Circle({

                        center: pt,

                        geodesic: true,

                        radius: 500,

                        radiusUnit: "esriMiles"



                    var graphic = new Graphic(circle, circleSymb);


                    var selectQuery= new Query();

                    selectQuery.geometry = circle.getExtent();

                    selectQuery.distance = 500;

                    selectQuery.units = "miles";

                    selectQuery.returnGeometry = true;

                     ptLayer .selectFeatures(selectQuery, FeatureLayer.SELECTION_NEW, function (features) {

                            if (features.length > 0) {

                                 updateFeature = features[0];


                                //, map.getInfoWindowAnchor(evt.screenPoint));

                      , map.getInfoWindowAnchor(pt));



                            else {







if i call this function on map click event it return features.But if i call this on page load feature returns.what can be the reason.please help.i have to use this code my production part.

thanks once again.