PageSourceSearch

https://m.thankqcamping.com/js/m_map.js?version=20260914-1

js thankqcamping.com collected 2026-09-24 12:07:02 UTC 9,399 bytes, 335 lines download raw bytes

1var oMarkerCnt = 0
2var camp_tot_cnt
3var oSeq
4var oCnm
5var oRmk
6var oPic
7var oAddr
8var marker
9var infowindow
10var map, position, mapType, mapLevel, rvo
11mapLevel = 3 
12
13//셋팅
14function Init(cnt) {
15	oSeq = new Array(cnt)
16	oCnm = new Array(cnt)
17	oRmk = new Array(cnt)
18	oPic = new Array(cnt)
19	oAddr = new Array(cnt)
20	marker = new Array(cnt)
21	infowindow = new Array(cnt)
22}
23//초기화
24/*
25function MapInit(seq,tp) {
26	getMapType(tp)
27	getLatLng(seq)
28}
29*/
30function MapInit(tp,tmp_x,tmp_y,tp) {
31	getMapType(tp)
32	mapPosition(tmp_x,tmp_y)
33	mapSet()
34	setMarker(tmp_x,tmp_y,-1,tp)
35}
36
37//지도위치
38function mapPosition(tmp_x,tmp_y) {
39	position = new daum.maps.LatLng(tmp_y, tmp_x); 	
40}
41
42//지도타입
43function getMapType(tp) {
44	switch(tp) {
45		case "R": mapType = 1; break;
46		case "S": mapType = 2; break;
47		case "H": mapType = 3; break;
48	}	
49}
50
51//지도생성
52function mapSet() {
53	map = new daum.maps.Map(document.getElementById('map'), { 
54	center: position, 
55	level: mapLevel, 
56	mapTypeId: mapType
57	//ROADMAP 일반 지도, SKYVIEW 스카이뷰, HYBRID 중첩
58	}); 
59	
60	//map.addControl(new daum.maps.ZoomControl(), 5)
61	//map.addControl(new daum.maps.MapTypeControl(), 5)
62	
63	rvo = new daum.maps.RoadviewOverlay()
64	daum.maps.event.addListener(map,"click",function(event){
65		if(document.getElementById("roadViewTp").innerHTML=="Y") {
66			tmp_lng = event.latLng.getLng()
67			tmp_lat = event.latLng.getLat()
68			RoadViewSet(tmp_lng,tmp_lat)
69		}
70	});
71	daum.maps.event.addListener(map,"moveend",function(){
72			tmpLatLng = map.getCenter()
73			document.getElementById("lat").innerHTML = tmpLatLng.getLat()
74			document.getElementById("lng").innerHTML = tmpLatLng.getLng()
75	});
76	daum.maps.event.addListener(map,"zoom_changed",function(){
77			//alert(map.getLevel())
78	});
79	daum.maps.event.addListener(map,"center_changed",function(){
80			tmpLatLng = map.getCenter()
81			document.getElementById("lat").innerHTML = tmpLatLng.getLat()
82			document.getElementById("lng").innerHTML = tmpLatLng.getLng()
83	});
84}
85
86//로드뷰 선
87function RoadViewLine() {
88	if(document.getElementById("roadViewTp").innerHTML=="N") {
89		rvo.setMap(map)	
90	} else {
91		rvo.setMap()
92	}
93}
94
95//지도타입변경
96function mapTypeMod(tp) {
97	if(document.getElementById('mapTp').innerHTML=="RoadView") {
98		document.getElementById('mapTp').innerHTML = tp
99		getLatLng(document.form.campseq.value)
100	} else {
101		getMapType(tp)
102		map.setMapTypeId(mapType)
103	}
104}
105
106//레벨수정
107function mapLevelMod(tp) {
108	if(tp=="P") {
109		if(parseInt(mapLevel)-1 > 0) { 
110			mapLevel--;
111			map.setLevel(mapLevel);
112		} else {
113			alert("더이상 확대하실 수 없습니다.")
114		}
115	} else {
116		if(parseInt(mapLevel)+1 < 15) {
117			mapLevel++;
118			map.setLevel(mapLevel);
119		} else {
120			alert("더이상 축소하실 수 없습니다.")
121		}
122	}
123}
124
125//마커 설정
126function setMarker(tmp_x,tmp_y,idx,tp) {
127	var pos = new daum.maps.LatLng(tmp_y, tmp_x); 
128	if (idx<0) {
129		Mico = "/images/black_dot.png"
130		idx = 0
131	}
132	else {
133		Mico = "/images/black_dot.png"
134	}
135	var icon = new daum.maps.MarkerImage(Mico,
136	new daum.maps.Size(8,8),
137	new daum.maps.Point(4,0)
138	)
139	if(tp=="P") {
140		marker[idx] = new daum.maps.Marker({ 
141			position: pos,
142			image:icon
143		}); 
144	} else {
145		marker[idx] = new daum.maps.Marker({ 
146			position: pos
147		}); 
148	}
149	marker[idx].setMap(map);
150	//marker[idx].setTitle(oCnm[idx]);
151	daum.maps.event.addListener(marker[idx],"click",function(){
152		clkInfoWindow(idx)		
153		//document.location.href="campDetail.asp?campseq="+oSeq[idx]
154	});
155}
156
157//정보창 설정
158function setInfoWindow(idx) {
159	infowindow[idx] = new daum.maps.InfoWindow({ 
160	content: getInfoCntnt(oCnm[idx],oRmk[idx],oPic[idx],oAddr[idx],idx)
161	}); 
162	if(idx==0) infowindow[idx].open(map, marker[idx]);
163}
164
165//정보창 클릭시
166function clkInfoWindow(idx) {
167	for(i=0;i<oMarkerCnt;i++){
168		infowindow[i].close(map, marker[i]);
169	}
170	infowindow[idx].open(map, marker[idx]);
171}
172
173
174//지도 설정좌표
175function getLatLng(seq,tp) {
176		$.ajax({
177			type: "POST",
178	    url: "/resv/axMapLatLng.hbb",
179	    data:{seq:seq, tp: tp },
180	    success: onSuccess,
181	    error: onError
182		});
183		
184		function onSuccess(dataobj) {
185			tmp_tp = document.getElementById("mapTp").innerHTML
186			mapLevel = document.getElementById("mapLevel").innerHTML
187
188			if (dataobj != 'N') {
189				arr_dataobj		= dataobj.split('^')
190				oMarkerCnt = arr_dataobj.length
191				for(i=0; i<oMarkerCnt; i++) {
192					arr_dataobj_up	= arr_dataobj[i].split('|');
193					tmp_x = arr_dataobj_up[0]
194					tmp_y = arr_dataobj_up[1]
195					oSeq[i] = arr_dataobj_up[2]
196					oCnm[i] = arr_dataobj_up[3]
197					oRmk[i] = arr_dataobj_up[4]
198					oPic[i] = arr_dataobj_up[5]
199					oAddr[i] = arr_dataobj_up[6]
200					if(i==0) {
201						MapInit(tmp_tp,tmp_x,tmp_y,tp)
202						c_x = tmp_x
203						c_y = tmp_y
204					} else {
205						setMarker(tmp_x,tmp_y,i,tp)
206					}
207					if (tp!="U") setInfoWindow(i)
208				}
209				//map.setCenter(new daum.maps.LatLng(c_y, c_x))
210				if (tp!="U") {
211					for(i=1; i<oMarkerCnt; i++) {
212						infowindow[i].open(map, marker[i]);//ico_favor.png
213					}
214				}
215			}
216	  }
217	  function onError() {
218		}
219
220}
221
222
223//정보창
224function getInfoCntnt(cnm,rmk,pic,addr,idx) {
225	cntnt  = '<div style="font-size:11px;text-align:center;padding:3px 10px;"><b>'+cnm+'</b></div>'
226	//cntnt  = '<DIV style="color:black;width:165px;">'
227	//cntnt += '	<div style="float:left;font-size:11px;text-align:center;width:130px;margin-top:3px;" onClick="javascript:cback('+oSeq[idx]+');"><b>'+cnm+'</b></a></div>'
228	//cntnt += '	<div style="float:right;padding-right:5px;width:30px;margin-top:5px;" onClick="javascript:cback('+oSeq[idx]+');"><img src="/images/ico_move.png" border="0" style="cursor:hand"></div>';
229	//cntnt += '	<div style="float:right;padding-right:5px;width:15px;margin-top:5px;"><img src="/images/btn_pop_close.gif" border="0" onclick="infowindow['+idx+'].close(map, marker['+idx+']);" style="cursor:hand"></div>';
230	//cntnt += '</div>'
231	return cntnt
232}
233
234//지도이동
235function goCampUrl(url) {
236	opener.location.href=url
237	window.close();
238}
239
240//로드뷰 초기화
241function RoadViewInit(seq) {
242	getRoadViewLatLng(seq)
243}
244
245//로드뷰 생성
246function RoadViewSet(tmp_x,tmp_y) {
247	mapPosition(tmp_x,tmp_y)
248	var rc = new daum.maps.RoadviewClient();
249	var rv = new daum.maps.Roadview(document.getElementById('map'))
250	rc.getNearestPanoId(position,50, function(panoid) {
251		if(panoid) {
252			document.getElementById("map").innerHTML = ""
253			document.getElementById("mapLevel").innerHTML = map.getLevel()
254			document.getElementById("mapControl2").style.display = ""
255			document.getElementById("mapControl").style.display = "none"
256			document.getElementById("mapTp").innerHTML = "RoadView"
257			rv.setPanoId(panoid);
258			//rv.setViewpoint({ pan:0, tilt:0, zoom:0 });
259		} else {
260			alert("로드뷰 서비스지역이 아닙니다.")
261			return
262		}
263	});
264} 
265
266//지도 설정좌표
267function getRoadViewLatLng(seq) {
268	var url = "/resv/axMapLatLng.hbb"
269	var param = "?seq="+seq+"&tp=m"
270  var myAjax = new Ajax.Request(url,{method: 'post', parameters: param , onComplete: cb_getRoadViewLatLng });
271}
272
273//지도 설정좌표 적용
274function cb_getRoadViewLatLng(reqResult) {
275	var frm = document.form
276	var dataobj = reqResult.responseText;	
277	if (dataobj != 'N') {
278		arr_dataobj_up	= dataobj.split('|');
279		tmp_x = arr_dataobj_up[0]
280		tmp_y = arr_dataobj_up[1]
281		RoadViewSet(tmp_x,tmp_y)
282	} else {
283		alert("주소정보가 정확하지 않습니다.");
284	}	
285}	
286
287//지도로 복귀
288function gomap() {
289	document.getElementById("map").innerHTML = ""
290	document.getElementById("mapControl").style.display = ""
291	document.getElementById("mapControl2").style.display = "none"
292	document.getElementById("mapTp").innerHTML = "H"
293	document.getElementById("roadViewTp").innerHTML = "N"
294	document.getElementById("btn_map2").src = "/images/btn_roadview.gif"
295	getLatLng(document.form.campseq.value)
296}
297
298function mapAddr(addr) {
299	var mapContainer = document.getElementById('map'), // 지도를 표시할 div 
300	    mapOption = {
301	        center: new daum.maps.LatLng(33.450701, 126.570667), // 지도의 중심좌표
302	        level: 3 // 지도의 확대 레벨
303	    };  
304	
305	// 지도를 생성합니다    
306	var map = new daum.maps.Map(mapContainer, mapOption); 
307	
308	// 주소-좌표 변환 객체를 생성합니다
309	var geocoder = new daum.maps.services.Geocoder();
310	
311	// 주소로 좌표를 검색합니다
312	geocoder.addressSearch(addr, function(result, status) {
313	
314	    // 정상적으로 검색이 완료됐으면 
315	     if (status === daum.maps.services.Status.OK) {
316	
317	        var coords = new daum.maps.LatLng(result[0].y, result[0].x);
318	
319	        // 결과값으로 받은 위치를 마커로 표시합니다
320	        var marker = new daum.maps.Marker({
321	            map: map,
322	            position: coords
323	        });
324	
325	        // 인포윈도우로 장소에 대한 설명을 표시합니다
326	        //var infowindow = new daum.maps.InfoWindow({
327	            //content: '<div style="width:150px;text-align:center;">우리회사</div>'
328	        //});
329	        //infowindow.open(map, marker);
330	
331	        // 지도의 중심을 결과값으로 받은 위치로 이동시킵니다
332	        map.setCenter(coords);
333	    } 
334	});
335}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.