diff --git a/public/static/js/map_editor.js b/public/static/js/map_editor.js index b614f8e..9e3a70c 100644 --- a/public/static/js/map_editor.js +++ b/public/static/js/map_editor.js @@ -80,22 +80,16 @@ MapEditor.panorama.setPano(panoLocationData.pano); }, - requestPanoData: function (location, canBeIndoor) { + requestPanoData: function (location) { var sv = new google.maps.StreetViewService(); sv.getPanorama({ location: location, preference: google.maps.StreetViewPreference.NEAREST, radius: MapEditor.map.getSearchRadius(location), - source: canBeIndoor ? google.maps.StreetViewSource.DEFAULT : google.maps.StreetViewSource.OUTDOOR }, function (data, status) { var panoLocationData = status === google.maps.StreetViewStatus.OK ? data.location : null; - if (panoLocationData === null && !canBeIndoor) { - MapEditor.requestPanoData(location, true); - return; - } - document.getElementById('loading').style.visibility = 'hidden'; MapEditor.loadPanoForNewPlace(panoLocationData); diff --git a/src/PersistentData/Model/Place.php b/src/PersistentData/Model/Place.php index 6a3b029..1930ae2 100644 --- a/src/PersistentData/Model/Place.php +++ b/src/PersistentData/Model/Place.php @@ -140,7 +140,7 @@ class Place extends Model return $this->pov->getZoom(); } - public function getFreshPanoId(bool $canBeIndoor = false): ?string + public function getFreshPanoId(): ?string { if ( $this->panoIdCachedTimestamp !== null && @@ -152,19 +152,13 @@ class Place extends Model $request = new Request('https://maps.googleapis.com/maps/api/streetview/metadata', Request::HTTP_GET); $request->setQuery([ 'key' => $_ENV['GOOGLE_MAPS_SERVER_API_KEY'], - 'location' => $this->position->getLat() . ',' . $this->position->getLng(), - 'source' => $canBeIndoor ? 'default' : 'outdoor' + 'location' => $this->position->getLat() . ',' . $this->position->getLng() ]); $response = $request->send(); $panoData = json_decode($response->getBody(), true); $panoId = $panoData['status'] === 'OK' ? $panoData['pano_id'] : null; - // enable indoor panos if no outdoor found - if ($panoId === null && !$canBeIndoor) { - return $this->getFreshPanoId(true); - } - $this->panoIdCached = $panoId; $this->panoIdCachedTimestamp = new DateTime();