구글지도 질문좀드리겠습니다

구글지도 질문좀드리겠습니다

QA

구글지도 질문좀드리겠습니다

본문

안녕하세요 질문좀 드리겠습니다

아래사진보시면 동그라미 부분에 저버튼 부분이요

따로 저부분만 a 링크나 이런걸로 하고싶은데 

저기 버튼 소스 아시는분 계시나요 ㅠㅠ?

 

a63d2c25097624659d3cdb6ff2cd2964_1481520347_3722.PNG
 

이 질문에 댓글 쓰기 :

답변 1

소스를 볼수있는 도메인을 입력해주시면 도움드릴게요~ 

<td><!--지도부분 -->
          <div id="mgmap"></div>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&language=ko®ion=kr&key=AIzaSyBZJaZ4yjdbM6020UjVP78zno0PDplE-ng"></script>  <script type="text/javascript">
  var map;
  var geocoder;
  var marker;
  var ymakerimg = '<?php echo $board_skin_url ?>/img/mapicon001.png';
 
  function mgminfomap(){
  geocoder = new google.maps.Geocoder();
  var latlng = new google.maps.LatLng('<?=$write[wr_3]?>','<?=$write[wr_4]?>'); //초기화면부분

  var mgmapOption = {
  zoom : 16,
  center: latlng,
 
  mapTypeId: google.maps.MapTypeId.ROADMAP
  }
   
  map = new google.maps.Map(document.getElementById('mgmap'), mgmapOption);
 
  marker = new google.maps.Marker({
  position:latlng,
  icon : ymakerimg,
  map:map
  });
 
  // 이동시 좌표와 주소 변경이벤트
  google.maps.event.addListener(map, 'dragend', function(){   
        moveLatlng();
        changeAddress();
    });

  };

// 이동시 좌표구하기 
function moveLatlng(){
    var mll=map.getCenter();
    document.getElementById('wr_3').value = mll.lat();
    document.getElementById('wr_4').value = mll.lng();
addMark(mll.lat(), mll.lng());
}

function changeAddress(){
    geocoder.geocode( { 'location': map.getCenter()}, function(results, status) {
        if (status == google.maps.GeocoderStatus.OK) {
           
            var str="";
            for(var i=3; i>=0; i--){
                str += " "+results[0].address_components[i].short_name;

            }
document.getElementById('wr_1').value=str;
            document.getElementById('wr_2').value=str;

        } 
    });
}
 

  function codeAddress(){
  var address = document.getElementById('wr_1').value;
  // 주소입력안했을때 경고창
  if(address=='검색할 주소를 입력하십시오.' || address==''){
        alert('검색할 주소를 입력하십시오.');
        document.getElementById("wr_1").value='';
        document.getElementById("wr_1").focus();
        return;
    }
 
  geocoder.geocode({'address':address}, function(results, status){
  if(status == google.maps.GeocoderStatus.OK){
  map.setCenter(results[0].geometry.location);
  addMark(results[0].geometry.location.lat(), results[0].geometry.location.lng());
document.getElementById('wr_2').value = results[0].formatted_address;
document.getElementById('wr_3').value = results[0].geometry.location.lat();
document.getElementById('wr_4').value = results[0].geometry.location.lng();


  }
});

  }
  function addMark(lat,lng){ 
    if(typeof marker!='undefined'){ 
        marker.setMap(null); 
    } 
     
    marker = new google.maps.Marker({ 
        map: map,
icon : ymakerimg,
        position: new google.maps.LatLng(lat,lng) 
    });
var infowindow = new google.maps.InfoWindow({
   
  });
 
 
}
function moveMarker(lat, lng){
    marker.setPosition(lat, lng);

}

function mypoint(){
// 나의위치 찾아보기
if (navigator.geolocation) {
                    browserSupportFlag = true;
                    navigator.geolocation.getCurrentPosition(function(position){
                        var initialLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);

// 좌표를 주소로변환
geocoder.geocode({'latLng' : initialLocation}, function(results, status)

{

if (status == google.maps.GeocoderStatus.OK) {

if (results[1]) {

document.getElementById('wr_2').value = results[3].formatted_address;
document.getElementById('wr_1').value = results[3].formatted_address;

}



});

document.getElementById('wr_3').value = position.coords.latitude;
document.getElementById('wr_4').value = position.coords.longitude;

                        map.setCenter(initialLocation);
marker.setPosition(initialLocation);
                    }, function(){
                        handleNoGeolocation(browserSupportFlag);
                    });
                   
                }
                else if (google.gears) {
                        browserSupportFlag = true;
                        var geo = google.gears.factory.create('beta.geolocation');
                        geo.getCurrentPosition(function(position){
                            var initialLocation = new google.maps.LatLng(position.latitude, position.longitude);

// 좌표를 주소로변환
geocoder.geocode({'latLng' : initialLocation}, function(results, status)

{

if (status == google.maps.GeocoderStatus.OK) {

if (results[1]) {

document.getElementById('wr_2').value = results[3].formatted_address;
document.getElementById('wr_1').value = results[3].formatted_address;

}



});

document.getElementById('wr_3').value = position.coords.latitude;
document.getElementById('wr_4').value = position.coords.longitude;

                        map.setCenter(initialLocation);
marker.setPosition(initialLocation);
                    }, function(){
                        handleNoGeolocation(browserSupportFlag);
                    });
                   
                }
                else if (google.gears) {
                        browserSupportFlag = true;
                        var geo = google.gears.factory.create('beta.geolocation');
                        geo.getCurrentPosition(function(position){
                            var initialLocation = new google.maps.LatLng(position.latitude, position.longitude);

// 좌표를 주소로변환
geocoder.geocode({'latLng' : initialLocation}, function(results, status)

{

if (status == google.maps.GeocoderStatus.OK) {

if (results[1]) {

document.getElementById('wr_2').value = results[3].formatted_address;
document.getElementById('wr_1').value = results[3].formatted_address;

}



});

document.getElementById('wr_3').value = position.coords.latitude;
document.getElementById('wr_4').value = position.coords.longitude;

                            map.setCenter(initialLocation);
marker.setPosition(initialLocation);
                        }, function(){
                            handleNoGeoLocation(browserSupportFlag);
                        });
                    // Browser doesn't support Geolocation
                    }
                    else {
                        browserSupportFlag = false;
                        handleNoGeolocation(browserSupportFlag);
                    }
}
 
  google.maps.event.addDomListener(window, 'load', mgminfomap);
  </script>
  <!-- 지도끝 -->

답변을 작성하시기 전에 로그인 해주세요.
전체 123,729 | RSS
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT