Created
April 18, 2014 14:22
-
-
Save haruair/11046710 to your computer and use it in GitHub Desktop.
Daum map API v3 with DOM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (e, d) { | |
if (typeof d == "object") { | |
for (var f in d) { | |
if (d.hasOwnProperty(f)) { | |
e[f] = e[f] || d[f], arguments.callee(e[f], d[f]); | |
} | |
} | |
} | |
})(this, { | |
daum: { | |
maps: { | |
VERSION: { | |
ROADMAP: "211111rest", | |
HYBRID: "211111rest", | |
ROADVIEW: "1.00", | |
ROADVIEW_FLASH: "140417", | |
ROADVIEW_AJAX: "140414" | |
} | |
} | |
} | |
}); | |
var s, fs; | |
s = document.createElement('script'); | |
s.type = 'text/javascript'; | |
s.src = (location.protocol == "https:" ? "https:" : "http:") + '//apis.daum.net/maps/real/maps3.65.js'; | |
fs = document.getElementsByTagName('script')[0]; | |
fs.parentNode.insertBefore(s, fs); |
감사합니다 덕분에 고민하던 문제가 해결되었습니다. 그런데 사용하려다 보니 제가 발급받은 api키를 넣는 곳이 없는데 문제되는 일이 없는지 궁금합니다.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
원래 코드는 document.write로 작성되어 있어서
meteorjs
등과 같이 비동기적으로 외부 스크립트를 불러오는 경우에 문제가 발생하고 있습니다. 서비스 개선에 도움이 되었으면 합니다.