// The following code (javascript) allows to retrieve the coordinates of the nearest Google Street View image available // for a point ptA created with coordinates (48.51459204,1.470516232). // This code is based on the services provided by the google map API V3 and uses streetViewService API. // for detailed documentation // Visit https://developers.google.com/maps/documentation/javascript/reference#DirectionsRoute var ptA = new google.maps.LatLng (48.51459204,1.470516232); var STREETVIEW_MAX_DISTANCE = 1000; // max radius to search with var streetViewService = new google.maps.StreetViewService(); streetViewService.getPanoramaByLocation(ptA, STREETVIEW_MAX_DISTANCE, function (streetViewPanoramaData, status) { if (status === google.maps.StreetViewStatus.OK) { // OK : something is found // The object streetViewPanoramaData.location.latLng contains the coordinates // of the closest Google Street View image available located on a road covered in the Google Street View database. var point = streetViewPanoramaData.location.latLng; } else { // no street view available in this range, or some error occurred. alert('Street View Not Available'); } });