0

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

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);
}
4

1 回答 1

0

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

确切地写下了如何获取特殊位置的街景静态图片。

于 2012-04-04T19:39:23.600 回答