//------------------------------------------------------------------------------- // get data path_data only output by full (p11)_data field from skin_function //------------------------------------------------------------------------------- function get_posdata( posdata ){ // eq. posArray[pathdata] = posdata ; map_pos.php에서 사용 var posArray = new Array() // var callpos_data = new Array() if( posdata && posdata.indexOf("|")!=-1 ){ callpos_data = posdata.split('|'); } // posArray['x'] = check_empty( callpos_data[0] ); posArray['y'] = check_empty( callpos_data[1] ); posArray['level'] = check_empty( callpos_data[2] ); posArray['km'] = check_empty( callpos_data[3] ); posArray['hour'] = check_empty( callpos_data[4] ); posArray['min'] = check_empty( callpos_data[5] ); posArray['pan'] = check_empty( callpos_data[6] ); posArray['tilt'] = check_empty( callpos_data[7] ); posArray['zoom'] = check_empty( callpos_data[8] ); posArray['panoId'] = check_empty( callpos_data[9] ); posArray['cctvid'] = check_empty( callpos_data[10] ); posArray['tvname'] = check_empty( callpos_data[11] ); posArray['tvcenter'] = check_empty( callpos_data[12] ); posArray['tvx'] = check_empty( callpos_data[13] ); posArray['tvy'] = check_empty( callpos_data[14] ); posArray['tvloc'] = check_empty( callpos_data[15] ); posArray['tvip'] = check_empty( callpos_data[16] ); posArray['tvport'] = check_empty( callpos_data[17] ); posArray['tvch'] = check_empty( callpos_data[18] ); posArray['tvid'] = check_empty( callpos_data[19] ); posArray['tvpass'] = check_empty( callpos_data[20] ); posArray['tvmovie'] = check_empty( callpos_data[21] ); posArray['tvkind'] = check_empty( callpos_data[22] ); // posArray['xy'] = ""; for(k=0;k<=1;k++){ posArray['xy'] += check_empty( callpos_data[k] ) + "|"; } posArray['xy'] += check_empty( callpos_data[2] ) posArray['rv'] = ""; for(k=6;k<=8;k++){ posArray['rv'] += check_empty( callpos_data[k] ) + "|"; } posArray['rv'] += check_empty( callpos_data[9] ); posArray['cctv'] = ""; for(k=10;k<=21;k++){ posArray['cctv'] += check_empty( callpos_data[k] ) + "|"; } posArray['cctv'] += check_empty( callpos_data[22] ); // return posArray; } //------------------------------------------------------------------------------- // get from full data of (p11)_data field from skin function //------------------------------------------------------------------------------- function get_pathdata( pathdata ){ // var posArray = new Array() //alert( pathdata ) if(pathdata && pathdata.indexOf('|')!=-1){ var datasrc = pathdata.split('|'); //console.log( datasrc ) // posArray['gno'] = datasrc[0]; posArray['name'] = datasrc[1]; posArray['icon'] = datasrc[2]; posArray['rosign'] = datasrc[3]; posArray['rono'] = datasrc[4]; posArray['roname'] = datasrc[5]; // posArray['x'] = datasrc[6]; //경도 posArray['y'] = datasrc[7]; //위도 // posArray['level'] = datasrc[8]; // map zoom // posArray['km'] = datasrc[9]; posArray['hour'] = datasrc[10]; posArray['min'] = datasrc[11]; // posArray['pan'] = datasrc[12]; posArray['tilt'] = datasrc[13]; posArray['zoom'] = datasrc[14]; // roadview zoom posArray['panoId'] = datasrc[15]; var re_data = ''; for(k=6;k<=28;k++){ re_data += datasrc[k] + "|"; } // var getpos = get_posdata( re_data ); // posArray['pathdata'] = re_data; posArray['xy'] = getpos['xy']; posArray['rv'] = getpos['rv']; posArray['cctv'] = getpos['cctv']; } return posArray; } function check_empty(val){ if(val=='undefined' || val==undefined || val=='null'){ val = ''; } return val; } function trans_gCctv(cctvpos){ //----------------------------------------- // db data string(utic) convert to utic map //----------------------------------------- var gCctv = []; if( cctvpos.indexOf('|')==-1){ return gCctv; } var callpos_data = cctvpos.split('|'); // if(callpos_data[1] == null){ return gCctv; } // 13 data gCctv.CCTVID = check_empty( callpos_data[0] ); gCctv.CCTVNAME = check_empty( callpos_data[1] ); gCctv.CENTERNAME = check_empty( callpos_data[2] ); gCctv.XCOORD = check_empty( callpos_data[3] ); gCctv.YCOORD = check_empty( callpos_data[4] ); gCctv.LOCATE = check_empty( callpos_data[5] ); gCctv.CCTVIP = check_empty( callpos_data[6] ); gCctv.PORT = check_empty( callpos_data[7] ); gCctv.CH = check_empty( callpos_data[8] ); gCctv.ID = check_empty( callpos_data[9] ); gCctv.PASSWD = check_empty( callpos_data[10] ); gCctv.MOVIE = check_empty( callpos_data[11] ); gCctv.KIND = check_empty( callpos_data[12] ); // return gCctv; } function convert_gCctv(itsraw){ //----------------------------------------- // its convert to utic map //----------------------------------------- var gCctv = []; gCctv.CENTERNAME = check_empty( itsraw.N_centername ); gCctv.CCTVID = check_empty( itsraw.N_cctvid ); gCctv.CCTVNAME = check_empty( itsraw.cctvname ); gCctv.CH = check_empty( itsraw.N_ch ); gCctv.MOVIE = check_empty( itsraw.N_movie ); gCctv.XCOORD = check_empty( itsraw.coordx ); gCctv.YCOORD = check_empty( itsraw.coordy ); gCctv.KIND = check_empty( itsraw.N_kind ); gCctv.ID = check_empty( itsraw.N_id ); gCctv.STRMID = check_empty( itsraw.N_strmid ); gCctv.PORT = check_empty( itsraw.N_port ); gCctv.PASSWD = check_empty( itsraw.N_passwd ); gCctv.CCTVIP = check_empty( itsraw.N_cctvip ); // return gCctv; } function get_cctvurl( streamInfo, stype ){ // if(stype=='live'){ var url = 'https://www.utic.go.kr:449/view/map/cctvStream.jsp?key=' + key+ '&cctvid=' + streamInfo.gCctvId + '&cctvName=' + encodeURI(encodeURIComponent(streamInfo.gCctvName)) + '&kind=' + streamInfo.gKind + '&cctvip=' + streamInfo.gCctvIp + '&cctvch=' + streamInfo.gCh + '&id=' + streamInfo.gId + '&cctvpasswd=' + streamInfo.gPasswd + '&cctvport=' + streamInfo.gPort; } else { var url = 'https://www.utic.go.kr:449/view/map/openDataCctvStream.jsp?key=' + key+ '&cctvid=' + streamInfo.gCctvId + '&cctvName=' + encodeURI(encodeURIComponent(streamInfo.gCctvName)) + '&kind=' + streamInfo.gKind + '&cctvip=' + streamInfo.gCctvIp + '&cctvch=' + streamInfo.gCh + '&id=' + streamInfo.gId + '&cctvpasswd=' + streamInfo.gPasswd + '&cctvport=' + streamInfo.gPort; } //2020-01-16 live base로 변경 var url = 'http://www.utic.go.kr/view/map/cctvStream.jsp?key=' + key+ '&cctvid=' + streamInfo.gCctvId + '&cctvName=' + encodeURI(encodeURIComponent(streamInfo.gCctvName)) + '&kind=' + streamInfo.gKind + '&cctvip=' + streamInfo.gCctvIp + '&cctvch=' + streamInfo.gCh + '&id=' + streamInfo.gId + '&cctvpasswd=' + streamInfo.gPasswd + '&cctvport=' + streamInfo.gPort; // return url; } function get_cctvinfo(cctvid){ // var ccthis = []; // id or gCctv of Json Set Data if(cctvid.CCTVID != null) { var gCctv = cctvid; } else { var gCctv = cctv.getCctv(cctvid); } // if(gCctv == null){ return ccthis; } // ccthis.gWidth = "320"; ccthis.gHeight = "245"; ccthis.gCctvId = gCctv.CCTVID; ccthis.gCctvName = gCctv.CCTVNAME; ccthis.gCenterName = gCctv.CENTERNAME; ccthis.gDx = gCctv.XCOORD; ccthis.gDy = gCctv.YCOORD; ccthis.gLocate = gCctv.LOCATE; ccthis.gCctvIp = gCctv.CCTVIP; ccthis.gPort = gCctv.PORT; ccthis.gCh = gCctv.CH; ccthis.gId = gCctv.ID; ccthis.gPasswd = gCctv.PASSWD; ccthis.gMovie = gCctv.MOVIE; // var CctvCode = ccthis.gCctvId.substring(0, 3); if(CctvCode == 'L01'){ ccthis.gKind = 'Seoul'; } else if(CctvCode == 'L02'){ ccthis.gKind = 'N'; } else if(CctvCode == 'L03'){ ccthis.gKind = 'O'; } else if(CctvCode == 'L04'){ ccthis.gKind = 'P'; } else if(CctvCode == 'L08'){ ccthis.gKind = 'd'; } else{ ccthis.gKind = gCctv.KIND; } // return ccthis; } // [방어용] mapcate 사전설정이 안된 경우 : 조건 변경시 코드 조정 function get_mapcate(rawcctv) { // var mapcate = ""; // if( rawcctv && rawcctv.cctvurl!=null ) { // ITS DATA if( rawcctv.cctvformat.toUpperCase()=="MP4" || rawcctv.cctvtype != 3 ) { if( rawcctv.cctvname.indexOf("국도")!=-1 ){ // cctvname : [국도 1호선] 논산 고정삼거리 mapcate = "glive_its"; } else { mapcate = "glive_ex"; } } else { if( rawcctv.cctvname.indexOf("국도")!=-1 ){ mapcate = "glive_its"; } else { mapcate = "glive_ex"; } } } else if( rawcctv && rawcctv.length>0 ){ mapcate = "gmap_utic"; } // return mapcate; } var timeoutID; function get_cctvstatus(){ $('iframe').attr('allowFullScreen', 1); /* var ifrm = document.getElementById('frame_cctv'); var iframeDoc = ifrm.contentDocument || ifrm.contentWindow.document; var scode = iframeDoc.readyState console.log( scode + ' : ' + ifrm.src ) if ( scode == 'complete' ) { window.clearTimeout(timeoutID); console.log( 'finish' ) } else { // timeoutID = window.setTimeout(get_cctvstatus, 1000); } */ } function get_cctvpop( streamInfo, cctv_url, popmode ){ var size_outbox = {w:'340px', h:'300px'} var size_framebox = {w:'330px', h:'245px', t:'35px', L:'15px'} var size_frame = {w:'330px', h:'245px', b:'0px', L:'0px'} var size_footer = {w:'340px', h:'30px', t:'290px'} // 사이즈 : 다음 CCTV BOX : 308x205 -> 영상 : 311x175, 카맵 : 320x165 if( streamInfo.gCenterName.indexOf('국가교통정보센터')!=-1 ){ /* size_outbox.h = '270px' size_framebox.h = '240px' size_frame.h = '280px' size_footer.t = '260px'; */ } var copyright = '경찰청 교통정보(UTIC)'; if( cctv_url.indexOf("utic.go.kr")!=-1 ){ //copyright += ' ' + streamInfo.gCenterName; size_framebox = {w:'330px', h:'245px', t:'35px', L:'15px'} size_frame = {w:'330px', h:'290px', b:'0px', L:'0px'} } else { copyright = streamInfo.gCenterName; } // var cctv_frame = '' if( streamInfo.gMovie=="Y" ){ var use_iframe = 1; if(use_iframe){ // cctv_frame = '' + '
'; } else { // cctv_frame = '' + ' '; } } else { size_frame.t = 0; cctv_frame = '' + ' '; } // var cctv_button = '' if(popmode=='edit'){ cctv_button = ''; } else if(popmode=='del'){ cctv_button = ''; } // 커스텀 오버레이에 표시할 내용입니다 var content = ' ' + '