本文整理匯總了Java中com.google.android.gms.maps.model.Polyline.remove方法的典型用法代碼示例。如果您正苦於以下問題:Java Polyline.remove方法的具體用法?Java Polyline.remove怎麽用?Java Polyline.remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.android.gms.maps.model.Polyline
的用法示例。
在下文中一共展示了Polyline.remove方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: drawPath
import com.google.android.gms.maps.model.Polyline; //導入方法依賴的package包/類
private Polyline drawPath(List<LatLong> latLongs, int color, float zIndex, Polyline polyline) {
if (googleMap != null && latLongs != null && !latLongs.isEmpty()) {
PolylineOptions polyLineOptions = new PolylineOptions();
polyLineOptions.width(getResources().getDimension(R.dimen._2dp));
polyLineOptions.color(color);
polyLineOptions.zIndex(zIndex);
for (LatLong latLong : latLongs) {
polyLineOptions.add(new LatLng(latLong.latitude(), latLong.longitude()));
}
if (polyline != null) polyline.remove();
return googleMap.addPolyline(polyLineOptions);
}
return null;
}
示例2: remove
import com.google.android.gms.maps.model.Polyline; //導入方法依賴的package包/類
/**
* Remove the polyline
* @param args
* @param callbackContext
* @throws JSONException
*/
@SuppressWarnings("unused")
private void remove(final JSONArray args, final CallbackContext callbackContext) throws JSONException {
String id = args.getString(1);
Polyline polyline = this.getPolyline(id);
if (polyline == null) {
this.sendNoResult(callbackContext);
return;
}
this.objects.remove(id);
id = "polyline_bounds_" + polyline.getId();
this.objects.remove(id);
polyline.remove();
this.sendNoResult(callbackContext);
}
示例3: onRoutingSuccess
import com.google.android.gms.maps.model.Polyline; //導入方法依賴的package包/類
@Override
public void onRoutingSuccess(ArrayList<Route> route, int j) {
if (polylines.size() > 0) {
for (Polyline poly : polylines) {
poly.remove();
}
}
polylines = new ArrayList<>();
//add route(s) to the map.
for (int i = 0; i < route.size(); i++) {
//In case of more than 5 alternative routes
int colorIndex = i % COLORS.length;
PolylineOptions polyOptions = new PolylineOptions();
polyOptions.color(getResources().getColor(COLORS[colorIndex]));
polyOptions.width(10 + i * 3);
polyOptions.addAll(route.get(i).getPoints());
Polyline polyline = mMap.addPolyline(polyOptions);
polylines.add(polyline);
}
}
示例4: drawRoute
import com.google.android.gms.maps.model.Polyline; //導入方法依賴的package包/類
/** draw the route on the map, if there is a created route,
* It will be removed to create another.
* */
private void drawRoute(List<LatLng> latlngList){
if(latlngList != null){
if(polylineList != null){
for(Polyline polyline : polylineList){
polyline.remove();
}
}
polylineList = new ArrayList<Polyline>();
for (int i = 0; i < latlngList.size() - 1; i++) {
LatLng src = latlngList.get(i);
LatLng dest = latlngList.get(i + 1);
Polyline polyLine = mMap.addPolyline(
new PolylineOptions()
.add(new LatLng(src.latitude, src.longitude), new LatLng(dest.latitude,dest.longitude))
.width(4)
.color(Color.BLUE)
.geodesic(true));
polylineList.add(polyLine);
}
}
}
示例5: clearNav
import com.google.android.gms.maps.model.Polyline; //導入方法依賴的package包/類
private void clearNav() {
mNavigating = false;
mStartingLocation = null;
mStartingLocationButton.setText(R.string.your_location);
hideNav();
mNavSelectionFab.setImageResource(R.drawable.ic_directions_black_24dp);
if (mDestinationMarker != null) {
mDestinationMarker.remove();
mDestinationMarker = null;
}
MapData.cleanTempNodes();
if (mNavPathPolylines != null) {
for (Polyline line : mNavPathPolylines) {
if (line != null) {
line.remove();
}
}
mNavPathPolylines = null;
}
if (mDebugMode) {
getMap().subscribe(this::updateMapOverlays);
}
}
示例6: onDirectionFinderStart
import com.google.android.gms.maps.model.Polyline; //導入方法依賴的package包/類
@Override
public void onDirectionFinderStart() {
callProgressDialog();
if (polylinePaths != null) {
for (Polyline polyline : polylinePaths) {
polyline.remove();
}
}
}
示例7: removePolylinesForPath
import com.google.android.gms.maps.model.Polyline; //導入方法依賴的package包/類
/**
*
* @param path
*/
private void removePolylinesForPath(Path path) {
List<Polyline> polylines = pathVsPolylinesMap.get(path);
Iterator<Polyline> iterator = polylines.iterator();
while(iterator.hasNext()) {
Polyline polyline = iterator.next();
polyline.remove();
iterator.remove();
}
}
示例8: removePolylines
import com.google.android.gms.maps.model.Polyline; //導入方法依賴的package包/類
/**
* Helper function to remove all polylines
*
* @param polylineArrayList
*/
public void removePolylines(ArrayList<Polyline> polylineArrayList) {
if (polylineArrayList.size() != 0) {
for (Polyline polyline : polylineArrayList) {
polyline.remove();
}
}
}
示例9: updatePosition
import com.google.android.gms.maps.model.Polyline; //導入方法依賴的package包/類
public void updatePosition(LatLng s, LatLng e, float deg) {
if (mMap != null) {
PolylineOptions line = new PolylineOptions()
.add(s)
.add(e)
.color(Color.RED);
Polyline pl = mMap.addPolyline(line);
mMapLines.addFirst(pl);
int MAX_LINES = 20;
if (mMapLines.size() > MAX_LINES) {
Polyline del = mMapLines.removeLast();
del.remove();
}
if (mPosMarker != null) {
mPosMarker.remove();
}
mPosMarker = mMap.addMarker(new MarkerOptions()
.position(e)
.flat(true)
.anchor(0.5f, 0.5f)
.rotation(deg)
);
double distance = H.calculationByDistance(s, e);
//if (distance > 0.001) {
CameraUpdate cameraUpdate =
CameraUpdateFactory.newLatLngZoom(e, 19);
final int MAX_ANIMATED_DISTANCE = 200;
if (distance < MAX_ANIMATED_DISTANCE) {
mMap.animateCamera(cameraUpdate);
} else {
mMap.moveCamera(cameraUpdate);
}
//}
}
}
示例10: removeUphillSectionsFromMap
import com.google.android.gms.maps.model.Polyline; //導入方法依賴的package包/類
public void removeUphillSectionsFromMap(){
Log.i("Info:", "removeUphillSectionsFromMap");
if (!isUphillPolylinesAdded){
return;
}
for (Polyline line : uphillPolylines) {
line.setVisible(false);
line.remove();
}
uphillPolylines.removeAll(uphillPolylines);
uphillSections.removeAll(uphillSections);
isUphillPolylinesAdded = false;
}
示例11: removeBikePathFromMap
import com.google.android.gms.maps.model.Polyline; //導入方法依賴的package包/類
public void removeBikePathFromMap() {
if (!isBikePathPolylinesAdded) {
return;
}
for (Polyline line : bikePathPolyLineInRoute) {
line.remove();
}
isBikePathShown = false;
}
示例12: removePath
import com.google.android.gms.maps.model.Polyline; //導入方法依賴的package包/類
private void removePath(int routeId) {
Polyline polyline = dr.pathPolyLines.get(routeId);
if (polyline != null) {
polyline.remove();
}
dr.pathPolyLines.remove(routeId);
}
示例13: cleanup
import com.google.android.gms.maps.model.Polyline; //導入方法依賴的package包/類
void cleanup() {
for (Polyline polyline : gridLines) {
polyline.remove();
}
gridLines.clear();
}
示例14: remove
import com.google.android.gms.maps.model.Polyline; //導入方法依賴的package包/類
/**
* Remove from the map
*/
public void remove() {
for (Polyline polyline : polylines) {
polyline.remove();
}
}
示例15: removePath
import com.google.android.gms.maps.model.Polyline; //導入方法依賴的package包/類
private Polyline removePath(Polyline polyline) {
if (polyline != null) {
polyline.remove();
}
return null;
}