좌표&새주소 검색페이지(로드뷰 표시) > 그누4 팁자료실

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!

그누4 팁자료실

그누보드4와 관련된 팁을 여러분들과 함께 공유하세요.
나누면 즐거움이 커집니다.

좌표&새주소 검색페이지(로드뷰 표시) 정보

좌표&새주소 검색페이지(로드뷰 표시)

본문

Daum API 를 활용한 좌표, 새주소 검색페이지 입니다.

소스 바로 뿌리구요~알아서 쓰실분만 쓰시고 질문은 사절입니다~^^

$apikey = "api코드 넣기";  => 요부분만 넣고 실행시키면 바로 됩니다~

http://www.shotbirdie.com/contents/shotbirdie_coordinate.php


--------------------------------------------------------------------------
<?
$g4_path = ".";
include_once("$g4_path/common.php");
include_once("$g4[path]/lib/mw.builder.lib.php");

if($coordinatesh == 'ok'){
$g4[title] = "자료실 > 좌표&새주소 검색 : $_GET[coordinate]";
}else{
$g4[title] = "자료실 > 좌표&새주소 검색";
}

// http://www.shotbirdie.com/contents/shotbirdie_coordinate.php

@include_once("$g4[path]/head.php");

?>

<style>
.small3 { font-size:8pt; color:#FF3300; font-family:돋움; letter-spacing: -1px; line-height:180%}
.search_txt {color:#ffffff;}
</style>


</head>


<?
//상단메뉴
@include "./shotbirdie_search_top.php";
?>

<script type="text/javascript" language=JavaScript>
var bReset = true;
function chkReset(f)
{
    if (bReset) { if ( f.coordinate.value == '주소기입시 번지까지만 입력' ) f.coordinate.value = ''; bReset = false; }
}
</script>

<!--상단검색-->
<table width="730"  border="0" align="center" cellpadding="0" cellspacing="0">
                              <tr>
                                <td width="29"><img src="http://www.shotbirdie.com/contents/images/cdn/shotbirdie/search_left.gif" width="29" height="79"></td>
                                <td valign="top" background="http://www.shotbirdie.com/contents/images/cdn/shotbirdie/search_bodybg.gif"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                      <td height="40"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                                          <tr>
                                            <td width="3" height="6"></td>
                                            <td height="6"></td>
                                          </tr>
                                          <tr>
                                            <td>&nbsp;</td>
                                            <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                                                <tr>
                                                  <td width="500" class="search_txt">좌표&새주소 검색 (주소기입시 번지까지만 입력해주세요)</td>
                                                  <td class="search_txt"><div align="right"></div></td>
                                                </tr>
                                            </table></td>
                                          </tr>
                                      </table></td>
                                    </tr>
                                    <tr>
                                      <td height="39"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
<form type="get" action="<?=$PHP_SELF?>" action="javascript:fsearchbox_submit(document.fsearchbox);">
                                            <tr>
                                              <td>
<?
if($_GET[coordinate]){
$shvalue = $_GET[coordinate];
}else{
$shvalue = "주소기입시 번지까지만 입력";
}
?>
  <input name='coordinate' maxlength=30 itemname="좌표&새주소 검색" value="<?=$shvalue?>" required style="width:620; height:22px;" onFocus="this.value=''" onMouseOver='chkReset(this.form);'>
  <input type='hidden' name='coordinatesh' value='ok'>
  </td>
                                              <td width="60"><div align="right">
                                                  <input name="image" type=image src="http://www.shotbirdie.com/contents/images/cdn/shotbirdie/search_bt.gif" align=absmiddle  width="49" height="21" border=0>
                                              </div></td>
                                            </tr>
                                        </form>

                                      </table></td>
                                    </tr>
                                </table></td>
                                <td width="20"><img src="http://www.shotbirdie.com/contents/images/cdn/shotbirdie/search_right.gif" width="20" height="79"></td>
                              </tr>
</table>

<?
//echo "$latlng[0] - $latlng[1]";
$apikey = "api코드 넣기";
$url = "http://apis.daum.net/local/geo/addr2coord?apikey=$apikey&q=$_GET[coordinate]&output=xml";

$xml = simplexml_load_file("$url");
$lng = $xml->item->{'lng'};
$lat = $xml->item->{'lat'};
$newAddress = $xml->item->{'newAddress'};
$title = $xml->item->{'title'};

if($lng){
echo "<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*좌표 : lng - $lng / lat - $lat<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*새주소 : $title<br><br>";
?>

<table width="730" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>
<!--로드뷰-->
<iframe src="./shotbirdie_IP_sh_iframe1.php?latlng0=<?=$lat?>&latlng1=<?=$lng?>" frameborder="0" border="0" width="730" height="460" scrolling="no"></iframe></td>
  </tr>
</table>


<?
} //end if($lng){

@include_once("$g4[path]/tail.php");
?>
추천
2

댓글 1개

전체 3,313 |RSS
그누4 팁자료실 내용 검색

회원로그인

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