나는 대부분의 Google지도에서 마커 아이콘을 검색 주소창으로 드래그하여 아이콘 .png 파일 자체를 보거나 다운로드 할 수 없다는 것을 알고 있습니다. 오히려 커서를 마커 위로 가져 가면 javascript : void (0)를 볼 수 있습니다.Google지도에서 마커 아이콘을 드래그하지 않도록 설정하는 방법은 무엇인가요?
어떻게 이루어 집니까? 감사!
나는 대부분의 Google지도에서 마커 아이콘을 검색 주소창으로 드래그하여 아이콘 .png 파일 자체를 보거나 다운로드 할 수 없다는 것을 알고 있습니다. 오히려 커서를 마커 위로 가져 가면 javascript : void (0)를 볼 수 있습니다.Google지도에서 마커 아이콘을 드래그하지 않도록 설정하는 방법은 무엇인가요?
어떻게 이루어 집니까? 감사!
v3 API의 마커는 주소 표시 줄로 드래그 할 수 없지만 v2 API의 마커는 표시 될 수 있습니다.
다음 v3 예에서는 마커가 이동하지 않습니다 (Firefox 및 Chrome에서 테스트 됨).
가<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Google Maps API No Marker Dragging v3</title>
<script src="http://maps.google.com/maps/api/js?sensor=false"
type="text/javascript"></script>
</head>
<body>
<div id="map" style="width: 500px; height: 400px;"></div>
<script type="text/javascript">
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 2,
center: new google.maps.LatLng(35.00, -25.00),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
new google.maps.Marker({
position: map.getCenter(),
map: map
});
</script>
</body>
</html>
스크린 : 한편
Google Maps API No Marker Dragging v3 http://img339.imageshack.us/img339/570/nodrag.jpg
에서, V2의 API를 사용하여 동일한 예에서, 마커 주소창으로 드래그 할 수 있도록 또한 상태 바에 javascript:void(0)
를 도시 :
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Google Maps API No Marker Dragging v2</title>
<script src="http://maps.google.com/maps?file=api&v=2&sensor=false"
type="text/javascript"></script>
</head>
<body onunload="GUnload()">
<div id="map" style="width: 500px; height: 400px;"></div>
<script type="text/javascript">
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(35.00, -25.00), 2);
map.addOverlay(new GMarker(map.getCenter()));
</script>
</body>
</html>
스크린 샷 :
@Lawrence : 감사합니다. :) –
http://code.google.com/intl/es-ES/apis/maps/documentation/javascript/basics.html – Ben