Merge pull request 'reverted removal of preference for outdoor panorama in the front end' (#43) from feature/preference-for-outdoor-panorama-in-the-frontend into develop
All checks were successful
default-pipeline default-pipeline #195

Reviewed-on: https://gitea.e5tv.hu/esoko/mapguesser/pulls/43
Reviewed-by: Pőcze Bence <bence@pocze.ch>
This commit is contained in:
Bence Pőcze 2021-05-09 13:34:36 +02:00
commit 94624d5b2c

View File

@ -80,16 +80,22 @@
MapEditor.panorama.setPano(panoLocationData.pano); MapEditor.panorama.setPano(panoLocationData.pano);
}, },
requestPanoData: function (location) { requestPanoData: function (location, canBeIndoor) {
var sv = new google.maps.StreetViewService(); var sv = new google.maps.StreetViewService();
sv.getPanorama({ sv.getPanorama({
location: location, location: location,
preference: google.maps.StreetViewPreference.NEAREST, preference: google.maps.StreetViewPreference.NEAREST,
radius: MapEditor.map.getSearchRadius(location), radius: MapEditor.map.getSearchRadius(location),
source: canBeIndoor ? google.maps.StreetViewSource.DEFAULT : google.maps.StreetViewSource.OUTDOOR
}, function (data, status) { }, function (data, status) {
var panoLocationData = status === google.maps.StreetViewStatus.OK ? data.location : null; 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'; document.getElementById('loading').style.visibility = 'hidden';
MapEditor.loadPanoForNewPlace(panoLocationData); MapEditor.loadPanoForNewPlace(panoLocationData);