Select to view content in your preferred language

An issue about showing only outdoor street view panorama in my custom Google Streetview widget

217
1
01-19-2024 09:28 AM
SailiTang_HW
New Contributor III

Hi,

We developed a custom Google Streetview widget for one of our web appBuilder applications and it is working well. The one issue is that the street view of some places are showing indoor panorama. We would like it to show outdoor / Google official panorama only, so I added a parameter "sources: ['outdoor', 'google']" into "service.getPanorama" below, but nothing happened. There were no errors but indoor panorama still showed. I also tried to add the "sources" parameter into a demo https://jsfiddle.net/geocodezip/bme4mzLv/  and it worked. I tried many different ways in my code below but none of them worked and indoor  panorama still showed. I am wondering if ESRI dojo framwork is limitating its working? Is there anyone that had the same issue?

function checkForSVpano(lat, lon, showAC, showPC, showZC, showID, pcPos, acPos, clkToGo, disDblClkZoom, zcPos,
      zcStyl, showLC, heading) {
      try {
        streetViewLat = lat;
        streetViewLon = lon;
        showAddressControl = getBoolean(showAC);
        showPanControl = getBoolean(showPC);
        showZoomControl = getBoolean(showZC);
        showImgDate = getBoolean(showID);
        pcPosition = getCtrlPosition(pcPos);
        acPosition = getCtrlPosition(acPos);
        zcPosition = getCtrlPosition(zcPos);
        zcStyle = getCtrlStyle(zcStyl);
        disDoubleClickZoom = getBoolean(disDblClkZoom);
        click2Go = getBoolean(clkToGo);  
        showLinkControl = getBoolean(showLC);
        svmHeading = heading;
        var myLoc = new google.maps.LatLng(lat, lon);
        var service = new google.maps.StreetViewService();
        service.getPanorama({location: myLoc, radius: 50, sources: ['outdoor', 'google']}, showPanoData);
      } catch (e) {
        alert("checkForSVpano: " + e.message);
      }
    }

Thanks,

Saili

0 Kudos
1 Reply
JeffreyThompson2
MVP Regular Contributor

Not strictly an answer to your question, but you should be aware that using StreetView on an ESRI map is a violation of Google's Terms of Service.

https://community.esri.com/t5/esri-young-professionals-network-blog/from-missing-beats-to-mapping-st...

GIS Developer
City of Arlington, Texas