@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.act_chat);
}
@Override
onResume() {
if (map != null) {
// Enable MyLocation Button in the Map
map.setMyLocationEnabled(true);
map.getUiSettings().setZoomControlsEnabled(false);
try {
LatLng point = new LatLng(Double.parseDouble(Latreccvier),
Double.parseDouble(Lonreccvier));
BitmapDescriptor icon = BitmapDescriptorFactory
.fromResource(R.drawable.reccivermarker);
MarkerOptions markerOptions = new MarkerOptions();
markerOptions.position(point);
markerOptions.icon(icon);
map.addMarker(markerOptions);
// // Move the camera instantly to hamburg with a zoom of 15.
map.moveCamera(CameraUpdateFactory.newLatLngZoom(point, 14));
map.animateCamera(CameraUpdateFactory.zoomTo(14), 2000, null);
} catch (Exception e) {
}
}
}
@Override
public void RealTimeLocation(int memberId, final double lat, final double lng) {
// TODO Auto-generated method stub
runOnUiThread(new Runnable() {
public void run() {
Latreccvier = String.valueOf(lat);
Lonreccvier = String.valueOf(lng);
LatLng point1=new LatLng(Double.parseDouble(Latreccvier), Double.parseDouble(Lonreccvier));
friendMarker.setPosition(point1);
}
});
}
this is my code i want to draw ply line on google map i am able to move marker at same time i want to draw path of line of moving google map.
public void RealTimeLocation(int memberId, final double lat, final double lng) {
a
using this method i am getting 4 to 5 lat long on Location changed i am trying to add freindlatlong.add(point1);
where freindlatlong is array list according to that i try to add Plyline but not work please suggest me how to draw path line on map.