からポリラインを削除し、これは私が持っているものです。私は1つを作成する前に、私の以前に作成したポリラインを削除しようとしているマップ
protected void fazerCaminho(ArrayList<HashMap<String, String>> listaPolylines) {
if (line == null) {
for (Map polyline : listaPolylines) {
List<LatLng> decodedPath = PolyUtil.decode((String) polyline.get("points"));
line = mMap.addPolyline(new PolylineOptions()
.width(3)
.color(Color.rgb(25, 151, 152))
.geodesic(true)
.addAll(decodedPath));
}
} else {
line.remove();
for (Map polyline : listaPolylines) {
List<LatLng> decodedPath = PolyUtil.decode((String) polyline.get("points"));
line = mMap.addPolyline(new PolylineOptions()
.width(3)
.color(Color.rgb(25, 151, 152))
.geodesic(true)
.addAll(decodedPath));
}
}
}
line.removeが動作しない、このソリューションは、以前のバージョンで働いていましたしかし、当時私はその方法を持っていなかったのですが、何が間違っていますか?
あなただけ – Nizam
このhttp://stackoverflow.com/questions/14853084/howをチェックアウトし、最後の行を削除しますマップからポリラインをすべて削除する –
[マップからすべてのポリラインを削除する方法]の複製可能性(http://stackoverflow.com/questions/14853084/how-to-remove- all-the-polylines-from-a-map) – Nizam