Browse Source

delete test code

git 5 years ago
parent
commit
ceee137a90
1 changed files with 6 additions and 17 deletions
  1. 6 17
      pages/amap/navigation/navigation.js

+ 6 - 17
pages/amap/navigation/navigation.js

@@ -61,7 +61,6 @@
                 renlian.layer.loading(false);
                 renlian.layer.loading(false);
                 
                 
             });
             });
-
             if(!param.startEnd.start){
             if(!param.startEnd.start){
                 renlian.layer.toast('无法获取定位点');
                 renlian.layer.toast('无法获取定位点');
             }
             }
@@ -78,9 +77,7 @@
             } 
             } 
             //根据起终点坐标规划骑行路线
             //根据起终点坐标规划骑行路线
             riding.search(param.startEnd.start, param.startEnd.end, function(status, result) {
             riding.search(param.startEnd.start, param.startEnd.end, function(status, result) {
-                // result即是对应的骑行路线数据信息,相关数据结构文档请参考  https://lbs.amap.com/api/javascript-api/reference/route-search#m_RidingResult
                 if (status === 'complete') {
                 if (status === 'complete') {
-                    // renlian.layer.toast('绘制骑行路线完成:');
                 } else {
                 } else {
                     renlian.layer.toast('骑行路线数据查询失败:' + result);
                     renlian.layer.toast('骑行路线数据查询失败:' + result);
                 }
                 }
@@ -108,14 +105,8 @@
                         userMarker.setPosition(presentLnglat);
                         userMarker.setPosition(presentLnglat);
                         userMarker.setMap(map);
                         userMarker.setMap(map);
                     });
                     });
-
-                    // presentLnglat = new AMap.LngLat(position.coords.longitude, position.coords.latitude);
-                    // userMarker.setPosition(presentLnglat);
-                    // userMarker.setMap(map);
 				};
 				};
 			 
 			 
-				// onError Callback receives a PositionError object
-				//
 				function onError(error) {
 				function onError(error) {
 					console.log('code: '    + error.code    + '\n' +
 					console.log('code: '    + error.code    + '\n' +
 						  'message: ' + error.message + '\n');
 						  'message: ' + error.message + '\n');
@@ -126,21 +117,22 @@
             
             
 
 
 
 
-            
+            get_mobile_gps_location();
             var locationAuto = setInterval(function(){
             var locationAuto = setInterval(function(){
                 if($('.f-page').length < 2){
                 if($('.f-page').length < 2){
                     clearTimeout(locationAuto);
                     clearTimeout(locationAuto);
                 }
                 }
-                if(window.lrmui.isreal){
+                
+                if(!window.lrmui.isreal){
                     get_mobile_gps_location();
                     get_mobile_gps_location();
                     var lnglat = presentLnglat;
                     var lnglat = presentLnglat;
-                    // var lnglat = [113.951104,22.542902];
                     if(!geocoder){
                     if(!geocoder){
                         geocoder = new AMap.Geocoder({
                         geocoder = new AMap.Geocoder({
                             radius: 50 
                             radius: 50 
                         });
                         });
                     }
                     }
                     origin = new Array(lnglat.lat, lnglat.lng);
                     origin = new Array(lnglat.lat, lnglat.lng);
+                    
                     geocoder.getAddress(lnglat, function(status, result) {
                     geocoder.getAddress(lnglat, function(status, result) {
                         if (status === 'complete' && result.regeocode) {
                         if (status === 'complete' && result.regeocode) {
                             var address = result.regeocode.formattedAddress;
                             var address = result.regeocode.formattedAddress;
@@ -149,7 +141,7 @@
                         }else{console.log(JSON.stringify(result))}
                         }else{console.log(JSON.stringify(result))}
                     });
                     });
                 }
                 }
-            }, 2000);
+            }, 6000);
 
 
 
 
 
 
@@ -180,21 +172,18 @@
 					// mapList.item(4).style.display = 'block';
 					// mapList.item(4).style.display = 'block';
 				},function () {
 				},function () {
 					mapList.item(3).style.display = 'none';
 					mapList.item(3).style.display = 'none';
-					// mapList.item(4).style.display = 'none';
 				});
 				});
             }
             }
 
 
             $('#daohang-button').rlpicker({
             $('#daohang-button').rlpicker({
                 data: mapList
                 data: mapList
             },function(map){
             },function(map){
-                renlian.layer.toast(JSON.stringify(originName));
                 appAvailability.check(map,function () {//success callback
                 appAvailability.check(map,function () {//success callback
                     if(!origin){
                     if(!origin){
                         renlian.layer.toast('无法获取定位点');
                         renlian.layer.toast('无法获取定位点');
+                        get_mobile_gps_location();
                         return;
                         return;
                     }
                     }
-                    
-                    
 					if(map == 'com.baidu.BaiduMap'){
 					if(map == 'com.baidu.BaiduMap'){
                         checkBaidu();
                         checkBaidu();
                     }
                     }