|
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
- <!--<meta http-equiv="refresh" content="5">-->
- <link rel="stylesheet" type="text/css" href="public/css/main.css"/>
- <link rel="stylesheet" type="text/css" href="public/css/master.css"/>
- <link rel="stylesheet" type="text/css" href="public/css/ui-base.css"/>
- <link rel="stylesheet" type="text/css" href="public/css/ui-box.css"/>
- <link rel="stylesheet" type="text/css" href="public/css/ui-color.css"/>
- <style type="text/css">
- body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微软雅黑";}
- </style>
- <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=lbnOVuOdm1XmZLkI38UKuvSw3DyHUltq"></script>
- <title>我要找车</title>
- </head>
- <body>
- <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;">
- <img style="width: 0.12rem;margin-left: 0.2rem;" src="images/a3/img_pro_d.png"/>
- <span style="color: #ccc;font-size: 0.14rem;margin-left: 0.05rem;" id="bus_name">赵师傅</span>
- <span style="color: #eee;font-size: 0.14rem;margin-left: 0.1rem;" id="bus_num">沪A12345</span>
- <!--<a id="call_phone" href="tel:"><img style="text-align: right;height: 0.5rem;float: right;" src="images/a6/ic_call.png"/></a>-->
- </div>
- <div id="allmap"></div>
- <div style="width: 100%;height: 0.5rem;background-color: #3d434f;position: fixed;bottom: 0;">
- <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>
- <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>
- </div>
- </body>
- <script src="public/js/jquery-2.2.4.min.js" type="text/javascript" charset="utf-8"></script>
- <script src="public/js/main.js" type="text/javascript" charset="utf-8"></script>
- <script src="public/js/rem.js" type="text/javascript" charset="utf-8"></script>
- <script type="text/javascript">
-
- var bus_num = getStorage("bus_num");
- var bus_name = getStorage("bus_name");
- var bus_phone = getStorage("bus_phone");
- $("#call_phone").attr("href","tel:"+bus_phone);
- $("#bus_name").text(bus_name);
- $("#bus_num").text(bus_num);
- // var map = new BMap.Map("allmap");
- // var point = new BMap.Point(121.48789949,31.24916171);
- // map.centerAndZoom(point,12);
- // var bounds = null;
- // var linesPoints = null;
- search_bus();
- $("#check").click(function(){
- search_bus();
- })
-
- function search_bus(){
-
- var geolocation = new BMap.Geolocation();
- $.ajax({
- url:base_api+"./application/custom_made/control.php",
- type:'post',
- dataType: "json",
- data:{bus_no:bus_num,type:"travel_getposition"},
- success : function(data) {
- // 百度地图API功能
- var map = new BMap.Map("allmap");
- map.centerAndZoom(new BMap.Point(116.404, 39.915), 11);
- // 添加带有定位的导航控件
- var navigationControl = new BMap.NavigationControl({
- // 靠左上角位置
- anchor: BMAP_ANCHOR_TOP_LEFT,
- // LARGE类型
- type: BMAP_NAVIGATION_CONTROL_LARGE,
- // 启用显示定位
- enableGeolocation: true
- });
- map.addControl(navigationControl);
- // 添加定位控件
- var geolocationControl = new BMap.GeolocationControl();
- geolocationControl.addEventListener("locationSuccess", function(e){
- // 定位成功事件
- var address = '';
- address += e.addressComponent.province;
- address += e.addressComponent.city;
- address += e.addressComponent.district;
- address += e.addressComponent.street;
- address += e.addressComponent.streetNumber;
- alert("当前定位地址为:" + address);
- });
- geolocationControl.addEventListener("locationError",function(e){
- // 定位失败事件
- alert(e.message);
- });
- map.addControl(geolocationControl);
- }
- })
- }
- </script>
- </html>
|