AnsweredAssumed Answered

Set lat and long for the GoToXY command C#

Question asked by mkisakye_works on Jul 24, 2020
Latest reply on Aug 3, 2020 by mkisakye_works

I am accessing and executing the GoToXY tool but I cannot find any methods in the api that allow me to set the default latitude and longitude. On the click of a button, I want the GoToXY control to open with preset latitude and longitude values. I thought that maybe the lat and long would be children of the wrapper but when I accessed the children property of the plugin wrapper, it returned an empty list. Uma Harano Wolfgang Kaiser

protected override void OnClick()
        {
            var commandId = "esri_mapping_gotoXYControl";

            var iCommand = FrameworkApplication.GetPlugInWrapper(commandId) as ICommand;
            if (iCommand != null)
            {
                // Let ArcGIS Pro do the work for us
                if (iCommand.CanExecute(null))
                {
                    iCommand.Execute(null);
                }
            }

        }

Outcomes