PHuls-esristaff

Using Street View Applications with ArcGIS

Blog Post created by PHuls-esristaff Employee on Jul 16, 2019

For a variety of planning, engineering, or inspection workflows, you may want to leverage street view applications with ArcGIS in lieu of, or before sending someone to the field.  There are many options for integrating street view with ArcGIS.  In this blog we'll outline the options for using Esri Partner solutions as well as options for linking to Bing and Google within an ArcGIS web map pop-up.

 

Esri Partners

Esri has partners which offer integrated street view solutions with ArcGIS.  These street view solutions can be used directly in ArcGIS Enterprise/Online, ArcGIS Pro, or Web AppBuilder for ArcGIS. 

 

Cyclomedia - The Street SmartTM Widget for ArcGIS introduces high resolution street-level imagery to Web Apps that you build with the Web AppBuilder.

 

Mapillary -  With the Mapillary widget for ArcGIS, you can bring Mapillary's street-level imagery into custom web applications built with Web AppBuilder. 

 

GeoCam - 3D urban modeling for microwave line of sign analysis, macro/small cell RF propagation modeling, and road-based aerial fiber mapping.

 

Feature Pop-up Street View Hyperlinks

Using Arcade within feature pop-ups in a web map, you can dynamically build a URL hyperlink that will pass a map features coordinates to Google's Street View or Bing's StreetSide to automatically open up street view in a new browser tab and zoom you to a location. Here is how:

 

First, configure a pop-up for a feature layer in your web map and Add an attribute expression.

 

 

Second, use the following Arcade expression to create your hyperlink.

var PointGeometry = Centroid(Geometry($feature));

var ArcadeX = PointGeometry.x;
var ArcadeY = PointGeometry.y;
var ArcadeSr = PointGeometry.spatialReference.wkid;
var Latitude, Longitude;

function AuxSphereToLatLon(x, y) {
  Console("Converting...");
  // Conversion based on http://dotnetfollower.com/wordpress/2011/07/javascript-how-to-convert-mercator-sphere-coordinates-to-latitude-and-longitude/
  var rMajor = 6378137;
  var shift = PI * rMajor;
  Longitude = x / shift * 180.0;
  Latitude = y / shift * 180.0;
  Latitude = 180 / PI * (2 * Atan(Exp(Latitude * PI / 180.0)) - PI / 2.0);
}

if (ArcadeSr == 4326) {
  Console("4326 Spatial Reference - No Conversion Necessary");
  Latitude = ArcadeY;
  Longitude = ArcadeX;
} else if (ArcadeSr == 102100) {
  Console("102100 Spatial Reference - Conversion Necessary");
  AuxSphereToLatLon(ArcadeX, ArcadeY);
} else {
  Console(ArcadeSr + " Spatial Reference is not supported - currently works with Web Maps where the basemap is in WGS84 (4326) or Web Mercator Auxiliary Sphere 102100");
}

var url = "https://www.bing.com/maps?&style=x&cp=" + text(Latitude) + "~" + text(Longitude);
return url;

 

Let's break down the expression. The first section grabs the X and Y coordinates and the spatial reference from the feature's Geometry and stores them as variables.  Since these features are Lines, we'll grab the Centroid of the line $feature as the location we zoom to in street view.

var PointGeometry = Centroid(Geometry($feature));

var ArcadeX = PointGeometry.x;
var ArcadeY = PointGeometry.y;
var ArcadeSr = PointGeometry.spatialReference.wkid;
var Latitude, Longitude;

 

Then we'll check the spatial reference system of the web map to see if the coordinates need converting to Lat and Long for use by Google or Bing. If the web map is in Web Mercator (102100) then the coordinates will be converted to Lat and Long.  If the web map is in WGS84 (4326) then no conversion necessary since the feature coordinates will already be in Lat and Long. 

 

function AuxSphereToLatLon(x, y) {
  Console("Converting...");
  // Conversion based on http://dotnetfollower.com/wordpress/2011/07/javascript-how-to-convert-mercator-sphere-coordinates-to-latitude-and-longitude/
  var rMajor = 6378137;
  var shift = PI * rMajor;
  Longitude = x / shift * 180.0;
  Latitude = y / shift * 180.0;
  Latitude = 180 / PI * (2 * Atan(Exp(Latitude * PI / 180.0)) - PI / 2.0);
}

if (ArcadeSr == 4326) {
  Console("4326 Spatial Reference - No Conversion Necessary");
  Latitude = ArcadeY;
  Longitude = ArcadeX;
} else if (ArcadeSr == 102100) {
  Console("102100 Spatial Reference - Conversion Necessary");
  AuxSphereToLatLon(ArcadeX, ArcadeY);
} else {
  Console(ArcadeSr + " Spatial Reference is not supported - currently works with Web Maps where the basemap is in WGS84 (4326) or Web Mercator Auxiliary Sphere 102100");
}

 

And finally, we'll build the URL and return it as a hyperlink.  For Google, use the following syntax:

var url = "http://maps.google.com/maps?q=&layer=c&cbll=" + text(Latitude) + "," + text(Longitude);
return url;

 

And for Bing, use the following syntax:

var url = "https://www.bing.com/maps?&style=x&cp=" + text(Latitude) + "~" + text(Longitude);
return url;

 

Once you have your Arcade expression built, the X and Y geometry of the feature will be added to the street view URL.

The URL will come through as a hyperlink in your web map pop-up.

 

 

Patrick Huls

Solution Engineer Team Lead - Telecommunications

LinkedIn: Patrick Huls| Twitter: @SpatialNinja| GeoNet:Phuls-esristaff

Outcomes