我查看了api文檔,但找不到太多內容。我堅持要創建使用的代碼可點擊圖標下方顯示的信息的彈出框:如何在google maps api v3中創建可點擊的圖標?
function initialize() {
var myLatLng = new google.maps.LatLng(52.288, 0.78);
var myOptions = {
zoom: 8,
center: myLatLng,
mapTypeId: google.maps.MapTypeId.HYBRID
};
var map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
<?php
$sql_launch = mysql_query("SELECT * FROM pred_route WHERE time = (SELECT MIN(time) FROM pred_route)");
$sql_land = mysql_query("SELECT * FROM pred_route WHERE time = (SELECT MAX(time) FROM pred_route)");
$sql_pop = mysql_query("SELECT * FROM pred_route WHERE alt = (SELECT MAX(alt) FROM pred_route)");
?>
var contentString = '<div id="content">'+
'<div id="siteNotice">'+
'</div>'+
'<h1 id="firstHeading" class="firstHeading">Uluru</h1>'+
'<div id="bodyContent">'+
'<p><b>Uluru</b>, also referred to as <b>Ayers Rock</b>, is a large ' +
'sandstone rock formation in the southern part of the '+
'Northern Territory, central Australia. It lies 335 km (208 mi) '+
'south west of the nearest large town, Alice Springs; 450 km '+
'(280 mi) by road. Kata Tjuta and Uluru are the two major '+
'features of the Uluru - Kata Tjuta National Park. Uluru is '+
'sacred to the Pitjantjatjara and Yankunytjatjara, the '+
'Aboriginal people of the area. It has many springs, waterholes, '+
'rock caves and ancient paintings. Uluru is listed as a World '+
'Heritage Site.</p>'+
'<p>Attribution: Uluru, <a href="http://en.wikipedia.org/w/index.php?title=Uluru&oldid=297882194">'+
'http://en.wikipedia.org/w/index.php?title=Uluru</a> (last visited June 22, 2009).</p>'+
'</div>'+
'</div>';
var infowindow = new google.maps.InfoWindow({
content: contentString
});
var image_balloon = new google.maps.MarkerImage("http://projectstratos.com/images/map/balloon.png",new google.maps.Size(32,37));
var balloon_longlat = new google.maps.LatLng(<?php echo $current['lat'] . ", " . $current['long']; ?>);
var balloon = new google.maps.Marker({
position: balloon_longlat,
map: map,
icon: image_balloon
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,image_balloon);
});
請考慮改善您的問題。目前形式的問題不包含足夠的細節。請閱讀[常見問題](http://stackoverflow.com/faq)和[如何提問](http://stackoverflow.com/questions/how-to-ask)部分,瞭解如何改進問題。你有什麼錯誤,如果有的話?什麼不行? – JohnP
我真的很抱歉,我真的很早就寫了這個,我基本上是指當我點擊標記時,其中一個文本框應該彈出。 – Yesterday