【问题标题】:Google Map API Street View controls?谷歌地图 API 街景控件?
【发布时间】:2015-08-18 15:27:18
【问题描述】:

我不知道如何更改/隐藏街景控件in scenario,其中默认情况下有一张地图,您将“小家伙”拖到道路上

这是关于我的选项的一段代码:

    function initMap() {

        var mapOptions = { 
            center: new google.maps.LatLng( <?php echo $latitude . ',' . $longitude; ?>),
            zoom: 12,
            disableDefaultUI: true,
            backgroundColor: 'white',
            streetViewControl: true
            };
// I have markers & other stuff in here, it's properly closed function!

我找到了街景控件的参考仅当它默认为街景时,这是来自 Google Developers 的 code example

function initPano() {
  // Note: constructed panorama objects have visible: true
  // set by default.
  var panorama = new google.maps.StreetViewPanorama(
      document.getElementById('map'), {
        position: {lat: 42.345573, lng: -71.098326},
        addressControlOptions: {
          position: google.maps.ControlPosition.BOTTOM_CENTER
        },
        linksControl: false,
        panControl: false,
        zoomControlOptions: {
          style: google.maps.ZoomControlStyle.SMALL
        },
        enableCloseButton: false
  });
}

如果默认视图是地图并且您可以将街景“人”拖到地图上,如何添加街景 UI 选项?

【问题讨论】:

    标签: javascript api google-street-view


    【解决方案1】:

    看看这个答案,看看它是否有帮助。我认为您需要倾听街景变得可见,然后使用 streetViewControl = false 等隐藏控件。

    Detecting Google Maps streetview mode

    【讨论】:

    • 正是我想要的。保持良好的工作!干杯!
    猜你喜欢
    • 1970-01-01
    • 2015-10-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-04
    • 1970-01-01
    相关资源
    最近更新 更多