Select to view content in your preferred language

Google Street View in Silverlight

2177
2
01-19-2011 09:25 AM
SedatMacoglu
Emerging Contributor
I know it is possible and I've recall seeing a sample viewer on the 9.3.1. Code Gallery (http://resources.esri.com/arcgisserver/apis/silverlight/index.cfm?fa=codeGalleryDetails&scriptID=166...).

Is there an archived version of the previous Silverlgith/WPF API? or if anyone can point me to where I can find more info on the Google Street View integration, I would really appreciate it.

Thanks,
Sedat
0 Kudos
2 Replies
DeminHu
Deactivated User
1. If your map is not in Web Mecator, convert to lat -Long
2 . If you open streetview in a new page :

   in xaml.cs, some code like the following:
            string lng = pt.X.ToString();
             string lat = pt.Y.ToString();
             string urlStr = "StreetView.aspx?lat=" + lat + "&lng=" + lng;
             HtmlPage.Window.Invoke("open", new object[] { urlStr, "win", "toolbar=no,width=650, height=700" });

   in streetView.aspx:
<script type="text/javascript">

        var myPano;

        // Function to retrieve URL parameters

        function gup(name) {
            name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
            var regexS = "[\\?&]" + name + "=([^&#]*)";
            var regex = new RegExp(regexS);
            var results = regex.exec(window.location.href);
            if (results == null)
                return "";
            else
                return results[1];
        }

        // Initialze the display on the web page

        function initialize() {
            lat = gup('lat');        
            document.getElementsByTagName("iframe")[0].src = "http://maps.google.com/maps?f=q&source=embed&hl=en&ie=UTF8&ll=" + lat + "," + lng + "&z=16&layer=c&cbll=" + lat + "," + lng + "&cbp=12,326.62,,0,5&output=svembed";
        }
    </script>
0 Kudos
SedatMacoglu
Emerging Contributor
Thank you for the code snippet.
0 Kudos