구글맵을 불러오는 코드~! > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

구글맵을 불러오는 코드~! 정보

구글맵을 불러오는 코드~!

본문

부동산스킨을 써서 하고있는대요~
좌표를 저장하고 wr_1필드에 사용을 저장하면 맵이 보여지게되는데요
어디어디가있어야나오는지모르겠어요.

지도를 나타내는 부분만따고싶은데 ..ㅠ




<table width="<?=$width?>" align="center"border="0"cellpadding="0" cellspacing="0" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><tr><td>
<table width="790" border="0"cellpadding="0" cellspacing="0" leftmargin="0"  topmargin="0" marginwidth="0" marginheight="0">
<tr><td >
<table border=0 cellpadding=0 cellspacing=3 align=left width=480 height=400 bgcolor=#ffffff style='border:2px solid green'>
<tr><td>
<table border="0" cellpadding="0" cellspacing="0"><tr><td height="9" colspan="3"></td></tr>
<tr><td height="152" width="480">
<script language="JavaScript">
<!--
function OpenWin(url,intWidth,intHeight){
window.open(url, "ReadSlideShow", "scrollbars=no, resizable=no, width="+intWidth+",height="+intHeight+",left=50,top=50 ");return;
}
//-->
</script>




<td ><span id = "maemul_picture" style="display:none" style="width:480px; height:380px">             
<div id=fadein_content style='width:480px; height:380px; position:relative;' onClick="OpenWin('<?=$board_skin_path?>/pop.php?bo_table=<?=$bo_table?>&wr_id=<?=$wr_id?>',900,540); return false;"></div></td></tr></table></div>
<script language='javascript'>
var array_image = new Array();
</script>
</span>


 <div style='float:left; position:relative; width:<?=$td_width*$ViewRows?>px; height:<?=$td_height?>px; overflow:hidden;'>
  <div id=image_layer style='position:absolute; left:0;'>
<table id=image_content cellpadding=0 cellspacing=0 border=0><tr>
 <? // 파일 출력
  for ($i = 0; $i < count( $file ); $i++ )
    if(preg_match("/\.(swf|wmv|asf|flv)$/i", $view[file][$i][source]) && !$gsg_view[12]) {
        //if (substr($view[file][$i][source], -3) == "swf") { //플래시
   
   
        //저장 파일명
        $sql = " select bf_source, bf_file from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '$i' ";
        $file = sql_fetch($sql);
        $filepath = "$g4[path]/data/file/$bo_table/$file[bf_file]";

        //구분자
        $gsg_f_content = explode("|",$view[file][$i][content]);
        $gsg_f_content[0] = strtolower($gsg_f_content[0]); //소문자
        $gsg_f_size = explode("x",$gsg_f_content[0]);

        //사이즈
        if ($gsg_f_size[0]) { $gsg_f_size[0] = $gsg_f_size[0]; } else { $gsg_f_size[0] = "480"; }
        if ($gsg_f_size[1]) { $gsg_f_size[1] = $gsg_f_size[1]; } else { $gsg_f_size[1] = "375"; }

        if (!$gsg_view[14]) { $img_line_box = "style='border:1px solid #2012-03-19;'"; } //이미지 박스 유/무
     
     


    /* 이미지 파일 */
    } else {
                   

  $original_file = $file[$i][path]."/".$file[$i][file];

                    $thumb_file = $file[$i][path]."/thumb_".$file[$i][file];

                    if ( ! file_exists( $thumb_file ) ) // 썸네일 시작
                    {
$file = $data_path.'/'.$filename; //원본
     
                      list( $img_width, $img_height, $type ) = @getimagesize( $original_file );

                      if ( $type == 1 ) $img_sour = imagecreatefromgif( $original_file );
                      else if ( $type == 2 ) $img_sour = imagecreatefromjpeg( $original_file );
                      else if ( $type == 3 ) $img_sour = imagecreatefrompng( $original_file );

                      else return false;

                      if ( $img_width > $img_height )
                      {
                          $width = round( $reheight * $img_width / $img_height );
                          $height = $reheight;
                      }
                      else
                      {
                          $width = $rewidth;
                          $height = round( $rewidth * $img_height / $img_width );
                      }

                      if ( $width < $rewidth )
                      {
                          $width = round( ( $height + $rewidth - $width ) * $img_width / $img_height );
                          $height = round( ( $width + $rewidth - $width ) * $img_height / $img_width );
                      }
                      else if ($height < $reheight)
                      {
                          $height = round( ( $width + $reheight - $height ) * $img_height / $img_width );
                          $width = round( ( $height + $reheight - $height ) * $img_width / $img_height );
                      }

                      $x_last = round( ( $width - $rewidth ) / 2 );
                      $y_last = round( ( $height - $reheight ) / 2 );

                      if ( ( $img_width < $rewidth ) || ( $img_height < $reheight ) )
                      {
                          $img_last = imagecreatetruecolor( $rewidth, $reheight );
                          $x_last = round( ( $rewidth - $img_width ) / 2 );
                          $y_last = round( ( $reheight - $img_height ) / 2 );

                          imagecopy( $img_last, $img_sour, $x_last, $y_last, 0, 0, $width, $height );
                          imagedestroy( $img_sour );
                          $white = imagecolorallocate( $img_last, 255, 255, 255);
                          imagefill( $img_last, 0, 0, $white );
                      }
                      else
                      {
                          $img_dest = imagecreatetruecolor( $width, $height );
                          imagecopyresampled( $img_dest, $img_sour, 0, 0, 0, 0, $width, $height, $img_width, $img_height );
                          $img_last = imagecreatetruecolor( $rewidth, $reheight );
                          imagecopy( $img_last, $img_dest, 0, 0, $x_last, $y_last, $width, $height );
                          imagedestroy( $img_dest );
                      }

                      if ( $type == 1 ) imagegif($img_last, $thumb_file, 100);
                      else if ( $type == 2 ) imagejpeg($img_last, $thumb_file, 100);
                      else if ( $type == 3 ) imagepng($img_last, $thumb_file, 100);

                      imagedestroy($img_last);
                    } // 썸네일 끝

                    ?>

                    <td style='padding:5px;' width=<?=$td_width?> height=<?=$td_height?> align=center valign=bottom onmouseover='image_over ( <?=$i?> )' onmouseout='image_out( <?=$i?> )'>

                      <div style='clear:both;'>
<img src='<?=$thumb_file?>' id=thumb_image align=absmiddle style='border:3px solid #ffffff;'>
                      </div>

                    </td>
                    <script language='javascript'>
                    array_image[<?=$i?>] = "<?=$original_file?>";
                    </script>

                    <?
                  }
                  ?>
                </tr>
                </table>



              </div>
            </div>
