Google maps 如何在html中的谷歌地图点击事件中从一个pin移动到另一个pin

Google maps 如何在html中的谷歌地图点击事件中从一个pin移动到另一个pin,google-maps,infowindow,Google Maps,Infowindow,我在google map的infoWindows中显示了多个PIN,并且html页面中显示了位置名称,现在当单击任何位置名称将PIN从一个移动到另一个位置时,我需要这个,并显示它的infoWindow。 那么,有什么解决办法吗? 这是我的密码 function initialize() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map_canvas")); map

我在google map的infoWindows中显示了多个PIN,并且html页面中显示了位置名称,现在当单击任何位置名称将PIN从一个移动到另一个位置时,我需要这个,并显示它的infoWindow。
那么,有什么解决办法吗?

这是我的密码

function initialize() {


if (GBrowserIsCompatible()) {
    var map = new GMap2(document.getElementById("map_canvas"));
    map.addControl(new GSmallMapControl());
    map.setCenter(new GLatLng(51.50015, -0.12624), 13);

// Creates a marker at the given point
// Clicking the marker will hide it
var marker = new GMarker(new GLatLng(lat, longt));
    map.addOverlay(marker);
function createMarker(latlng, number) {
  var marker = new GMarker(latlng);
  marker.value = number;
  GEvent.addListener(marker,"click", function() {
    var myHtml =  number + "";
    map.openInfoWindowHtml(latlng, myHtml);
  });
  return marker;
}

// Add 5 markers to the map at random locations
// Note that we don't add the secret message to the marker's instance data
var bounds = map.getBounds();
for (index in markers){
var n=markers[index];
  var latlng = new GLatLng(n.lat,n.lng);
map.addOverlay(createMarker(latlng, n.name));
}
marker.openInfoWindowHtml(WINDOW_HTML); 


 }
}

嘿,我是用谷歌地图库得到的,

请参见演示:

实际上,我需要这样做,我在html页面中显示了位置名称,当单击该名称时,位置的pin显示在带有信息窗口的地图中。我不必在地图中单击,您使用的是哪个版本的谷歌地图v2或v3?