AnsweredAssumed Answered

Add PanTo functionality to my custom widget

Question asked by dlecker1 on Oct 11, 2016
Latest reply on Oct 12, 2016 by rscheitlin

Hello all,
   I am trying to add the panTo functionality to an icon on my custom widget, but it keeps triggering the popup window to open up. How can I just have it pan to the selected feature in my tool without triggering the popup panel?
here is the code block I am trying to implement it in.

    var panButton = dj.create("input", {text:"", value:"", panButton:"",

 

                    onclick:function(evt){
                        var q = new Query();
                        q.where = "OBJECTID=" + evt.target.parentNode.parentNode.attributes["oid"].value;
                        q.returnGeometry = true;
                        q.outFields = ["*"];
                        q.outSpatialReference = map.spatialReference;
                        var qt = new QueryTask(evt.target.parentNode.parentNode.attributes["uri"].value);

 

                        var res = qt.execute(q, function(featureSet){
                            map.PanTo(featureSet.features[0]);
                        }
                    );
                    },

Thanks for your help,
Douglas

Outcomes