我需要来自地图窗口的信息,其中包含谷歌街景和文本位置。谁能帮我解决?我正在学习编程,很难单独解决。谢谢(下面是我的代码)
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);
}