1
我有一張表,其中包含id,名稱,半徑,緯度,&經度列。我想在Google地圖上用不同的圈子標記一些地方。可能嗎?我嘗試使用這種方法:在Google地圖中爲每個標記顯示一個不同的圓圈?
var map = new google.maps.Map(document.getElementById('peta'), options);
var locations = [
<?php while($rs = mysql_fetch_array($a_peta, MYSQL_ASSOC)) { ?>
['<?php echo $rs['nama'] ?>', <?php echo $rs['latitude'] ?>, <?php echo $rs['longitude'] ?>],
<?php } ?>
];
var infowindow = new google.maps.InfoWindow();
var marker, i;
/* kode untuk menampilkan banyak marker */
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
map: map,
icon: 'pics/ico.jpg'
});
var circle = new google.maps.Circle({
map: map,
radius: '<?php echo $rs['radius'] ?>',
fillColor: '#AA0000'
});
circle.bindTo('center', marker, 'position');
但它不起作用。有什麼方法可以在Google地圖中爲每個標記顯示不同的圈子?
你最後一句話正是我想要知道的。我想繪製每個標記不同大小的半徑圓。 什麼樣的技術? –