code: function(map, latlng) {
      latlng = latlng || map.getCenter();
      var deferred = $q.defer();
      var svs = new google.maps.StreetViewService();
      svs.getPanoramaByLocation( (latlng||map.getCenter), 100,
        function (data, status) {
          // if streetView available
          if (status === google.maps.StreetViewStatus.OK) {
            deferred.resolve(data.location.pano);
          } else {
            // no street view available in this range, or some error occurred
            deferred.resolve(false);
            //deferred.reject('Geocoder failed due to: '+ status);
          }
        }
      );
      return deferred.promise;
    }
docs: Retrieves panorama id from the given map (and or position)
  @memberof StreetView
  @param {map} map Google map instance
  @param {LatLng} latlng Google LatLng instance
  default: the center of the map
  @example
  StreetView.getPanorama(map).then(function(panoId) {
  $scope.panoId = panoId;
  });
  @returns {HttpPromise} Future object