Skip to content

Commit

Permalink
🔧 #17 - tmap API 로컬로 이동
Browse files Browse the repository at this point in the history
  • Loading branch information
taeuk-gang committed Oct 1, 2019
1 parent 87d0f30 commit ca97473
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 3 deletions.
7 changes: 5 additions & 2 deletions client/src/components/region-selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,12 @@ export class regionSelector extends HTMLElement {
this.clickRegionSelector(event)
}

clickRegionSelector(event) {
if (event.target.closest(`[data-select-name="region"]`)) {
clickRegionSelector(event) {
if (event.target.closest(`[data-select-name="region"] li`)) {
let region = event.target.textContent.trim()
if (!region) {
return
}
region = region === `모든 지역` ? [`경기`, `서울`, `충청`, `강원`, `전라`, `경상`, `부산`, `제주`] : [region]
document.querySelector(`page-main`).contentLoading(region)
}
Expand Down
2 changes: 1 addition & 1 deletion client/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<script src="js/polyfill.min.js"></script>
<script src="js/custom-elements-es5-adapter.js"></script>
<script src="js/webcomponents-sd-ce-pf.js"></script>
<script src="https://apis.openapi.sk.com/tmap/js?version=1&format=javascript&appKey=20a000fc-d6c7-4bdd-909c-3e5f89c4868e"></script>
<script src="js/t-map.js"></script>
<script src="main-bundle.js"></script>
</body>
</html>
62 changes: 62 additions & 0 deletions client/www/js/t-map.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
OpenLayers.js -- OpenLayers Map Viewer Library
Copyright (c) 2006-2015 by OpenLayers Contributors
Published under the 2-clause BSD license.
See https://raw.githubusercontent.com/openlayers/ol2/master/license.txt for the full text of the license, and https://raw.githubusercontent.com/openlayers/ol2/master/authors.txt for full list of contributors.
Includes compressed code under the following licenses:
(For uncompressed versions of the code used, please see the
OpenLayers Github repository: <https://github.com/openlayers/ol2>)
*/

/**
* Contains XMLHttpRequest.js <http://code.google.com/p/xmlhttprequest/>
* Copyright 2007 Sergey Ilinsky (http://www.ilinsky.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*/

/**
* local TmapV20
* OpenLayers.Util.pagePosition is based on Yahoo's getXY method, which is
* Copyright (c) 2006, Yahoo! Inc.
* All rights reserved.
*
* Redistribution and use of this software in source and binary forms, with or
* without modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of Yahoo! Inc. nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission of Yahoo! Inc.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

document.write(`<link rel='stylesheet' href='https://topopen.tmap.co.kr/tmaplibv20/theme/default/style.css' type='text/css'>`);(function(){let a=typeof Tmap==`object`&&Tmap.singleFile;let b=!a?`https://topopen.tmap.co.kr/tmaplibv20/Tmap.js`:`Tmap.js`;let c=window.Tmap;window.Tmap={_getScriptLocation:function(){return`https://topopen.tmap.co.kr/tmaplibv20/`},ImgPath:`https://topopen.tmap.co.kr/tmaplibv20/img/`,VERSION_NUMBER:`Release1.18.25`};if(!a){if(!c){c=[`Core.js`,`Format.js`,`Add-on.js`]}let d=new Array(c.length);let e=Tmap._getScriptLocation();for(let f=0,g=c.length;f<g;f++){d[f]=`<script src='`+e+c[f]+`?vn=`+Tmap.VERSION_NUMBER+`'></script>`}if(d.length>0){document.write(d.join(``))}}}());


0 comments on commit ca97473

Please sign in to comment.