如何使 Google 地图信息窗口倾斜一定角度?
How can I make a Google Map InfoWindow tilt at a certain angle?
我需要为单个标记制作多个信息 windows。通常它们会重叠。我可以使 google 地图信息 Window 倾斜或以特定角度显示,以便它们可以同时清晰可见吗?
您可以为每个选项使用 Snazzy Info Window plugin. You create 3 SnazzyInfoWindow
objects and set a different 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 一个工作示例。
我需要为单个标记制作多个信息 windows。通常它们会重叠。我可以使 google 地图信息 Window 倾斜或以特定角度显示,以便它们可以同时清晰可见吗?
您可以为每个选项使用 Snazzy Info Window plugin. You create 3 SnazzyInfoWindow
objects and set a different 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 一个工作示例。