English 中文(简体)
检查站 谷歌地图
原标题:Check StreetView availability with Google Maps JavaScript API V3

我用谷歌地图 Java普朗普朗文V3显示一个定期的googlemap和一个街口。 当地图的位置发生变化时,它用“街日”号(Panorama.setPosition)来说明街道情况。

然而,当我把地图绘制到没有街道口号的地方时,街道观图像在最后地点停留。 它的“政治”方法与主地图相同。

我怎么能告诉我,我是否已经迁到街区。 观点是没有的?

问题回答

我找到了答案,如果不是

每一次移动后,使用街电学服务,在N meters内获得最接近的帕诺马。 根据这一规定,你可以停留在你身处、移动或固定地点。

我使用旗帜和固定时间来防止许多不必要电话进入Panorama。 类似情况:

var check_availability_lock = false;
var check_availability = function() {
    if (check_availability_lock) {
        return;
    }
    check_availability_lock = true;
    var availability_cb = function(data, status) {
        check_availability_lock = false;
        // console.log("status = ", status);
        if (status !==  OK ) {
            map.setVisible(false);
        }
        else {
            map.setVisible(true);
        }
    }
    setTimeout(function(){
        var latlng = map.getPosition();
        svc.getPanoramaByLocation(latlng, 50, availability_cb);
    }, 2000);
};




相关问题
Why do I get "map.set_center is not a function"?

This code have been working until I updated last night. The code works perfectly on my localhost, but I get an error on my test server. The error message (from Firebug) is "map.set_center is not a ...

The state of GMaps v3

I m about to start a Google map based project and am wondering if the release version of GMaps v3 has most of the features that are available in v2, or if it would be best to stick with v2 for now. Is ...

Bouncy marker in Google Maps v3

In Google Maps API v2 we can set to marker an option bouncy:true. It adds to marker eye-candy ability - after dragging this marker, it is bouncing. Is it possible to do in API v3 ?

GUnload() a single Google Map

I ve got some Javascript/HTML code which displays a variable number of maps dependent on what the user selects. I ve worked how to dynamically create multiple maps on a page - that s well documented. ...

How to change Gmap markers color?

I ve a custom google map with different points: Markers[0] = new Array(new GMarker(new GLatLng(45.0, 9.0)), "Location1", "<strong>Address Line</strong><br/>Some information"); ...

热门标签