AnsweredAssumed Answered

Feature Layer Select query problem

Question asked by Nadir_Hussain on Apr 8, 2015
Latest reply on Apr 8, 2015 by rscheitlin

var myFeatureLayer = new FeatureLayer("http://dell-pc/ArcGIS/rest/services/SirenFeatureService/FeatureServer/1", {

          mode: FeatureLayer.MODE_SELECTION,

          outFields: ["SIREN_NO", "Reg_E", "Reg_A", "Featuer_Type", "Description", "Location", "POINT_X"]

            });

map.on("click", function(evt) {

            try

            {

            selectQuery.geometry  =evt.mapPoint;

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

               if (features.length > 0) {

                //store the current feature

                updateFeature = features[0];

                map.infoWindow.setTitle(features[0].getLayer().name);

                map.infoWindow.show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint));

              }

              else {

                map.infoWindow.hide();

              }

            });

            }//try

           

            catch (err) {

                     txt = "There was an error on this page.\n\n";

                     txt += "Error description: " + err.message + "\n\n";

                     txt += "Click OK to continue.\n\n";

                     alert(txt);

                 }

           

          });

 

in above code featurelayer 1 is point layer and its symbols are picturemarker symbol in symbology.if i click on this symbol feature return 0.Even i check it returns the x and y point..if i change the feature layer number like 3,which is my polygon layer.it is simplefillsymbol in symbology.when i click on this it give me the feature.what can be the reason.might be the line is any  selectQuery.geometry  =evt.mapPoint is any problem.this works for polgon layer not work for point layer.

please help.

Outcomes