I'm still bitter with ESRI for not bringing Python Add-Ins over to Pro.. I have never coded in C#/.NET and know very little about ArcObjects. My Python skills I consider to be strong, not just scripting but app development, so I think I can pick up on the .NET SDK, though I am reluctant to get into this rabbit hole. I have VS and the SDK up and running, went through some tutorials, just looking for some guidance on a specific solution here.
A while back I created a little ArcMap Add-In, just a single toolbar button that will open Google Street View in your default browser when the user clicks a location on the map. I'd like to deploy a button like this in Pro, but after searching and searching for 'C# open a web page on click event' all I was coming up with was ASP.NET stuff and I have zero knowledge on any of this stuff lol! I was basically looking for a one liner to add into the onClick event of my button.cs code to just open Google.com to start with.
Below is the Python Add-In code that accomplishes this, and I am not looking for anyone to code this entirely for me, but maybe some suggestions, guidance, resources, etc. All this does is grab the coordinates from where the user clicks and feeds that into a url to open street view.
<SPAN class="keyword token">import</SPAN> arcpy
<SPAN class="keyword token">import</SPAN> pythonaddins
<SPAN class="keyword token">import</SPAN> webbrowser
<SPAN class="keyword token">import</SPAN> threading
<SPAN class="keyword token">class</SPAN> <SPAN class="token class-name">OpenStreetView</SPAN><SPAN class="punctuation token">(</SPAN>object<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="string token">"""Implementation for StreetView_addin.tool (Tool)"""</SPAN>
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">__init__</SPAN><SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
self<SPAN class="punctuation token">.</SPAN>enabled <SPAN class="operator token">=</SPAN> <SPAN class="token boolean">True</SPAN>
self<SPAN class="punctuation token">.</SPAN>cursor <SPAN class="operator token">=</SPAN> <SPAN class="number token">3</SPAN> <SPAN class="comment token"># cross hair cursor</SPAN>
<SPAN class="keyword token">def</SPAN> <SPAN class="token function">onMouseDownMap</SPAN><SPAN class="punctuation token">(</SPAN>self<SPAN class="punctuation token">,</SPAN> x<SPAN class="punctuation token">,</SPAN> y<SPAN class="punctuation token">,</SPAN> button<SPAN class="punctuation token">,</SPAN> shift<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
mxd <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>mapping<SPAN class="punctuation token">.</SPAN>MapDocument<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"CURRENT"</SPAN><SPAN class="punctuation token">)</SPAN>
df <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>mapping<SPAN class="punctuation token">.</SPAN>ListDataFrames<SPAN class="punctuation token">(</SPAN>mxd<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN>
sr_df <SPAN class="operator token">=</SPAN> df<SPAN class="punctuation token">.</SPAN>spatialReference
pt <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>Point<SPAN class="punctuation token">(</SPAN>x<SPAN class="punctuation token">,</SPAN>y<SPAN class="punctuation token">)</SPAN>
pt_geom <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>PointGeometry<SPAN class="punctuation token">(</SPAN>pt<SPAN class="punctuation token">,</SPAN> sr_df<SPAN class="punctuation token">)</SPAN>
new_pt_geom <SPAN class="operator token">=</SPAN> pt_geom<SPAN class="punctuation token">.</SPAN>projectAs<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"WGS 1984"</SPAN><SPAN class="punctuation token">)</SPAN>
new_pt <SPAN class="operator token">=</SPAN> new_pt_geom<SPAN class="punctuation token">.</SPAN>firstPoint
new_X <SPAN class="operator token">=</SPAN> new_pt<SPAN class="punctuation token">.</SPAN>X
new_Y <SPAN class="operator token">=</SPAN> new_pt<SPAN class="punctuation token">.</SPAN>Y
<SPAN class="comment token">## message = "Projected: " + str(x) + ", " + str(y) + " Geographic: " + str(new_X) + ", " + str(new_Y)</SPAN>
<SPAN class="comment token">## pythonaddins.MessageBox(message, "Coordinates")</SPAN>
maps_url <SPAN class="operator token">=</SPAN> <SPAN class="string token">"https://maps.google.com/maps?q=&layer=c&cbll="</SPAN> <SPAN class="operator token">+</SPAN> str<SPAN class="punctuation token">(</SPAN>new_Y<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">+</SPAN> <SPAN class="string token">","</SPAN> <SPAN class="operator token">+</SPAN> str<SPAN class="punctuation token">(</SPAN>new_X<SPAN class="punctuation token">)</SPAN>
threading<SPAN class="punctuation token">.</SPAN>Thread<SPAN class="punctuation token">(</SPAN>target<SPAN class="operator token">=</SPAN>webbrowser<SPAN class="punctuation token">.</SPAN>open<SPAN class="punctuation token">,</SPAN> args<SPAN class="operator token">=</SPAN><SPAN class="punctuation token">(</SPAN>maps_url<SPAN class="punctuation token">,</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN>start<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>