<table width="775" border="0" cellpadding="0" cellspacing="0"align="left"><tr><td bgcolor="eeeeff" style="padding:5px" width=775>
<table border=0 cellpadding=0 cellspacing=0 width=97%>
<tr>
<td >
<? if ($view['wr_1'] == "사용") { ?>

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=ko"></script>

<script type="text/javascript">

// 구글맵
var map;
function initialize() {
var myLatlng = new google.maps.LatLng(<?=$write['wr_9']?>, <?=$write['wr_10']?>);
var myOptions = {
zoom: 16,
scaleControl: true,

navigationControl: true,
navigationControlOptions: {
style: google.maps.NavigationControlStyle.SMALL,
position: google.maps.ControlPosition.TOP_RIGHT
},

center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

// 리스너 Listener ////////////////////////////////////////////////////
google.maps.event.addListener(map, 'zoom_changed', function() {
zoomLevel = map.getZoom();
if (zoomLevel > 19) {
  map.setZoom(19);

if (zoomLevel < 1) {
  map.setZoom(1);

});

var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: "Here"
});
}

</script>

<div id="map_canvas" style="width:770; height:<?=$map_height?>;">
</div>

<? }?>
</td></tr>
</table></td></tr></table>







<script language="JavaScript" src="<?="$g4[path]/js/board.js"?>"></script>
<script language="JavaScript">

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
window.onload = func;
  } else {
window.onload = function() {
  if (oldonload) {
oldonload();
  }
  func();
}
  }
}

function resizeImage(func) {
resizeBoardImage(<?=(int)$board[bo_image_width] +40 ?>);
drawFont();
}
addLoadEvent(resizeImage);
//<!-- 게시글 보기 끝 -->

//<!-- 구글지도 보기 -->
addLoadEvent(initialize);
</script>


상위에있는 스크립트는 제외...

댓글 전체

여기서부터~~~

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=ko"></script>

<script type="text/javascript">

// 구글맵
var map;
function initialize() {
var myLatlng = new google.maps.LatLng(<?=$write['wr_9']?>, <?=$write['wr_10']?>);
var myOptions = {
zoom: 16,
scaleControl: true,

navigationControl: true,
navigationControlOptions: {
style: google.maps.NavigationControlStyle.SMALL,
position: google.maps.ControlPosition.TOP_RIGHT
},

center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

// 리스너 Listener ////////////////////////////////////////////////////
google.maps.event.addListener(map, 'zoom_changed', function() {
zoomLevel = map.getZoom();
if (zoomLevel > 19) {
  map.setZoom(19);
}
if (zoomLevel < 1) {
  map.setZoom(1);
}
});

var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: "Here"
});
}

</script>

<div id="map_canvas" style="width:770; height:<?=$map_height?>;">
</div>

<script language="JavaScript">
//<!-- 구글지도 보기 -->
addLoadEvent(initialize);
</script>

~~~ 여기까지네요
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

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