Google지도 API로 작업하고 있습니다. 이지도는 원래 마커가있는 페이지에 있습니다. 사용자가 클릭하면 마커가 세부 정보와 함께 열렸습니다. 또한 사용자는 큰지도 컨트롤을 사용하여 확대/축소 등의 작업을 할 수있었습니다. 마지막으로 사용자는지도보기 가능 영역을 드래그 할 수있었습니다.Google지도 API - 링크로 연결
우리가 시도하는 것은 다음과 같은지도입니다. 1)지도 상에 표시 자 위치가 있지만 더 이상 클릭 할 수 없습니다. 2)지도를 클릭하면 이제 다른지도 페이지에 대한 하이퍼 링크가됩니다.
모든 것이 작동합니다 (지도 위에 마우스를 올려 놓으면 마우스를 링크 위로 가져 가면 손가락이 아닌지도를 드래그해야합니다). 마우스 오버하면지도를 드래그 할 수 있습니다. 그러나 마우스를 놓아 버리면 링크가 활성화되고 새 페이지로 이동합니다.
어떻게이 드래그 기능을 해제하고 커서를 포인터처럼 보이게 할 수 있습니까?
여기 내 코드입니다 :
<script src="http://maps.google.com/maps?file=api&v=2&key=MY KEY IS HERE"
type="text/javascript"></script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
// map.addControl(new GLargeMapControl());
//code to setup the map START
//creating Geocoder object to get geolocation from an address
geocoder.getLatLng("123 Main St, Boston, MA",
function (point)
{
map.setCenter(point,15);
map.addOverlay(createMarker(point,1));
});
//code to setup the map STOP
// Creates a marker at the given point with the given number label
function createMarker(point, number) {
var marker = new GMarker(point);
return marker;
}
}
}
//-->
</script>
그리고 나는 HTML에서지도 전화 여기서 항상 사전에
<a href="http://www.mysite.com">
<div id="map" style="width: 298px;height:150px;"></div>
</a>
감사합니다.
[Google Maps API v2] (https://developers.google.com/maps/documentation/javascript/v2/reference)를 사용 중이므로 더 이상 사용되지 않으며 2013 년 5 월 19 일부터 사용이 중단 될 수 있습니다. 이 API를 사용하는 새로운 개발은 권장되지 않습니다. – geocodezip
아. 괜찮 감사. – Kevin