0

ストリート ビューを表示している情報ウィンドウと、同じストリート ビューを表示している複数のマーカー。すべてのマーカーでストリートビューを表示するために最後の住所を取得します。

コード:

geocoder.geocode( { 'address': "{!acc.BillingCity}"}, function(results, status) { 
            alert("{!acc.BillingCity}");
   if (status == google.maps.GeocoderStatus.OK) {

        var marker = new google.maps.Marker({
            map: map,
            position: results[0].geometry.location,
            title : 'Click Here!!!' 
        });                    


        google.maps.event.addListener(marker, 'click', function() {
            infowindow.open(map, marker);
        });
        var pano = null;
        google.maps.event.addListener(infowindow, 'domready', function() {
        if (pano != null) {
        pano.unbind("position");
            pano.setVisible(false);
        }
        pano = new google.maps.StreetViewPanorama(document.getElementById("content"), {
        navigationControl: true,
        navigationControlOptions: {
                style: google.maps.NavigationControlStyle.ANDROID
                },
        enableCloseButton: false,
        addressControl: false,
        linksControl: false
        });
        pano.bindTo("position", marker);
            pano.setVisible(true);
        });

         google.maps.event.addListener(infowindow, 'closeclick', function() {
            pano.unbind("position");
            pano.setVisible(false);
            pano = null;
        });

        markerBounds.extend(results[0].geometry.location);
        map.fitBounds(markerBounds);
    }else if(status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT) {
        wait = true;
        setTimeout("wait = true", 2000);        
    } else {
        alert("Geocode was not successful for the following reason: " + status);
    }      
}); 

(StreetViewPanorama)でストリートビューを複数のマーカーで表示する方法。ありがとう

4

0 に答える 0