Select to view content in your preferred language

cannot read property 'geometry' of undefined.

4380
0
09-17-2014 11:57 PM
NadirHussain
Frequent Contributor

function mapClickHandler(evt) {

                try {

                    map.graphics.clear();

                    if (identfyFlag == 1) {

                        var point = evt.mapPoint;

                        SMS.setStyle(SimpleMarkerSymbol.STYLE_CIRCLE);

                        SMS.setSize(12);

                        SMS.setColor(new esri.Color([255, 0, 0, 0.5]));

                       var pointGraphic = new Graphic(point, SMS);

                        map.graphics.add(pointGraphic);

                      

                         identifyTask = new IdentifyTask("http://dell-pc/ArcGIS/rest/services/Sirens/MapServer");

                        identifyParams = new IdentifyParameters();

                         identifyParams.tolerance = 3;

                            identifyParams.returnGeometry = true;

                            identifyParams.layerIds = [0, 1, 2, 3, 4, 5];

                           identifyParams.geometry = point;

                            identifyParams.layerOption = IdentifyParameters.LAYER_OPTION_ALL;

                            identifyParams.width = map.width;

                            identifyParams.height = map.height;

 

                        

 

                    }

                } //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);

                }

            }

 

i am facing problem in above code.when i want to set identifyParams.i get the fallowing error.cannot read property 'geometry' of undefined.please help.what can be the reason.the line with red color in the code throwing error.

0 Kudos
0 Replies