| | |
| | | import android.graphics.Color; |
| | | import android.os.Bundle; |
| | | |
| | | import android.os.Handler; |
| | | import android.os.Message; |
| | | import android.util.Log; |
| | | import android.view.LayoutInflater; |
| | | import android.view.MotionEvent; |
| | |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.ListIterator; |
| | | import java.util.concurrent.Executors; |
| | | import java.util.concurrent.ScheduledExecutorService; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | import me.yokeyword.fragmentation.SupportFragment; |
| | | import safeluck.drive.evaluation.R; |
| | |
| | | private static final String TAG = JiaXiaoFragment.class.getSimpleName(); |
| | | |
| | | private MapView mMapView ; |
| | | private static final int MSG_CAR = 100; |
| | | double yaw = 0; |
| | | |
| | | GraphicsOverlay mGraphicsOverlay; |
| | | private int count =0; |
| | | private double startX = -8647.003,startY = 14590.7213; |
| | | private Handler mHandler = new Handler(){ |
| | | @Override |
| | | public void handleMessage(Message msg) { |
| | | switch (msg.what){ |
| | | case MSG_CAR: |
| | | count++; |
| | | yaw +=count; |
| | | addGraphicLayer(yaw,startX+count,startY+count); |
| | | sendEmptyMessageDelayed(MSG_CAR,1000); |
| | | break; |
| | | } |
| | | } |
| | | }; |
| | | |
| | | PointCollection mPointCollection = new PointCollection(SpatialReference.create(4544)); |
| | | |
| | | |
| | | @Nullable |
| | | @Override |
| | | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { |
| | |
| | | setupMap(); |
| | | addTrailheadsLayer(); |
| | | // addImageLayer(); |
| | | addGraphicLayer(); |
| | | |
| | | mHandler.sendEmptyMessageDelayed(MSG_CAR,1000); |
| | | |
| | | // drawPolygon(); |
| | | return view; |
| | | } |
| | |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | private void addGraphicLayer(){ |
| | | private void addGraphicLayer(double yaw,double x,double y){ |
| | | |
| | | SimpleLineSymbol lineSymbol = new SimpleLineSymbol(SimpleLineSymbol.Style.SOLID, Color.rgb(232,0,0), 0.5f); |
| | | SimpleFillSymbol simpleFillSymbol = new SimpleFillSymbol(SimpleFillSymbol.Style.SOLID, Color.argb(255,232,0,0), lineSymbol); |
| | |
| | | Log.i(TAG,"giscar="+buffer.toString()); |
| | | GisCarModel gisCarModel= new Gson().fromJson(buffer.toString(),GisCarModel.class); |
| | | // List<safeluck.drive.evaluation.bean.Point> carNew=Utils.getCarPoint(0,45,new safeluck.drive.evaluation.bean.Point(-8633.77199999988,14471.793700000271)); |
| | | List<safeluck.drive.evaluation.bean.Point> carNew=Utils.getCarPoint(0,45,new safeluck.drive.evaluation.bean.Point(-8647.003,14590.7213)); |
| | | List<safeluck.drive.evaluation.bean.Point> carNew=Utils.getCarPoint(0,yaw,new safeluck.drive.evaluation.bean.Point(x,y)); |
| | | List<Integer> bodys =gisCarModel.getBody(); |
| | | for (int i = 0; i <bodys.size(); i++) { |
| | | Log.i(TAG,String.format("车身点位置:%d",bodys.get(i))); |
| | |
| | | |
| | | drawrightCenterGls(gisCarModel,carNew); |
| | | |
| | | drawPoint(new Point(-8647.003,14590.7213)); |
| | | drawPoint(new Point(x,y)); |
| | | |
| | | } |
| | | }); |