【问题标题】:How can I make a Google Map InfoWindow tilt at a certain angle?如何使 Google Map InfoWindow 倾斜某个角度?
【发布时间】:2018-04-01 09:25:59
【问题描述】:

我需要为单个标记创建多个信息窗口。通常它们会重叠。我可以使谷歌地图信息窗口像倾斜或以某个角度一样,以便它们可以一次清晰地看到吗?

【问题讨论】:

    标签: javascript google-maps google-maps-api-3 angular5 infowindow


    【解决方案1】:

    您可以使用Snazzy Info Window plugin。您创建 3 个SnazzyInfoWindow 对象并为每个对象设置不同的placement 选项。

    例子:

    var infoWindowData = [
      { content: 'Info Window 1', placement: 'top'},
      { content: 'Info Window 2', placement: 'right'},
      { content: 'Info Window 3', placement: 'bottom',}
    ];
    
    var marker = new google.maps.Marker({
      map: map,
      position: { lat: 40, lng: 20 }
    })
    
    // Loop through the data and create a SnazzyInfoWindow for each item in the array
    infoWindowData.forEach(function(entry) {
      var infoWindow = new SnazzyInfoWindow({
        marker: marker,
        content: entry.content,
        placement: entry.placement,
      });
      infoWindow.open();
    })
    

    这是a JSBin 的一个工作示例。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-02-03
      • 1970-01-01
      • 2013-03-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-17
      • 2017-05-18
      相关资源
      最近更新 更多