0
Google지도를 드래그 할 수있는 마커로 만듭니다. 마커를 만든 후에 어떻게 나중에 위치를 변경할 수 있습니까? 이 경우 setposition(latlng)
을 사용할 수 있습니까? 그렇다면 어떻게?Google지도 3에서 마커 위치를 변경 하시겠습니까?
function showm(la,lo) {
$('#gmap').hide();
alert(lo);
$('#gmap').gmap3({
marker:{
latLng: [la,lo],
options:{
draggable:true
},
events:{
dragend: function(marker){
$(this).gmap3({
getaddress:{
latLng:marker.getPosition(),
callback:function(results){
alert(marker.getPosition().lat());
var map = $(this).gmap3("get"),
infowindow = $(this).gmap3({get:"infowindow"}),
content = results && results[1] ? results[0].formatted_address : "no address";
if (infowindow){
infowindow.open(map, marker);
infowindow.setContent(content);
} else {
$(this).gmap3({
infowindow:{
anchor:marker,
options:{content: content}
}
});
}
}
}
});
}
}
},
map:{
options:{
zoom: 12
}
}
});
$('#gmap').show();
}