서준혁

Add district, festival selector

This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
<script>
import Menu from './Menu.svelte'
import Backtotop from './Side/Backtotop.svelte'
import Map from './Map.svelte'
import Article from './Articles.svelte'
import Festalist from './Side/Festalist.svelte';
import Areaset from './Side/Areaset.svelte';
import Menu from './Menu.svelte';
import Backtotop from './SideItems/Backtotop.svelte';
import Map from './Map.svelte';
import Article from './Articles.svelte';
import { AllFestas } from './Stores/AllFestas';
import jQuery from 'jquery';
import { DisplayedFestas } from './Stores/DisplayedFestas';
function LoadFestas() {
let url = "http://api.visitkorea.or.kr/openapi/service/rest/KorService/areaBasedList?ServiceKey=2lFkvQJYgzOOhwUKiUt8aZVNpd1PpBOf%2FfMNW17cl25DE0GUEDddeR9iGnuSUpggjUoIUgamfhcvnKQ3eH1dAw%3D%3D&contentTypeId=15&areaCode=&sigunguCode=&cat1=&cat2=&cat3=&listYN=Y&MobileOS=ETC&MobileApp=TourAPI3.0_Guide&arrange=A&numOfRows=12&pageNo=1&_type=json";
jQuery.getJSON(url, (json) => {
AllFestas.set(json.response.body.items.item);
});
}
</script>
<style>
......@@ -29,10 +37,9 @@
</style>
<svelte:window on:load|once={LoadFestas}></svelte:window>
<div>
<Menu/>
<Festalist/>
<Areaset/>
<Map/>
<Backtotop/>
<Article/>
......
export let COORDINATES = {
"미선택" : {
"미선택" : [ 127.46862435619565, 36.003837243591676, 13 ]
},
"서울특별시" : {
"미선택" : [ 126.95401910605827, 37.53467856968404, 9],
"종로구" : [ 126.9773171, 37.59492045, 7],
"중구" : [ 126.9959683, 37.56014287, 7],
"용산구" : [ 126.9799076, 37.53138556, 7],
"성동구" : [ 127.0410588, 37.55103004, 7],
"광진구" : [ 127.0857458, 37.54672166, 7],
"동대문구" : [ 127.0548482, 37.58195725, 7],
"중랑구" : [ 127.0928839, 37.59781902, 7],
"성북구" : [ 127.0175783, 37.60570143, 7],
"강북구" : [ 127.0111848, 37.64347732, 7],
"도봉구" : [ 127.032367, 37.66910528, 7],
"노원구" : [ 127.0750336, 37.65251633, 7],
"은평구" : [ 126.9270283, 37.61921535, 7],
"서대문구" : [ 126.9390632, 37.57778646, 7],
"마포구" : [ 126.908264, 37.55931222, 7],
"양천구" : [ 126.8554792, 37.52478964, 7],
"강서구" : [ 126.8228036, 37.56123594, 7],
"구로구" : [ 126.8563021, 37.49440412, 7],
"금천구" : [ 126.9008177, 37.46056912, 7],
"영등포구" : [ 126.9101694, 37.52230985, 7],
"동작구" : [ 126.9516402, 37.49887636, 7],
"관악구" : [ 126.9453355, 37.46737656, 7],
"서초구" : [ 127.0312084, 37.47329793, 7],
"강남구" : [ 127.0629749, 37.49664584, 7],
"송파구" : [ 127.1152911, 37.50562076, 7],
"강동구" : [ 127.1470146, 37.55045136, 7]
},
"부산광역시" : {
"미선택" : [ 129.0315402, 35.10547796 , 9],
"중구" : [ 129.0315402, 35.10547796, 7],
"서구" : [ 129.0149128, 35.10296452, 7],
"동구" : [ 129.0445861, 35.1291866, 7],
"영도구" : [ 129.0648202, 35.07865091, 7],
"부산진구" : [ 129.0430601, 35.16524533, 7],
"동래구" : [ 129.0792188, 35.20621201, 7],
"남구" : [ 129.0940042, 35.12613858, 7],
"북구" : [ 129.0234651, 35.22925311, 7],
"해운대구" : [ 129.1535891, 35.19385742, 7],
"사하구" : [ 128.9743481, 35.0893528, 7],
"금정구" : [ 129.09153, 35.25889463, 7],
"강서구" : [ 128.8924423, 35.13837168, 7],
"연제구" : [ 129.0829344, 35.18241804, 7],
"수영구" : [ 129.1111625, 35.16133249, 7],
"사상구" : [ 128.9865939, 35.15803505, 7],
"기장군" : [ 129.224475, 35.24135 , 7],
},
"대구광역시" : {
"미선택" : [ 128.5936057, 35.86653525 , 9],
"중구" : [ 128.5936057, 35.86653525, 7],
"동구" : [ 128.6856499, 35.93444401, 7],
"서구" : [ 128.5496976, 35.87500168, 7],
"남구" : [ 128.5853297, 35.83517828, 7],
"북구" : [ 128.5772056, 35.92892764, 7],
"수성구" : [ 128.6612732, 35.83384974, 7],
"달서구" : [ 128.529204, 35.82748641, 7],
"달성군" : [ 128.4982969, 35.7596109, 7],
},
"인천광역시" : {
"미선택" : [ 126.66832787491965, 37.45983498861199, 10],
"중구" : [ 126.4828638, 37.46909379, 7],
"동구" : [ 126.6395434, 37.48319411, 7],
"미추홀구" : [ 126.6646576, 37.45259376, 7],
"연수구" : [ 126.6494242, 37.39619493, 7],
"남동구" : [ 126.7264666, 37.43135604, 7],
"부평구" : [ 126.7212083, 37.49666082, 7],
"계양구" : [ 126.7347032, 37.55729939, 7],
"서구" : [ 126.6563686, 37.55783907, 7],
"남구" : [ 126.6502972, 37.46369169, 7],
"강화군" : [ 126.45730005738866, 37.68192191125021, 9],
"옹진군" : [ 126.6388889, 37.443725 , 7],
},
"광주광역시" : {
"미선택" : [ 126.9494622, 35.11738405, 9],
"동구" : [ 126.9494622, 35.11738405, 7],
"서구" : [ 126.8507245, 35.13569669, 7],
"남구" : [ 126.8567385, 35.09405737, 7],
"북구" : [ 126.9254668, 35.19324913, 7],
"광산구" : [ 126.752903, 35.16504314, 7],
},
"대전광역시" : {
"미선택" : [ 127.4750627, 36.32396534, 9],
"동구" : [ 127.4750627, 36.32396534, 7],
"중구" : [ 127.4110567, 36.28087229, 7],
"서구" : [ 127.3451254, 36.28026323, 7],
"유성구" : [ 127.333298, 36.37682167, 7],
"대덕구" : [ 127.4401591, 36.41219042, 7],
},
"울산광역시" : {
"미선택" : [ 129.3082427, 35.5710483, 9],
"중구" : [ 129.3082427, 35.5710483, 7],
"남구" : [ 129.3281901, 35.51605166, 7],
"동구" : [ 129.4260695, 35.52558, 7],
"북구" : [ 129.3798015, 35.6100624, 7],
"울주군" : [ 129.1868265, 35.54669692, 7],
},
"세종특별자치시" : {
"세종특별자치시" : [ 127.258722, 36.56072897, 9]
},
"경기도" : {
"미선택" : [ 127.39154661008746, 37.427936253223265, 11],
"수원시" : [ 127.0122222, 37.30101111, 9 ],
"성남시" : [ 127.1477194, 37.44749167, 9 ],
"의정부시" : [ 127.0684277, 37.73619293, 9 ],
"안양시" : [ 126.9533556, 37.3897, 9 ],
"부천시" : [ 126.7887094, 37.5042629, 9 ],
"광명시" : [ 126.8646995, 37.44516419, 9 ],
"평택시" : [ 126.9877522, 37.0118376 ],
"동두천시" : [ 127.0779034, 37.91654298, 9 ],
"안산시" : [ 126.8468194, 37.29851944, 9 ],
"고양시" : [ 126.7770556, 37.65590833, 9 ],
"과천시" : [ 127.0026802, 37.43384612, 9 ],
"구리시" : [ 127.1312301, 37.59922784, 9 ],
"남양주시" : [ 127.2436444, 37.66255685, 9 ],
"오산시" : [ 127.0513236, 37.16329326, 9 ],
"시흥시" : [ 126.7884122, 37.38940556, 9 ],
"군포시" : [ 126.9211378, 37.34348472, 9 ],
"의왕시" : [ 126.9896417, 37.36239655, 9 ],
"하남시" : [ 127.205944, 37.5228201 ],
"용인시" : [ 127.2038444, 37.23147778, 9 ],
"파주시" : [ 126.8108037, 37.85624554, 9 ],
"이천시" : [ 127.4809313, 37.2098301 ],
"안성시" : [ 127.3027607, 37.03502502, 9 ],
"김포시" : [ 126.6263868, 37.68179015, 9 ],
"화성시" : [ 126.8748706, 37.16523209, 9 ],
"광주시" : [ 127.3011721, 37.40312001, 9 ],
"양주시" : [ 127.0011552, 37.80869566, 9 ],
"포천시" : [ 127.2504236, 37.96989231, 9 ],
"여주시" : [ 127.6156731, 37.30250497, 9 ],
"가평군" : [ 127.450192, 37.81856681, 9 ],
"양평군" : [ 127.5791946, 37.51803657, 9 ],
"연천군" : [ 127.0770667, 38.09336389, 9 ],
},
"강원도" : {
"미선택" : [ 127.12317975612937, 36.016711825127636, 11],
"춘천시" : [ 127.7399546, 37.88984997, 9 ],
"원주시" : [ 127.9295396, 37.30825853, 9 ],
"강릉시" : [ 128.8322214, 37.70920125, 9 ],
"동해시" : [ 129.055639, 37.50672984, 9 ],
"태백시" : [ 128.9800625, 37.17236519, 9 ],
"속초시" : [ 128.5195498, 38.1760275, 9 ],
"삼척시" : [ 129.1674889, 37.44708611, 9 ],
"홍천군" : [ 128.074507, 37.74486679, 9 ],
"횡성군" : [ 128.0770646, 37.5091607, 9 ],
"영월군" : [ 128.4999342, 37.20404507, 9 ],
"평창군" : [ 128.4827677, 37.55699072, 9 ],
"정선군" : [ 128.7390663, 37.37878577, 9 ],
"철원군" : [ 127.398991, 38.23902719, 9 ],
"화천군" : [ 127.6852023, 38.13843323, 9 ],
"양구군" : [ 128.000222, 38.17567667, 9 ],
"인제군" : [ 128.2647172, 38.06477754, 9 ],
"고성군" : [ 128.4110731, 38.36284879, 9 ],
"양양군" : [ 128.5949493, 38.00453158, 9 ],
},
"충청북도" : {
"미선택" : [ 127.79255408173366, 36.77775337994217, 11],
"청주시" : [ 127.5117306, 36.58399722, 9 ],
"충주시" : [ 127.8955587, 37.01523811, 9 ],
"제천시" : [ 128.1409071, 37.06007228, 9 ],
"보은군" : [ 127.7293296, 36.48995371, 9 ],
"옥천군" : [ 127.6565891, 36.32045893, 9 ],
"영동군" : [ 127.8142658, 36.15967356, 9 ],
"증평군" : [ 127.6046043, 36.78649107, 9 ],
"진천군" : [ 127.4404342, 36.87102031, 9 ],
"괴산군" : [ 127.8295825, 36.76968609, 9 ],
"음성군" : [ 127.6141838, 36.97625907, 9 ],
"단양군" : [ 128.3878861, 36.99451168, 9 ],
},
"충청남도" : {
"미선택" : [ 127.35233920735703, 36.45690483533581, 11],
"천안시" : [ 127.1524667, 36.804125, 9 ],
"공주시" : [ 127.0751478, 36.47990652, 9 ],
"보령시" : [ 126.5942136, 36.34031922, 9 ],
"아산시" : [ 126.980082, 36.80735134, 9 ],
"서산시" : [ 126.463562, 36.78409691, 9 ],
"당진시" : [ 126.6302528, 36.89075 , 9 ],
"논산시" : [ 127.1577061, 36.19090514, 9 ],
"계룡시" : [ 127.2344204, 36.29160368, 9 ],
"금산군" : [ 127.4782928, 36.11903032, 9 ],
"서천군" : [ 126.7049244, 36.10661218, 9 ],
"청양군" : [ 126.853086, 36.43059194, 9 ],
"홍성군" : [ 126.6258234, 36.57009036, 9 ],
"예산군" : [ 126.7842651, 36.67064001, 9 ],
"태안군" : [ 126.2808032, 36.70386085, 9 ],
"부여군" : [ 126.9118639, 36.27282222, 9 ],
},
"전라북도" : {
"미선택" : [ 127.07737136324491, 35.63605805905352, 11],
"전주시" : [ 127.1219194, 35.80918889, 9 ],
"익산시" : [ 126.989503, 36.02314348, 9 ],
"정읍시" : [ 126.9058697, 35.6026358, 9 ],
"남원시" : [ 127.4419364, 35.42253429, 9 ],
"군산시" : [ 126.7388444, 35.96464167, 9 ],
"김제시" : [ 126.8948294, 35.80671465, 9 ],
"완주군" : [ 127.2152214, 35.91876217, 9 ],
"진안군" : [ 127.4300802, 35.82889325, 9 ],
"무주군" : [ 127.7129494, 35.93937729, 9 ],
"장수군" : [ 127.5443403, 35.65753552, 9 ],
"임실군" : [ 127.2366564, 35.5982329, 9 ],
"순창군" : [ 127.0900463, 35.43362681, 9 ],
"고창군" : [ 126.6160791, 35.44819175, 9 ],
"부안군" : [ 126.6444614, 35.67792233, 9 ],
},
"전라남도" : {
"미선택" : [ 126.9842629432299, 34.805397241331605, 11],
"목포시" : [ 126.3918464, 34.80376301, 9 ],
"여수시" : [ 127.6535295, 34.69839004, 9 ],
"순천시" : [ 127.3891379, 34.99477437, 9 ],
"나주시" : [ 126.7204163, 34.98859351, 9 ],
"광양시" : [ 127.6551052, 35.02193047, 9 ],
"담양군" : [ 126.9952608, 35.29155078, 9 ],
"곡성군" : [ 127.2635431, 35.21663483, 9 ],
"구례군" : [ 127.5030878, 35.23679742, 9 ],
"고흥군" : [ 127.3146561, 34.59855727, 9 ],
"보성군" : [ 127.1621881, 34.81440563, 9 ],
"화순군" : [ 127.0335393, 35.00825383, 9 ],
"장흥군" : [ 126.9215255, 34.67668231, 9 ],
"강진군" : [ 126.7721471, 34.62048424, 9 ],
"영암군" : [ 126.6307699, 34.79957499, 9 ],
"무안군" : [ 126.4257885, 34.95327665, 9 ],
"함평군" : [ 126.5356108, 35.11269517, 9 ],
"영광군" : [ 126.4531334, 35.27849439, 9 ],
"장성군" : [ 126.7685691, 35.32960098, 9 ],
"완도군" : [ 126.7769747, 34.29559715, 9 ],
"진도군" : [ 126.2151837, 34.43942431, 9 ],
"신안군" : [ 126.0495583, 34.81262298, 9 ],
"해남군" : [ 126.6012889, 34.57043611, 9 ],
},
"경상북도" : {
"미선택" : [ 128.81204394329464, 36.353709379365114, 11],
"포항시" : [ 129.3616667, 36.00568611, 9 ],
"경주시" : [ 129.235873, 35.826691, 9 ],
"김천시" : [ 128.0778448, 36.06051569, 9 ],
"안동시" : [ 128.7800407, 36.58030946, 9 ],
"구미시" : [ 128.3554644, 36.20734109, 9 ],
"영주시" : [ 128.5976539, 36.87055896, 9 ],
"영천시" : [ 128.9426073, 36.01581613, 9 ],
"상주시" : [ 128.0669903, 36.42955021, 9 ],
"문경시" : [ 128.1486973, 36.69080984, 9 ],
"경산시" : [ 128.809053, 35.83410302, 9 ],
"군위군" : [ 128.6481186, 36.17011731, 9 ],
"의성군" : [ 128.6149052, 36.36201086, 9 ],
"청송군" : [ 129.0574327, 36.35707112, 9 ],
"영양군" : [ 129.145057, 36.69647487, 9 ],
"영덕군" : [ 129.3173817, 36.48249776, 9 ],
"청도군" : [ 128.7865755, 35.67292328, 9 ],
"고령군" : [ 128.3067568, 35.73721147, 9 ],
"성주군" : [ 128.233394, 35.90724515, 9 ],
"칠곡군" : [ 128.4625866, 36.01551093, 9 ],
"예천군" : [ 128.4224645, 36.65391037, 9 ],
"봉화군" : [ 128.9129168, 36.93415717, 9 ],
"울진군" : [ 129.312205, 36.90408324, 9 ],
"울릉군" : [ 130.8641677, 37.50196388, 9 ],
},
"경상남도" : {
"미선택" : [ 128.53769042792499, 35.44400982880079, 11],
"창원시" : [ 128.6401544, 35.2540033 , 9 ],
"진주시" : [ 128.1297644, 35.20514752 , 9 ],
"통영시" : [ 128.3741039, 34.8294728 , 9 ],
"사천시" : [ 128.0376567, 35.04971902 , 9 ],
"김해시" : [ 128.8452254, 35.27216917 , 9 ],
"밀양시" : [ 128.7896424, 35.49850039 , 9 ],
"거제시" : [ 128.6231604, 34.8704778 , 9 ],
"양산시" : [ 129.0410367, 35.40190499 , 9 ],
"의령군" : [ 128.2771012, 35.39245631 , 9 ],
"함안군" : [ 128.430905, 35.29101218 , 9 ],
"창녕군" : [ 128.4930122, 35.50827649 , 9 ],
"고성군" : [ 128.2906976, 35.01630929 , 9 ],
"남해군" : [ 127.9411169, 34.81831061 , 9 ],
"하동군" : [ 127.7789218, 35.13838231 , 9 ],
"산청군" : [ 127.8843644, 35.36863784 , 9 ],
"함양군" : [ 127.7220744, 35.55172723 , 9 ],
"거창군" : [ 127.9041319, 35.73261316 , 9 ],
"합천군" : [ 128.1415535, 35.57666246 , 9 ],
},
"제주특별자치도" : {
"미선택" : [ 126.5808984756216, 33.357067644200384, 10],
"제주시" : [ 126.5294524, 33.44212371, 9 ],
"서귀포시" : [ 126.5812981, 33.32493064, 9 ],
}
}
\ No newline at end of file
export let DISTRICTS = {
"name": "korea-administrative-district",
"version": "20160125",
"url": "https://github.com/cosmosfarm/korea-administrative-district",
"data":[
{"미선택":[
"미선택"
]},
{"서울특별시":[
"미선택", "종로구", "중구", "용산구", "성동구", "광진구", "동대문구", "중랑구", "성북구", "강북구", "도봉구", "노원구", "은평구", "서대문구", "마포구", "양천구", "강서구", "구로구", "금천구", "영등포구", "동작구", "관악구", "서초구", "강남구", "송파구", "강동구"
]},
{"부산광역시":[
"미선택", "중구", "서구", "동구", "영도구", "부산진구", "동래구", "남구", "북구", "강서구", "해운대구", "사하구", "금정구", "연제구", "수영구", "사상구", "기장군"
]},
{"인천광역시":[
"미선택", "중구", "동구", "남구", "연수구", "남동구", "부평구", "계양구", "서구", "강화군", "옹진군"
]},
{"대구광역시":[
"미선택", "중구", "동구", "서구", "남구", "북구", "수성구", "달서구", "달성군"
]},
{"광주광역시":[
"미선택", "동구", "서구", "남구", "북구", "광산구"
]},
{"대전광역시":[
"미선택", "동구", "중구", "서구", "유성구", "대덕구"
]},
{"울산광역시":[
"미선택", "중구", "남구", "동구", "북구", "울주군"
]},
{"세종특별자치시":[
"미선택", "세종특별자치시"
]},
{"경기도":[
"미선택", "가평군", "고양시", "과천시", "광명시", "광주시", "구리시", "군포시", "김포시", "남양주시", "동두천시", "부천시", "성남시", "수원시", "시흥시", "안산시", "안성시", "안양시", "양주시", "양평군", "여주시", "연천군", "오산시", "용인시", "의왕시", "의정부시", "이천시", "파주시", "평택시", "포천시", "하남시", "화성시"
]},
{"강원도":[
"미선택", "원주시", "춘천시", "강릉시", "동해시", "속초시", "삼척시", "홍천군", "태백시", "철원군", "횡성군", "평창군", "영월군", "정선군", "인제군", "고성군", "양양군", "화천군", "양구군"
]},
{"충청북도":[
"미선택", "청주시", "충주시", "제천시", "보은군", "옥천군", "영동군", "증평군", "진천군", "괴산군", "음성군", "단양군"
]},
{"충청남도":[
"미선택", "천안시", "공주시", "보령시", "아산시", "서산시", "논산시", "계룡시", "당진시", "금산군", "부여군", "서천군", "청양군", "홍성군", "예산군", "태안군"
]},
{"경상북도":[
"미선택", "포항시", "경주시", "김천시", "안동시", "구미시", "영주시", "영천시", "상주시", "문경시", "경산시", "군위군", "의성군", "청송군", "영양군", "영덕군", "청도군", "고령군", "성주군", "칠곡군", "예천군", "봉화군", "울진군", "울릉군"
]},
{"경상남도":[
"미선택", "창원시", "김해시", "진주시", "양산시", "거제시", "통영시", "사천시", "밀양시", "함안군", "거창군", "창녕군", "고성군", "하동군", "합천군", "남해군", "함양군", "산청군", "의령군"
]},
{"전라북도":[
"미선택", "전주시", "익산시", "군산시", "정읍시", "완주군", "김제시", "남원시", "고창군", "부안군", "임실군", "순창군", "진안군", "장수군", "무주군"
]},
{"전라남도":[
"미선택", "여수시", "순천시", "목포시", "광양시", "나주시", "무안군", "해남군", "고흥군", "화순군", "영암군", "영광군", "완도군", "담양군", "장성군", "보성군", "신안군", "장흥군", "강진군", "함평군", "진도군", "곡성군", "구례군"
]},
{"제주특별자치도":[
"미선택", "제주시", "서귀포시"
]}
]
}
\ No newline at end of file
......@@ -21,15 +21,21 @@
</style>
<script>
import jQuery from 'jquery';
import Info from './Side/Info.svelte';
import Info from './SideItems/Info.svelte';
import Festalist from './SideItems/Festalist.svelte';
import Arealist from './SideItems/Arealist.svelte';
import { COORDINATES } from "./Data/coordinates";
import { DisplayedFestas } from "./Stores/DisplayedFestas";
var {kakao} = window;
var url = "http://api.visitkorea.or.kr/openapi/service/rest/KorService/areaBasedList?ServiceKey=2lFkvQJYgzOOhwUKiUt8aZVNpd1PpBOf%2FfMNW17cl25DE0GUEDddeR9iGnuSUpggjUoIUgamfhcvnKQ3eH1dAw%3D%3D&contentTypeId=15&areaCode=&sigunguCode=&cat1=&cat2=&cat3=&listYN=Y&MobileOS=ETC&MobileApp=TourAPI3.0_Guide&arrange=A&numOfRows=12&pageNo=1&_type=json";
let ShowInfo = false;
let Festa = {};
var markers= [];
var ShowArea = false;
var ShowFesta = false;
var ShowInfo = false;
var Festa = {};
var markers = [];
var infowindows = [];
var map;
function createMap() {
......@@ -42,15 +48,21 @@
markers= [];
map = new kakao.maps.Map(mapContainer, mapOption); // 카카오 지도
// 임시로 관광공사에서 JSON 직접 불러와서 하는 중
jQuery.getJSON(url, (json) => {drawMarkers( json.response.body.items.item )});
}
$: drawMarkers($DisplayedFestas);
function drawMarkers (data) {
let len = data.length >= 9 ? 9 : data.length;
markers.forEach( mk => {
mk.setMap(null);
});
infowindows.forEach( iw => {
iw.close();
});
markers, infowindows = [], [];
for(var i = 0; i < len; i++){
// 지도에 마커를 생성하고 표시한다
let marker = new kakao.maps.Marker({
......@@ -58,7 +70,10 @@
map: map // 마커를 표시할 지도 객체
});
markers.push(marker);
let infowindow = new kakao.maps.InfoWindow({
content : '<div style="padding:5px;white-space:nowrap;">' + data[i].title + '</div>' // 인포윈도우에 표시할 내용
});
infowindow.open(map, marker);
// 마커 클릭 시 이벤트
let showInfo = function(festa) {
......@@ -68,22 +83,31 @@
console.log(Festa);
}
};
kakao.maps.event.addListener(marker, 'click', showInfo(data[i]));
infowindows.push(infowindow);
markers.push(marker);
kakao.maps.event.addListener(markers[i], 'click', showInfo(data[i]));
};
// 마커 위에 표시할 인포윈도우를 생성한다
for(var i = 0; i<9;i++) { // 왜 9까지 밖에 안되누 ㅠㅠ
let infowindow = new kakao.maps.InfoWindow({
content : '<div style="padding:5px;">' + data[i].title + '</div>' // 인포윈도우에 표시할 내용
});
infowindow.open(map, markers[i]);
}
}
function moveTo(district, city) {
let [x, y, level] = COORDINATES[district][city];
var moveLatLon = new kakao.maps.LatLng(y, x);
map.setLevel(level);
map.panTo(moveLatLon);
}
function closeBars() {
ShowArea = false;
ShowFesta = false;
ShowInfo = false;
}
</script>
<svelte:window on:load={createMap}></svelte:window>
<Festalist bind:sidebar_show={ShowFesta}/>
<Arealist bind:sidebar_show={ShowArea} {moveTo}/>
<Info bind:sidebar_show={ShowInfo} bind:festa={Festa}/>
<div id="map_bg">
<div id="map"></div>
......
<script>
import { fly } from 'svelte/transition'
import SideBar from './SideBar.svelte';
let show = true;
let sidebar_show = false;
function showBar() {
sidebar_show = !sidebar_show;
}
function hide() {
if (window.scrollY < 400) {
show = true
} else {
show = false
}
}
</script>
<style>
.sidebtn {
border-radius: 5px;
border: 0px;
width: 70px;
height: 70px;
position: fixed;
left: -20px;
top: 18.5%;
padding-right: 10px;
text-align: right;
background-color: #b71c1c;
color: #ffffff;
}
.sidebtn:focus {
background-color: #ef5350;
}
.sidebtn:hover {
background-color: #d32f2f;
}
</style>
<svelte:window on:scroll={hide}></svelte:window>
{#if (show)}
<button class="sidebtn"
transition:fly="{{ x : -50, duration : 400}}"
on:click={showBar}>
지역<br>선택
</button>
<SideBar bind:show={sidebar_show}>
지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br>
지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br>
지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br>
지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br>
지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br>
지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br>
지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br>
지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br>
지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br>
지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br>
지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br>
지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br>
지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br>
지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br>
지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br>
지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br>
지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br>
지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br>
지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br>
지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br>
지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br>
지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br>
지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br> 지역선택!<br>
</SideBar>
{/if}
\ No newline at end of file
<script>
import { fly } from 'svelte/transition'
import SideBar from './SideBar.svelte';
let show = true;
let sidebar_show = false;
function showBar() {
sidebar_show = !sidebar_show;
}
function hide() {
if (window.scrollY < 400) {
show = true
} else {
show = false
}
}
</script>
<style>
.sidebtn {
border-radius: 5px;
border: 0px;
width: 70px;
height: 70px;
position: fixed;
left: -20px;
top: 10%;
padding-right: 10px;
text-align: right;
background-color: #e65100;
color: #ffffff;
}
.sidebtn:focus {
background-color: #f57c00;
}
.sidebtn:hover {
background-color: #ef6c00;
}
</style>
<svelte:window on:scroll={hide}></svelte:window>
{#if (show)}
<button class="sidebtn"
transition:fly="{{ x : -50, duration : 400}}"
on:click={showBar}>
행사<br>목록
</button>
<SideBar bind:show={sidebar_show}>행사목록!</SideBar>
{/if}
\ No newline at end of file
<script>
import { fly } from 'svelte/transition'
import SideBar from './SideBar.svelte';
var icon_show = true;
var sidebar_show = false;
function showBar() {
sidebar_show = true;
}
function hide() {
if (window.scrollY < 400) {
icon_show = true;
} else {
icon_show = false;
sidebar_show = false;
}
}
import { DISTRICTS } from '../Data/district'
import { District, City, Changed } from '../Stores/DistrictStore'
export var moveTo;
let curDisrict = {"미선택" : ["미선택"]};
let curCity = "미선택";
$: if(Object.keys(curDisrict)[0] != "미선택") {
District.set(Object.keys(curDisrict)[0]);
} else {
District.set("");
};
$: if(curCity != "미선택") {
City.set(curCity);
} else {
City.set("");
}
function setDistrict(district) {
curDisrict = district;
if(Object.keys(curDisrict)[0] == "세종특별자치시")
curCity = "세종특별자치시";
else
curCity = "미선택";
moveTo(Object.keys(curDisrict)[0], curCity);
Changed.set(true);
}
function setCity(city) {
curCity = city;
moveTo(Object.keys(curDisrict)[0], curCity);
Changed.set(true);
}
</script>
<style>
.sidebtn {
border-radius: 5px;
border: 0px;
width: 70px;
height: 70px;
position: fixed;
left: -20px;
top: 120px;
padding-right: 10px;
text-align: right;
background-color: #b71c1c;
color: #ffffff;
box-shadow: 0 10px 20px rgb(0 0 0 / 15%);
}
.sidebtn:focus {
background-color: #ef5350;
}
.sidebtn:hover {
background-color: #d32f2f;
}
.areas {
display: flex;
border-bottom: #999999 solid 1px;
width: 100%;
flex-wrap: wrap;
justify-content: space-evenly;
}
.areatitle {
display: inline-block;
text-align:center;
width: 200px;
}
.district {
display: inline-block;
text-align:center;
width: 125px;
margin: 5px;
border: 1px solid black;
border-radius: 5px;
padding-top: 5px;
padding-bottom: 5px;
}
.district:hover {
background-color: #ffebee;
}
.district:focus {
background-color: #ffcdd2;
}
.district.selected{
background-color: #ffcdd2;
}
.city {
display: inline-block;
text-align:center;
width: 125px;
margin: 5px;
border: 1px solid black;
border-radius: 5px;
padding-top: 5px;
padding-bottom: 5px;
}
.city:hover {
background-color: #ffebee;
}
.city:focus {
background-color: #ffcdd2;
}
.city.selected{
background-color: #ffcdd2;
}
</style>
<svelte:window on:scroll={hide}></svelte:window>
{#if (icon_show)}
<button class="sidebtn"
transition:fly="{{ x : -50, duration : 400}}"
on:click={showBar}>
지역<br>선택
</button>
{/if}
<SideBar bind:show={sidebar_show}>
<div class="areas">
<div class="areatitle">광역시/도</div>
{#each DISTRICTS.data as d}
<div class="{Object.keys(curDisrict)[0] == Object.keys(d)[0] ? 'district selected' : 'district'}"
on:click={() => {setDistrict(d)}}>
{Object.keys(d)[0]}
</div><br>
{/each}
</div><br>
<div class="areas">
<div class="areatitle">시/군/구</div>
{#each curDisrict[Object.keys(curDisrict)[0]] as c}
<div class="{curCity == c ? 'city selected' : 'city'}"
on:click={() => {setCity(c)}}>
{c}
</div><br>
{/each}
</div>
</SideBar>
\ No newline at end of file
<script>
import { fly } from 'svelte/transition'
import SideBar from './SideBar.svelte';
let icon_show = true;
let sidebar_show = false;
function showBar() {
sidebar_show = true;
}
function hide() {
if (window.scrollY < 400) {
icon_show = true;
} else {
icon_show = false;
sidebar_show = false;
}
}
import { District, City, Changed } from '../Stores/DistrictStore';
import { AllFestas } from "../Stores/AllFestas";
import { DisplayedFestas } from "../Stores/DisplayedFestas";
let festaChecked = [];
$: festaList = $AllFestas.filter( v => {
if(v.addr1) {
let district = v.addr1.split(" ")[0];
let city = v.addr1.split(" ")[1];
return ($District === "" || district === $District) &&
($City === "" || city === $City);
} else {
return false;
}
});
$: festaParsed = festaList.map( (v, i) => {
return { "id" : i, "title" : v.title, "addr1" : v.addr1, "contentid" : v.contentid, "checked" : false }
});
$: if ($Changed) {
let len = festaList.length >= 9 ? 9 : festaList.length;
festaChecked = [];
for(let i = 0; i < len; i++)
check(i);
}
$: DisplayedFestas.set(festaChecked);
function check(idx) {
if (!festaParsed[idx].checked) {
if(festaChecked.length <= 8) {
festaParsed[idx].checked = true;
festaChecked = festaChecked.concat(festaList[idx]);
} else {
alert("9개 이상 선택하실 수 없습니다.");
}
} else {
festaParsed[idx].checked = false;
festaChecked = festaChecked.filter( v => {
return v.contentid !== festaParsed[idx].contentid;
});
}
}
</script>
<style>
.sidebtn {
border-radius: 5px;
border: 0px;
width: 70px;
height: 70px;
position: fixed;
left: -20px;
top: 200px;
padding-right: 10px;
text-align: right;
background-color: #e65100;
color: #ffffff;
box-shadow: 0 10px 20px rgb(0 0 0 / 15%);
}
.sidebtn:focus {
background-color: #f57c00;
}
.sidebtn:hover {
background-color: #ef6c00;
}
.festa {
border: 1px solid #aaa;
border-radius: 2px;
box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
padding: 2px;
margin-bottom: 5px;
}
.festa:hover {
background-color: #fff3e0;
}
.festa:focus {
background-color: #ffe0b2;
}
.selected {
background-color: #ffe0b2;
border: 1px solid #aaa;
border-radius: 2px;
box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
padding: 2px;
margin-bottom: 5px;
}
.title {
font-weight: bold;
border-bottom: 2px solid #ff3e00;
}
.addr {
display: flex;
align-items: center;
}
.addr img {
width: 20px;
height: 20px;
}
</style>
<svelte:window on:scroll={hide}></svelte:window>
{#if (icon_show)}
<button class="sidebtn"
transition:fly="{{ x : -50, duration : 400}}"
on:click={showBar}>
행사<br>목록
</button>
{/if}
<SideBar bind:show={sidebar_show}>
{#if festaParsed.length > 0}
{#each festaParsed as festa}
<div class="{festa.checked ? "selected" : "festa"}"
on:click={() => {check(festa.id)}}>
<div class="title">{festa.title}</div>
<div class="addr"><img alt="pin" src="/public/map-pin.png"><div>{festa.addr1}</div></div>
</div>
{/each}
{:else}
개최되는 축제가 없습니다.
{/if}
</SideBar>
\ No newline at end of file
......@@ -6,10 +6,8 @@
let side = "right";
function hide() {
if (window.scrollY < 400) {
sidebar_show = true
} else {
sidebar_show = false
if (window.scrollY > 400) {
sidebar_show = false;
}
}
</script>
......
......@@ -8,6 +8,7 @@
<style>
.nav {
overflow-y: auto;
overflow-x: hidden;
}
.left {
......@@ -15,13 +16,12 @@
top: 0;
left: 0;
height: 100%;
/* padding: 2rem 1rem 0.6rem; */
border-right: 1px solid #aaa;
background: #fff;
overflow-y: auto;
padding: 2rem 1rem 0.6rem;
width: 330px;
z-index: 900;
white-space: pre-line;
}
.right {
......@@ -29,7 +29,6 @@
top: 0;
right: 0;
height: 100%;
padding: 2rem 1rem 0.6rem;
border-left: 1px solid #aaa;
background: #fff;
overflow-y: auto;
......@@ -37,21 +36,36 @@
z-index: 900;
}
.background {
position: fixed;
top: 0;
left: 0;
.navtop {
display: flex;
width: 100%;
height: 100%;
z-index: 700;
}
height: 60px;
background-color: white;
font-size: 30pt;
color: #AAAAAA;
justify-content: right;
padding: 5px 5px 5px;
border-bottom: #999999 solid 1px;
}
.navitems {
display: flex;
padding: 2rem 1rem 0.6rem;
flex-direction: column
}
</style>
{#if show}
<div class="background" on:click={() => {show = false;}}></div>
<nav class={"nav " + side} transition:fly={{x: (side == "left" ? -400 : 400), opacity: 1, duration: 800}}>
<slot>
</slot>
<div class="navtop" on:click={() => {show = false;}}
style="justify-content:{side == "left" ? "right" : "left"}; cursor:pointer;">
{ side == "left" ? "<" : ">" }
</div>
<div class="navitems">
<slot>
</slot>
</div>
</nav>
{/if}
\ No newline at end of file
......
import { writable } from 'svelte/store';
function create() {
const { subscribe, set } = writable([]);
return {
subscribe,
set: (e) => set(e),
}
}
export const AllFestas = create();
\ No newline at end of file
import { writable } from 'svelte/store';
function create() {
const { subscribe, set} = writable([]);
return {
subscribe,
set: (e) => set(e),
}
}
export const DisplayedFestas = create();
\ No newline at end of file
import { writable } from 'svelte/store';
export const District = writable("미선택");
export const City = writable("미선택");
export const Changed = writable("true");
\ No newline at end of file
export let district = {
"name": "korea-administrative-district",
"version": "20160125",
"url": "https://github.com/cosmosfarm/korea-administrative-district",
"data":[
{"서울특별시":[
"종로구", "중구", "용산구", "성동구", "광진구", "동대문구", "중랑구", "성북구", "강북구", "도봉구", "노원구", "은평구", "서대문구", "마포구", "양천구", "강서구", "구로구", "금천구", "영등포구", "동작구", "관악구", "서초구", "강남구", "송파구", "강동구"
]},
{"부산광역시":[
"중구", "서구", "동구", "영도구", "부산진구", "동래구", "남구", "북구", "강서구", "해운대구", "사하구", "금정구", "연제구", "수영구", "사상구", "기장군"
]},
{"인천광역시":[
"중구", "동구", "남구", "연수구", "남동구", "부평구", "계양구", "서구", "강화군", "옹진군"
]},
{"대구광역시":[
"중구", "동구", "서구", "남구", "북구", "수성구", "달서구", "달성군"
]},
{"광주광역시":[
"동구", "서구", "남구", "북구", "광산구"
]},
{"대전광역시":[
"동구", "중구", "서구", "유성구", "대덕구"
]},
{"울산광역시":[
"중구", "남구", "동구", "북구", "울주군"
]},
{"세종특별자치시":[
]},
{"경기도":[
"가평군", "고양시", "과천시", "광명시", "광주시", "구리시", "군포시", "김포시", "남양주시", "동두천시", "부천시", "성남시", "수원시", "시흥시", "안산시", "안성시", "안양시", "양주시", "양평군", "여주시", "연천군", "오산시", "용인시", "의왕시", "의정부시", "이천시", "파주시", "평택시", "포천시", "하남시", "화성시"
]},
{"강원도":[
"원주시", "춘천시", "강릉시", "동해시", "속초시", "삼척시", "홍천군", "태백시", "철원군", "횡성군", "평창군", "영월군", "정선군", "인제군", "고성군", "양양군", "화천군", "양구군"
]},
{"충청북도":[
"청주시", "충주시", "제천시", "보은군", "옥천군", "영동군", "증평군", "진천군", "괴산군", "음성군", "단양군"
]},
{"충청남도":[
"천안시", "공주시", "보령시", "아산시", "서산시", "논산시", "계룡시", "당진시", "금산군", "부여군", "서천군", "청양군", "홍성군", "예산군", "태안군"
]},
{"경상북도":[
"포항시", "경주시", "김천시", "안동시", "구미시", "영주시", "영천시", "상주시", "문경시", "경산시", "군위군", "의성군", "청송군", "영양군", "영덕군", "청도군", "고령군", "성주군", "칠곡군", "예천군", "봉화군", "울진군", "울릉군"
]},
{"경상남도":[
"창원시", "김해시", "진주시", "양산시", "거제시", "통영시", "사천시", "밀양시", "함안군", "거창군", "창녕군", "고성군", "하동군", "합천군", "남해군", "함양군", "산청군", "의령군"
]},
{"전라북도":[
"전주시", "익산시", "군산시", "정읍시", "완주군", "김제시", "남원시", "고창군", "부안군", "임실군", "순창군", "진안군", "장수군", "무주군"
]},
{"전라남도":[
"여수시", "순천시", "목포시", "광양시", "나주시", "무안군", "해남군", "고흥군", "화순군", "영암군", "영광군", "완도군", "담양군", "장성군", "보성군", "신안군", "장흥군", "강진군", "함평군", "진도군", "곡성군", "구례군"
]},
{"제주특별자치도":[
"제주시", "서귀포시"
]}
]
}
\ No newline at end of file