Google® Street View Widget

44666
153
06-12-2013 08:02 PM
RobertScheitlin__GISP
MVP Emeritus

All,

   Here is the next installment to my long list of widgets. I never really wanted to add to the list of several Street View Widgets, but as it's predecessors have lacked updating when new version of Flex Viewer are released and me wanting to add more features, I finally decided to do one myself.

The Google Street View Widget version 3.3 for Flex Viewer 3.3 allows you to view Google Street View Panoramas in a popup window. The widget use Google Maps API Version 3 and has almost all the API options for the Street View Panorama that are available in the API configurable in the widgets xml. A lot of attention has gone into the UI (User Inferface) and UX (User Experience) of this widget and a lot of cross browser testing has been done. Tested on Safari for windows 5.1.7, Internet Explorer 9, Opera 12.15, FireFox 21.0, and Chrome 27.0.1453.110 m.

Configurable features include:

    * hidestreetviewvwidowwhenminimized - This is a true or false value and determines if the graphic on the map and the Google Street View window are hidden when the widget is minimized.
    * width - The width of the popup widow that is opened.
    * height - The height of the popup widow that is opened.
    * apikey - The Google Maps API Key that you must obtain to use this widget.
      https://developers.google.com/maps/documentation/javascript/tutorial#api_key
    * addresscontrol - is a true or false value and determines if the Google Street View Address Control is visible.
      It has an attribute of controlposition that defines where in the popup window the control is placed.
    * clicktogo - is a true or false value and determines if the Google Street View will move to the location clicked.
    * disabledoubleclickzoom - is a true or false value and determines if the Google Street View will zoom into the
      location on the panorama where the user double clicks.
    * imagedatecontrol - is a true or false value and determines if the Google Street View will display the date of the
      panorama image was taken along the bottom of the window with the copyright info.
    * linkscontrol - is a true or false value and determines if the Google Street View will display the movement arrows
      and street names on the panorama for navigation purposes.
    * pancontrol - is a true or false value and determines if the Google Street View pan Control is visible.
      It has an attribute of controlposition that defines where in the popup window the control is placed.
    * zoomcontrol - is a true or false value and determines if the Google Street View zoom Control is visible.
      It has an attribute of controlposition that defines where in the popup window the control is placed and a
      controlstyle attribute that determines the size of the control.
   
    * All text that the widget uses is configurable in the xml to allow for internationalization of the widget.

So here it is: http://www.arcgis.com/home/item.html?id=b4259b1cf73e4fa3b04e7bdf75fee29b

Tags (2)
0 Kudos
153 Replies
RhettZufelt
MVP Frequent Contributor

Hi Robert,

Curious if there is a way to control the initial zoom level of the popup streetview window?

If I drag/drop the little man, it opens the panorama in the streetview window, and I can zoom out 6.5 clicks of the mouse wheel to get the entire extent of the image.

In Google Maps, it is only zoomed in one click of the wheel.

Just wondering if there is a way to control that rather than have to roll the mouse out 7 clicks to see the entire extent of the panorama each time a new streetview is loaded.

Thanks again,


R_

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Rhett,

  There is no configuration build into the widget for this but it is an easy change in the StreetView.html

The property to change is the zoom in this function.

        function showPanoData(panoData, status) {
             try {
                if (status !== google.maps.StreetViewStatus.OK) {
                    myPano && myPano.setVisible(false);
                    window.opener.flexApp.setNoStreetView();
                    return;
                }
                var myLoc = new google.maps.LatLng(streetViewLat, streetViewLon);
                var angle = computeAngle(myLoc, panoData.location.latLng);
                var panoramaOptions = {
                    position: myLoc,
                    pov: {
                        heading: angle,
                        pitch: 0
                    },
                    zoom: 2,
                    imageDateControl: showImgDate,
                    panControl: showPanControl,
                    panControlOptions: {
                        position: pcPosition
                    },
                    addressControl: showAddressControl,
                    addressControlOptions: {
                        position: acPosition
                    },
                    linksControl: showLinkControl,
                    enableCloseButton: false,
                    clickToGo: click2Go,
                    disableDoubleClickZoom: disDoubleClickZoom,
                    zoomControl: showZoomControl,
                    zoomControlOptions: {
                        position: zcPosition,
                        style: zcStyle
                    }
                };
                myPano = new google.maps.StreetViewPanorama(innerpano, panoramaOptions);
                google.maps.event.addListener(myPano, 'position_changed', positionOrpov_changed);
                google.maps.event.addListener(myPano, 'pov_changed', positionOrpov_changed);
                myPano.setVisible(true);
            } catch(e) {
                alert("showPanoData: " + e.message);
            }
        }
RhettZufelt
MVP Frequent Contributor

Hmm, now I kind of feel stupid for not looking there in the first place.  I didn't even think about that being in the html, figured it was in the widget somewhere and without FlashBuilder I'm using the compiled version so was hoping it was configurable.

Thanks again, that did just what I was after.  Too easy


R_

0 Kudos
PetrBlahník
New Contributor II

Hi Robert, is there any suggestion to make this widget working with other world projections instead of Webmercator or WGS84. In new version (3.7) of uncompiled widget, I discover new paramater "datumTranform" which I hope make transformation from local projection to WGS, but I can't make it works. Do you have some advice for this problem? Some people in the past asked about this problem. I need it work with S-JTSK projection (wkid=5514) and "S_JTSK_To_WGS_1984_1" transformation. Thank you for your help. You have great widgets!

Petr

Czech Republic

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Petr,

   I have had no luck using data transformations in this widget. So sorry I do not have any advice on getting this widget to use projections that require a transform.

0 Kudos
TravisYork
New Contributor

Hi Rob,

I am getting this error when I call the API in my pop up window. The image seems to work for around 3-4 seconds and then it goes grey and says

Capture.PNG

Not sure how to go about this.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Travis,

  I am not sure what to tell you as I just tested my live preview site and my own production site that uses the widget, I tested latest Chrome and IE11 and neither sites or browsers had any issue.

0 Kudos
TravisYork
New Contributor

Hi Robert,

Sorry about the fairly vague question. I've narrowed down my problem to the API is "blocking" my requests. How would I go about allowing Google to accepting my "requests". What have you done in this instance?Capture2.PNG

Once again thanks for the speedy reply!

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Travis,

I entered the url of my organization (i.e. http://gis.calhouncounty.org)

0 Kudos
JanieGoddard
Occasional Contributor III

Hi Robert,

  I hope this is in the correct queue. My Google Streetviewer in Flexviewer 3.7 has been in production a long time. Starting the Tuesday after Labor Day 9/6/2016, it now keeps saying I need to enable my Popups in Firefox  Firefox 49.0.1. What is weird is IE still works fine. I have checked my Firefox browser and my popups are enabled. Please see below. Any ideas?

---->

0 Kudos