구글 지도 링크가안넘어오는데 이유를알수있을까요?
본문
<?php
include_once('./_common.php');
define('_INDEX_', true);
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_THEME_PATH.'/head.php');
?>
<link href="css/jquery.bxslider.css" rel="stylesheet" />
<link rel="stylesheet" href="theme/basic/css/index.css" />
<!-- jQuery library (served from Google) -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=ko"></script>
<script>
function initialize() {
var myLatlng = new google.maps.LatLng(37.493153, 127.118833); // y, x좌표값
var mapOptions = {
zoom: 15,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: "회사이름"
});
var infowindow = new google.maps.InfoWindow(
{
content: "<h1>회사이름</h1>",
maxWidth: 300
}
);
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map, marker);
});
}
</script>
<style>
.left_menu {
margin-left: 20%;
width: 200px;
margin-top: 120px;
float: left;
margin-right: 60px;
}
.left_menu > ul{border:1px solid black; border-bottom:0; background:#333333;}
.left_menu > ul li{border-bottom:1px solid black; padding:20px 10px;}
.to_p{width:100%; overflow:hidden;}
.dlstk{float:left; width:50%;}
.dlstk img{width:100%;}
.aaa{display:none;}
#cd-menu-trigger{display:none;}
@media screen and (max-width:1000px) {
.left_menu{display:none;}
.dlstk{width:100%; height:400px;}
.dlstk img{height:100%;}
#cd-menu-trigger{display:block;}
.aaa{display:block; margin-top:10px;}
}
#cd-menu-trigger{display:block; margin-top:10px;}
.cd-main-content {
/* set a min-height and a z-index to be sure that the main element completely covers the lateral menu */
min-height: 8%;
position: absolute;
background-color: #f5f4e9;
z-index: 9999;
top:-12px;
right:0;
/* Force Hardware Acceleration in WebKit */
-webkit-transform: translateZ(0);
-webkit-backface-visibility: hidden;
-webkit-transition-property: -webkit-transform;
-moz-transition-property: -moz-transform;
transition-property: transform;
-webkit-transition-duration: 0.4s;
-moz-transition-duration: 0.4s;
transition-duration: 0.4s;
}
.cd-main-content.lateral-menu-is-open {
/* translate to show the lateral menu - all content needs to be put in the .cd-main-content to translate*/
-webkit-transform: translateX(-260px);
-moz-transform: translateX(-260px);
-ms-transform: translateX(-260px);
-o-transform: translateX(-260px);
transform: translateX(-260px);
}
</style>
<div class="to_p">
<div class="left_menu">
<div class="apsb">
<img src="./img/apsb.jpg">
</div>
<ul>
<li><a href="/theme/basic/sub1.php">인사말</a></li>
<li><a href="/theme/basic/sub2.php">회사연혁</a></li>
<li><a href="/theme/basic/sub4.php">조직도</a></li>
<li><a href="/theme/basic/sub5.php">찾아오시는길</a></li>
</ul>
<a href="/theme/basic/call3.php"><img src="img/rkaod.png"></a>
</div>
<div class="dlstk">
<div id="map_canvas" style="width:600px; height:400px;"></div>
</div>
</div>
<?php
include_once(G5_THEME_PATH.'/tail.php');
?>
무엇이 문제이길래.. 지도링크가 안걸려오는지.. 감이안잡히네요.. ㅜㅜ초보입니다.
답변 2
구글 API키 발급 받으시고 js에서 key=발급받은키를 넘겨주시면 됩니다.
구글 지도도 다음 지도 api 와 네이버 지도 api 와 같이 api 키를 발급받고 불러올때 키를 입력해주어야합니다