Mapear e mover marcadores usando a API do Google Maps
Eu tenho queescreva uma demo, isso deve funcionar comoMovendo o mapa no voo e precisa desenhar mesma curvaPolyline between two geo points / locations
como você pode ver emimagem abaixo.
Até euwould not mind switching
para algum outro SDK comoMapbox SDK
(Se alguém puderreally help me in getting
O que eu preciso na verdade)
Para desenhar uma polilinha entre dois pontos, estou usando:
private void polyLine() {
LatLng starting = new LatLng(##.######, ##.######);
LatLng ending = new LatLng(##.######, ##.######);
PolylineOptions line = new PolylineOptions().add(starting, ending);
mGoogleMap.addMarker(new MarkerOptions().position(starting).title("Start"));
mGoogleMap.addMarker(new MarkerOptions().position(ending).title("End"));
mGoogleMap.addPolyline(line);
}
Para atualizar o local e animar o marcador, estou usando:
@Override
public void onLocationChanged(Location location)
{
Toast.makeText(this, "Location Changed " + location.getLatitude()
+ location.getLongitude(), Toast.LENGTH_LONG).show();
mLastLocation = location;
if (mCurrLocationMarker != null) {
mCurrLocationMarker.remove();
}
LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
if(ourGlobalMarker == null) { // First time adding marker to map
ourGlobalMarker = mGoogleMap.addMarker(new MarkerOptions().position(latLng)
.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_ROSE)));
MarkerAnimation.animateMarkerToICS(ourGlobalMarker, latLng, new LatLngInterpolator.Spherical());
mGoogleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 18));
} else {
MarkerAnimation.animateMarkerToICS(ourGlobalMarker, latLng, new LatLngInterpolator.Spherical());
mGoogleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 18));
}
}
Meus requisitos:
POLYLINE
1. I have to create a Polyline the same you can see in attached image (curved one)
1.1. Dotted curved (if area not started yet)
1.2. Regular curved (in case area already covered)
MARCADOR ATUAL
2. Showing current Location marker at right side of Polyline
(whereas, I want to show Animate marker on Polyline path)