0
MYSQL 데이터베이스에서 여러 마커를 가져 와서이 형식으로 값을 HTML 형식의 값으로 입력 한 다음 나는 사용자가 해당 마커를 드래그하여 새로운를 업데이트 할 수 있도록 사용자가 마커의 드래그 속성을 전환 할 수 있도록 HTML 폼에 버튼을 추가하고 싶습니다 지금Google지도 v3 SQL 데이터베이스에서 가져온 마커의 draggable 속성을 전환하십시오
function initialize()
{
map = new google.maps.Map(document.getElementById("map"),
{
center: new google.maps.LatLng(25.230828, 118.041382),
zoom: 4,
mapTypeControl: true
});
<? //PHP PART
// Do a mysql_query
$sql = mysql_query("SELECT * from temple");
if(mysql_num_rows($sql))
{
// get values from mysql_query and add on to map
while ($row = mysql_fetch_array($sql))
{
$id = $row['id'];
$rom_name=$row['rom_name'];
$chi_name=$row['chi_name'];
$lat=$row['lat'];
$lon=$row['lon'];
$html = '<div id="form_container" style="margin:0px;border:0px solid red;Width:521px;height:330px;">'.
'<form name="edit_existing" action="phpedit.php" method = "POST" enctype="multipart/form-data">'.
'<input type="hidden" style="display:none" name="update_id" value ="'.$id.'"/>'.
'<input type="text" name="update_chi_name" value ="'.$chi_name.'"/></td>'.
'<table class="form_table" bgcolor="#FFFFFF" style="font-size: 0.90em; border:none 0px #cacaca; margin-bottom:0">'.
'<td style="padding:4px 0px 2px 0px"><input type="text" name="update_rom_name" value ="'.$rom_name.'"/></td>'.
'<input style="margin-left:8px;float:right" type="submit" name="delete_data" onclick="confirm_delete()" value="Delete this data"/>'. '</form>'.
'</div>';
echo ("addMarker($lat, $lon, '$chi_name', '$html');\n");
}
}
?>
}
//ADD MARKER TO THE MAP
function addMarker(lat, lng, name, info)
{
var pt = new google.maps.LatLng(lat, lng);
bounds.extend(pt);
var marker = new MarkerWithLabel // using MarkerWithLabel utility library
({
icon:icon,
position: pt,
draggable: false,
raiseOnDrag: true,
map: map,
labelContent: name,
labelAnchor: new google.maps.Point(22, 28),
labelClass: "labels", // the CSS class for the label
labelStyle: {opacity: 1},
});
var popup = new google.maps.InfoWindow
({
maxWidth: 800
});
google.maps.event.addListener(marker, "click", function()
{
popup.setContent(info);
});
}
: addmarker 기능은 마커를 만들 수 있습니다 직책을 제출함으로써 어떻게해야합니까?
감사합니다.