如果地图url=null,就url="".然后ArcGisMapFragment根据url是否为空字符串来判定加载http gisurl地图还是 changdi.mmpk; 文件名必须是changdi.mmpk 必须放在包名下
| | |
| | | @Override |
| | | public void callBackMsg(final int cmd, String json) { |
| | | if (cmd!=11 && cmd!=14){ |
| | | String strConent = String.format("收到命令[%d],Json内容为%s,线程号=%d,时间=%s", cmd, json,Thread.currentThread().getId(),Utils.formatTimeYYMMDDHHmmSSSSS(System.currentTimeMillis())); |
| | | String strConent = String.format("收到命令[%d],Json内容为%s", cmd, json); |
| | | if (strConent.equalsIgnoreCase(lastStr)){ |
| | | |
| | | }else{ |
| | |
| | | |
| | | |
| | | FailedProj failedProj = new FailedProj(Constant.SUBJECT_ALL, emp_id, Constant.TEST_STU_ID, utc, sn); |
| | | MyLog.i("插入fail_projects表=$failedProj"); |
| | | MyLog.i("插入fail_projects表="+failedProj.toString()); |
| | | WorkRoomDataBase.getWorkRoomDataBase(getApplicationContext()).getFailProjDao().insert(failedProj); |
| | | |
| | | |
| | |
| | | |
| | | setupMap(); |
| | | |
| | | |
| | | // addTrailheadsLayer(); |
| | | url = Environment.getExternalStorageDirectory().getAbsolutePath()+ File.separator+_mActivity.getPackageName()+"/shoufei0223.mmpk"; |
| | | Log.i(TAG,"url ========="+url); |
| | | if (!TextUtils.isEmpty(url)){ |
| | | MyLog.i(TAG,"现在http加载:"+url); |
| | | addTrailheadsLayer(); |
| | | }else{ |
| | | url = Environment.getExternalStorageDirectory().getAbsolutePath()+ File.separator+_mActivity.getPackageName()+"/changdi.mmpk"; |
| | | MyLog.i(TAG,"现在加载:"+url); |
| | | final MobileMapPackage mobileMapPackage = new MobileMapPackage(url); |
| | | mobileMapPackage.loadAsync(); |
| | | mobileMapPackage.addDoneLoadingListener(()->{ |
| | |
| | | mMapView.setMap(mainArcGismapMMPK); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | return view; |
| | | } |
| | | |
| | |
| | | if (messageRemoteService != null) { |
| | | this.cmd = messageRemoteService.msgCode; |
| | | this.json = messageRemoteService.json; |
| | | MyLog.i(TAG, json); |
| | | |
| | | //太多了 不能打 |
| | | // MyLog.i(TAG, json); |
| | | |
| | | |
| | | RealTimeCarPos timeCarPos = gson.fromJson((String) json, RealTimeCarPos.class); |
| | |
| | | } |
| | | private void readGisCar() { |
| | | |
| | | String carFilePath = Environment.getExternalStorageDirectory().getAbsolutePath()+"/"+_mActivity.getPackageName()+"/gisvehiclemodel.json"; |
| | | String carFilePath = Environment.getExternalStorageDirectory().getAbsolutePath()+"/"+_mActivity.getPackageName()+"/vehiclemodel.json"; |
| | | if (TextUtils.isEmpty(carFilePath)){ |
| | | Toast.makeText(_mActivity, "车辆模型文件不存在", Toast.LENGTH_SHORT).show(); |
| | | MyLog.i (TAG, "GISCar车辆模型文件不存在"); |
| | |
| | | } |
| | | allMap[sanwei] = map.clone(); |
| | | }else{ |
| | | MyLog.i(TAG,String.format("曲线 %d, 点数 %d", sanwei, xys.size()/2)); |
| | | |
| | | Log.i(TAG,String.format("曲线 %d, 点数 %d", sanwei, xys.size()/2)); |
| | | map_other = new double[xys.size()/2][2]; |
| | | allOtherMap[sanwei] = new double[xys.size()/2][2]; |
| | | |
| | |
| | | item_conents.add(f.getItem_content()); |
| | | Collections.sort(mArrayList); |
| | | mScoreAdapter.addDatas(mArrayList); |
| | | MyLog.i("item_score="+item_id); |
| | | } |
| | | MyLog.i("没扣分之前得分:"+currTotalScore); |
| | | currTotalScore -=item_id; |
| | |
| | | } |
| | | |
| | | private void startArcGisMapFragment(String url) { |
| | | if (TextUtils.isEmpty(url)){ |
| | | if (url==null){ |
| | | |
| | | url = "http://arcgis.aaej.cn/arcgis/rest/services/高庙村首飞驾校科二地图/MapServer"; |
| | | url =""; |
| | | } |
| | | if (!TextUtils.isEmpty(url)) { |
| | | |
| | | ArcGisMapFragment jiaXiaoFragment = findFragment(ArcGisMapFragment.class); |
| | | if (jiaXiaoFragment == null) { |
| | | jiaXiaoFragment = (ArcGisMapFragment) ArcGisMapFragment.newInstance(url); |
| | | } |
| | | start(jiaXiaoFragment); |
| | | }else{ |
| | | Toast.makeText(_mActivity, "错误:ArcGIS URL 为空!", Toast.LENGTH_SHORT).show(); |
| | | |
| | | MapFragment jiaXiaoFragment = findFragment(MapFragment.class); |
| | | if (jiaXiaoFragment == null) { |
| | | jiaXiaoFragment = (MapFragment) MapFragment.newInstance(); |
| | | } |
| | | start(jiaXiaoFragment); |
| | | } |
| | | // }else{ |
| | | // Toast.makeText(_mActivity, "错误:ArcGIS URL 为空!", Toast.LENGTH_SHORT).show(); |
| | | // |
| | | // MapFragment jiaXiaoFragment = findFragment(MapFragment.class); |
| | | // if (jiaXiaoFragment == null) { |
| | | // jiaXiaoFragment = (MapFragment) MapFragment.newInstance(); |
| | | // } |
| | | // start(jiaXiaoFragment); |
| | | // } |
| | | } |
| | | |
| | | private String getArcGisUrl(int examType) { |
| | |
| | | |
| | | //反转义 |
| | | byte[] datas=messageEscaper.unescape(message); |
| | | MyLog.i(PlatFormConstant.TAG,"服务消息:"+ BytesUtils.bytesToHexString(datas)); |
| | | // MyLog.i(PlatFormConstant.TAG,"服务消息:"+ BytesUtils.bytesToHexString(datas)); |
| | | JK2019MessageBase jk2019MessageBase = MessageManager.get(BytesUtils.bytesToHexString(datas)); |
| | | if (jk2019MessageBase instanceof JKMessage8100){ |
| | | if (((JKMessage8100) jk2019MessageBase).result == JKMessage8100.SUCCESS){ |
| | |
| | | sendMessage(jkMessage0101); |
| | | ExamPlatformData.getInstance().setExamplatformStatus(ExamPlatformData.DEV_REGISTERED); |
| | | }else{ |
| | | MyLog.i(PlatFormConstant.TAG,"设备未注册"); |
| | | ExamPlatformData.getInstance().setExamplatformStatus(ExamPlatformData.DEV_NOT_REGISTERED); |
| | | } |
| | | }else if (jk2019MessageBase instanceof JKMessage8001){ |
| | |
| | | return; |
| | | } |
| | | try { |
| | | MyLog.i(PlatFormConstant.TAG, "客户端消息(转义后):"+ BytesUtils.bytesToHexString(msg)); |
| | | //0206消息太多了 ,再说打了消息内容也看不懂,不打了 21/4/15 |
| | | // MyLog.i(PlatFormConstant.TAG, "客户端消息(转义后):"+ BytesUtils.bytesToHexString(msg)); |
| | | ByteBuf byteBuf = ByteBufAllocator.DEFAULT.ioBuffer(); |
| | | byteBuf.writeBytes(msg); |
| | | channel.writeAndFlush(byteBuf); |