Compare commits
No commits in common. "cc24f96395909f9f7754b65a1693b25ff38a4189" and "398204c5d5d2e05d2194c1f7c878b345c7b426ad" have entirely different histories.
cc24f96395
...
398204c5d5
@ -86,7 +86,7 @@
|
|||||||
sv.getPanorama({
|
sv.getPanorama({
|
||||||
location: location,
|
location: location,
|
||||||
preference: google.maps.StreetViewPreference.NEAREST,
|
preference: google.maps.StreetViewPreference.NEAREST,
|
||||||
radius: MapEditor.map.getSearchRadius(location),
|
radius: 100,
|
||||||
source: canBeIndoor ? google.maps.StreetViewSource.DEFAULT : google.maps.StreetViewSource.OUTDOOR
|
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;
|
||||||
@ -473,11 +473,7 @@
|
|||||||
LMapWrapper.markers.removeLayer(marker);
|
LMapWrapper.markers.removeLayer(marker);
|
||||||
},
|
},
|
||||||
|
|
||||||
toggleStreetViewCover: function () { },
|
toggleStreetViewCover: function () { }
|
||||||
|
|
||||||
getSearchRadius: function (location) {
|
|
||||||
return 100;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var GMapWrapper = {
|
var GMapWrapper = {
|
||||||
@ -630,20 +626,6 @@
|
|||||||
GMapWrapper.streetViewCover.setMap(GMapWrapper.map);
|
GMapWrapper.streetViewCover.setMap(GMapWrapper.map);
|
||||||
GMapWrapper.streetViewCoverOn = true;
|
GMapWrapper.streetViewCoverOn = true;
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
getSearchRadius: function (location) {
|
|
||||||
// source: https://www.yorku.ca/mack/CHI01.htm
|
|
||||||
var movementOffset = 4;
|
|
||||||
|
|
||||||
// source: https://groups.google.com/g/google-maps-js-api-v3/c/hDRO4oHVSeM/m/osOYQYXg2oUJ?pli=1
|
|
||||||
var metersPerPixel = 156543.03392 * Math.cos(location.lat * Math.PI / 180) / Math.pow(2, GMapWrapper.map.getZoom());
|
|
||||||
|
|
||||||
var minSearchRadius = 5;
|
|
||||||
|
|
||||||
var searchRadius = Math.max(minSearchRadius, Math.round(movementOffset * metersPerPixel));
|
|
||||||
|
|
||||||
return searchRadius;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user