-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
43 lines (37 loc) · 2.02 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div id="layer" style="display:block;position:fixed;overflow:hidden;z-index:1;-webkit-overflow-scrolling:touch;"></div>
<script src="https://t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js"></script>
<script>
function execDaumPostcode() {
new daum.Postcode({
oncomplete: function(data) {
var lotNumberAddress = data.jibunAddress; // 지번 주소 변수
var autoLotNumberAddress = data.autoJibunAddress;
var roadNameAddress = data.roadAddress; // 도로명 주소
var autoRoadNameAddress = data.autoRoadAddress;
// 도로명 주소와 지번 주소를 안드로이드 네이티브로 전송
window.android.onPostCodeReceived(roadNameAddress, autoRoadNameAddress, lotNumberAddress, autoLotNumberAddress);
},
width : '100%',
height : '100%'
}).embed(document.getElementById('layer'));
document.getElementById('layer').style.display = 'block';
initLayerPosition();
}
function initLayerPosition(){
var width = (window.innerWidth || document.documentElement.clientWidth); //우편번호서비스가 들어갈 element의 width
var height = (window.innerHeight || document.documentElement.clientHeight); //우편번호서비스가 들어갈 element의 height
var borderWidth = 5; //샘플에서 사용하는 border의 두께
document.getElementById('layer').style.width = width + 'px';
document.getElementById('layer').style.height = height + 'px';
document.getElementById('layer').style.border = borderWidth + 'px solid';
document.getElementById('layer').style.left = (((window.innerWidth || document.documentElement.clientWidth) - width)/2 - borderWidth) + 'px';
document.getElementById('layer').style.top = (((window.innerHeight || document.documentElement.clientHeight) - height)/2 - borderWidth) + 'px';
}
</script>
</body>
</html>