0
      public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.history);

    cabloc=(TextView)findViewById(R.id.txt_driverLocation);
    cabloc.setText(getIntent().getStringExtra("cabloc"));

    FragmentManager myFragmentManager = getSupportFragmentManager();
    SupportMapFragment myMapFragment 
    = (SupportMapFragment)myFragmentManager.findFragmentById(R.id.map2);
    map = myMapFragment.getMap();

    map.setMyLocationEnabled(true);

    LatLng myPoint= new LatLng(gpsdataElements.latitude, gpsdataElements.logitude);
    Log.d("OpenMapFOrLocation",gpsdataElements.latitude+"  "+gpsdataElements.logitude);
    map.addMarker(new MarkerOptions().title("mylocation").position(myPoint).icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_AZURE)).draggable(true));
    map.moveCamera(CameraUpdateFactory.newLatLngZoom(myPoint, 15));
    // Zoom in, animating the camera.
    map.animateCamera(CameraUpdateFactory.zoomTo(15), 2000, null);


    // TODO Auto-generated method stub
}

在这里,我将目标点设为 cabloc(destination point),它是由上一课的编辑文本传递的。使用这个 cabloc 和我当前的位置,我想画一条路径。是否可以使用传递的意图值绘制路径。请给我看一些例子。我提到了更多的帖子。抱歉再次问这个问题。

4

0 回答 0