gpt4 book ai didi

javascript - 信息窗口内的街景

转载 作者:行者123 更新时间:2023-11-28 14:05:24 25 4
gpt4 key购买 nike

我需要来自 map 窗口的信息,其中包含谷歌街景和文本位置。谁能帮我解决?我正在学习编程,很难独自解决。谢谢(我的代码在下面)

function initialize() {
var pinkParksStyles = [
{
featureType: "all",
stylers: [
{ saturation: -80 }
]
},
{
featureType: "poi.park",
stylers: [
{ hue: "#ff0023" },
{ saturation: 40 }
]
}
];

var pinkMapType = new google.maps.StyledMapType(pinkParksStyles,
{name: "Paul em Floripa"});
var mapOptions = {
zoom: 15,
center: new google.maps.LatLng(-27.619279,-48.527896),
mapTypeControlOptions: {
mapTypeIds: [google.maps.MapTypeId.ROADMAP,'pink_parks','satellite' ]
}
};
var map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);
var marker = new google.maps.Marker({})
var infowindow = new google.maps.InfoWindow();
var locations = [
['Estacionamento 1', -27.627525,-48.52762, 1],
['Estacionamento 2', -27.624374,-48.527786, 2],
['Estacionamento 3', -27.620154,-48.529138, 3],
['Estacionamento 4', -27.616161,-48.529588, 4],
['Estacionamento 5', -27.61393,-48.533349, 5],
['Estacionamento 6', -27.613129,-48.535352, 6],
['Estacionamento 7', -27.612637,-48.530493, 7],
['Estacionamento 8', -27.616962,-48.527746, 8],
];


var marker, i;
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
icon: 'images/stopcar.png',
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
map: map
});

google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
infowindow.setContent(locations[i][0]);
infowindow.open(map, marker);
}
})(marker, i));
}

map.mapTypes.set('pink_parks', pinkMapType);
map.setMapTypeId('pink_parks');
trafficLayer.setMap(map);
}

最佳答案

好的,我猜你想在信息窗口中放置街景的静态图片。如果是这种情况,请查看此链接:https://developers.google.com/maps/documentation/streetview/

具体如何获取特定位置的街景静态图,上面写的很清楚。

关于javascript - 信息窗口内的街景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10017693/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com