You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

97 lines
4.1 KiB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
  6. <!--<meta http-equiv="refresh" content="5">-->
  7. <link rel="stylesheet" type="text/css" href="public/css/main.css"/>
  8. <link rel="stylesheet" type="text/css" href="public/css/master.css"/>
  9. <link rel="stylesheet" type="text/css" href="public/css/ui-base.css"/>
  10. <link rel="stylesheet" type="text/css" href="public/css/ui-box.css"/>
  11. <link rel="stylesheet" type="text/css" href="public/css/ui-color.css"/>
  12. <style type="text/css">
  13. body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微软雅黑";}
  14. </style>
  15. <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=lbnOVuOdm1XmZLkI38UKuvSw3DyHUltq"></script>
  16. <title>我要找车</title>
  17. </head>
  18. <body>
  19. <div style="width: 100%;height: 0.5rem;position: fixed;z-index: 2;top: 0;background-color: rgba(0,0,0,0.6);line-height: 0.5rem;">
  20. <img style="width: 0.12rem;margin-left: 0.2rem;" src="images/a3/img_pro_d.png"/>
  21. <span style="color: #ccc;font-size: 0.14rem;margin-left: 0.05rem;" id="bus_name">赵师傅</span>
  22. <span style="color: #eee;font-size: 0.14rem;margin-left: 0.1rem;" id="bus_num">沪A12345</span>
  23. <!--<a id="call_phone" href="tel:"><img style="text-align: right;height: 0.5rem;float: right;" src="images/a6/ic_call.png"/></a>-->
  24. </div>
  25. <div id="allmap"></div>
  26. <div style="width: 100%;height: 0.5rem;background-color: #3d434f;position: fixed;bottom: 0;">
  27. <div id="check" style="float: left;width: 50%;height: 0.5rem;text-align: center;"><img style="width: 0.22rem;margin-top: 0.14rem;margin-left: 0.3rem;" src="images/a1/ic_refresh.png"/></div>
  28. <a id="call_phone" href="tel:"><div style="float: left;width: 50%;height: 0.5rem;text-align: center;"><img style="width: 0.22rem;margin-top: 0.14rem;margin-right: 0.3rem;" src="images/a1/ic_call.png"/></div></a>
  29. </div>
  30. </body>
  31. <script src="public/js/jquery-2.2.4.min.js" type="text/javascript" charset="utf-8"></script>
  32. <script src="public/js/main.js" type="text/javascript" charset="utf-8"></script>
  33. <script src="public/js/rem.js" type="text/javascript" charset="utf-8"></script>
  34. <script type="text/javascript">
  35. var bus_num = getStorage("bus_num");
  36. var bus_name = getStorage("bus_name");
  37. var bus_phone = getStorage("bus_phone");
  38. $("#call_phone").attr("href","tel:"+bus_phone);
  39. $("#bus_name").text(bus_name);
  40. $("#bus_num").text(bus_num);
  41. // var map = new BMap.Map("allmap");
  42. // var point = new BMap.Point(121.48789949,31.24916171);
  43. // map.centerAndZoom(point,12);
  44. // var bounds = null;
  45. // var linesPoints = null;
  46. search_bus();
  47. $("#check").click(function(){
  48. search_bus();
  49. })
  50. function search_bus(){
  51. var geolocation = new BMap.Geolocation();
  52. $.ajax({
  53. url:base_api+"./application/custom_made/control.php",
  54. type:'post',
  55. dataType: "json",
  56. data:{bus_no:bus_num,type:"travel_getposition"},
  57. success : function(data) {
  58. // 百度地图API功能
  59. var map = new BMap.Map("allmap");
  60. map.centerAndZoom(new BMap.Point(116.404, 39.915), 11);
  61. // 添加带有定位的导航控件
  62. var navigationControl = new BMap.NavigationControl({
  63. // 靠左上角位置
  64. anchor: BMAP_ANCHOR_TOP_LEFT,
  65. // LARGE类型
  66. type: BMAP_NAVIGATION_CONTROL_LARGE,
  67. // 启用显示定位
  68. enableGeolocation: true
  69. });
  70. map.addControl(navigationControl);
  71. // 添加定位控件
  72. var geolocationControl = new BMap.GeolocationControl();
  73. geolocationControl.addEventListener("locationSuccess", function(e){
  74. // 定位成功事件
  75. var address = '';
  76. address += e.addressComponent.province;
  77. address += e.addressComponent.city;
  78. address += e.addressComponent.district;
  79. address += e.addressComponent.street;
  80. address += e.addressComponent.streetNumber;
  81. alert("当前定位地址为:" + address);
  82. });
  83. geolocationControl.addEventListener("locationError",function(e){
  84. // 定位失败事件
  85. alert(e.message);
  86. });
  87. map.addControl(geolocationControl);
  88. }
  89. })
  90. }
  91. </script>
  92. </html>