Hi All,
I think I have a simple question. This code returns the XY of the point clicked in feet. I would like to get it in decimal degrees. How would I modify the code?
I think I have a simple question. This code returns the XY of the point clicked in feet. I would like to get it in decimal degrees. How would I modify the code?
Code:
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace ArcMapAddin1
{
public class HyperlinkIStreet : ESRI.ArcGIS.Desktop.AddIns.Tool
{
public HyperlinkIStreet()
{
}
protected override void OnUpdate()
{
}
//private const string USER_PROMPT_3 = "Are you sure you want to hyperlink to IStreetView?";
private const string CAPTION_3 = "Hyperlink to IStreet";
protected override void OnMouseDown(ESRI.ArcGIS.Desktop.AddIns.Tool.MouseEventArgs arg)
{
//var result = System.Windows.Forms.MessageBox.Show(USER_PROMPT_3, CAPTION_3,
// System.Windows.Forms.MessageBoxButtons.YesNo,
// System.Windows.Forms.MessageBoxIcon.Question);
//if (result == System.Windows.Forms.DialogResult.Yes)
{
//Get coordinates from MouseEventArgs
ESRI.ArcGIS.ArcMapUI.IMxDocument mxDoc = ArcMap.Document;
ESRI.ArcGIS.Carto.IActiveView activeView = mxDoc.FocusMap as ESRI.ArcGIS.Carto.IActiveView;
ESRI.ArcGIS.Geometry.IPoint point = activeView.ScreenDisplay.DisplayTransformation.ToMapPoint(arg.X, arg.Y) as ESRI.ArcGIS.Geometry.IPoint;
//Open IStreetView in default browser
System.Diagnostics.Process.Start("http://maps.google.com/maps?q=&layer=c&cbll="
+ point.X + "," + point.Y + "&cbp=12,100,0,0,0&output=svembed&t=m&z=17");
}
}
}
}