开发者

GoogleMapAPIv3 Streetview Loaded Event

开发者 https://www.devze.com 2023-02-16 19:02 出处:网络
im creating a website and am using a streetview panorama on it. Now some of my target users may not have the fastest internet available so what i want to do is display a pretty loading screen while th

im creating a website and am using a streetview panorama on it. Now some of my target users may not have the fastest internet available so what i want to do is display a pretty loading screen while the panorama fully loads. however i couldnt find any events that fire once a streetview panorama loads.

Is ther开发者_JS百科e one? or if not, how would i create a faux event that fires when a panorama is fully loaded

Thanks


As noted on this question the StreetView SDK doesn't fire any event when the street view is finished loading.


I do it and it works like a charm. There is actually one way to achieve "loaded" event by using the Streetview service like this:

// Handle loaded-like event
var sv = new google.maps.StreetViewService();
sv.getPanorama({location: camera.eye, radius: 50}, function (data, status) {
    if (status !== 'OK') {
        console.log(`Streetview processSVData status = ${status}`);
        return;
    }
    alert(`Streetview loaded! — processSVData status = ${status}`);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号