删除折线google map v2 android的问题

Viv*_*der 10 android google-maps android-maps-v2

我正在添加折线选项,就像谷歌开发者的网站一样.

PolylineOptions rectOptions = new PolylineOptions()
        .add(new LatLng(37.35, -122.0))
        .add(new LatLng(37.45, -122.0))  // North of the previous point, but at the same longitude
        .add(new LatLng(37.45, -122.2))  // Same latitude, and 30km to the west
        .add(new LatLng(37.35, -122.2))  // Same longitude, and 16km to the south
        .add(new LatLng(37.35, -122.0)); // Closes the polyline.

// Get back the mutable Polyline
Polyline polyline = myMap.addPolyline(rectOptions);
Run Code Online (Sandbox Code Playgroud)

我想删除它.但是rectOptions.remove() 我没有在谷歌地图Android API v2中提到我的sdk更新谷歌播放服务,如何从地图中删除多线? 但我仍然没有.从SDK管理器更新后我应该做些什么吗?我真的需要删除它而不是让它不可见以节省内存因为我会多次显示许多点的路径.

Mok*_*kus 11

要删除Polyline,请使用polyline.remove();