-1
我使用Google Map v3 api工作,並且我已經被搜索過了,我怎樣才能在我的標記中添加一個值。在自定義標記中添加一個值Google Map V3
首先我的數據在數據庫我加載的數據看腳本波紋管
var locations = [
<?php foreach ($results as $val) : $v=addslashes($val["nomst"]) ?>
[<?="'$v'" ?>,<?= $val['Lat'] ?>,<?= $val['Lon'] ?>,<?= $val[$param] ?>],
<?php endforeach; ?>
];
var mapOptions = {
zoom: 4,
center: new google.maps.LatLng(28.975750, 10.669184),
mapTypeId: google.maps.MapTypeId.SATELLITE
}
其次我創建了一個循環加我的標記
var marker, i;
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
icon:'icon.png',
map: map
});
我創建了一個自定義圖標,我在我的文件夾中,我需要的是每個圖標內我需要添加一個值,我在我的位置數組這樣的東西這樣的 locations[i][3]
謝謝