Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
ltms.eemo.co.kr
/
public_html
/
super
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/ltms.eemo.co.kr/public_html/super/control_center_gps_test2.php
<? include_once("inc_header.php"); // DB ini_set('memory_limit','1024M'); $limit_s = 0; $limit_e = 5000; $tmpQuery = "SELECT * FROM gps_raw WHERE car_sn = 'KLTGC5AHDCK000007' ORDER BY jtime DESC LIMIT $limit_s, $limit_e"; $tmpSql = mysql_query($tmpQuery); $arrData = []; while ($rs = mysql_fetch_assoc($tmpSql)) { $arrData[] = $rs; } $arrData_r = array_reverse($arrData); ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Road API</title> </head> <body> <div id="map_div" ></div> <script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.min.js"></script> <script src="https://apis.openapi.sk.com/tmap/jsv2?version=1&format=javascript&appkey=0bb9345a-7688-4afb-a194-06162c43c434"></script> <script> var map; var latlon_s = new Tmapv2.LatLng(<?=$arrData_r[$limit_s][lat].", ".$arrData_r[$limit_s+1][lon]?>); map = new Tmapv2.Map("map_div", // "map_div" : 지도가 표시될 div의 id { center: latlon_s, // 지도 초기 좌표 width: "100%", // map의 width 설정 height: "100vh" // map의 height 설정 }); <? // 지도 초기화?> function initTmap(){ <? // map 생성?> <? // Tmapv2.Map을 이용하여, 지도가 들어갈 div, 넓이, 높이를 설정합니다.?> var latlon_e = new Tmapv2.LatLng(<?=$arrData_r[$limit_e-2][lat].", ".$arrData_r[$limit_e-1][lon]?>); var size = new Tmapv2.Size(30, 19); // 사이즈 var icon = '/super/img/mark/mark_truck.png'; <? // 차량아이콘?> <? // 차량시작 위치 마커 ?> var marker= new Tmapv2.Marker({ position: latlon_s, <? // 농장위치?> iconSize: size, icon: icon, // title: <?=empty($_REQUEST[car_no]) ? "유령" : $_REQUEST[car_no] ?>, map: map }); marker.create(); <? // 마커생성?> //선 var polyline = new Tmapv2.Polyline({ path: [ <? foreach ($arrData_r as $key => $value) { if($value[lon] == 0.0){ continue; }else { echo "new Tmapv2.LatLng(".$value[lat].", ".$value[lon]."),\n"; } } ?> ], strokeColor: "#3CFBFF", strokeWeight: 6, map: map }); // DB 마지막 위치 정보 map.setZoom(11); map.setCenter(latlon_e); // 현재위치 지도 중심 // 차량 마지막 위치 마커 var marker= new Tmapv2.Marker({ position: latlon_e, <? // 농장위치?> iconSize: size, icon: icon, // title: <?=empty($_REQUEST[car_no]) ? "유령" : $_REQUEST[car_no] ?>, map: map }); marker.create(); <? // 마커생성?> } //지도 생성 initTmap(); </script> </body> </html>