當前位置: 首頁>>代碼示例>>Java>>正文


Java Polyline.remove方法代碼示例

本文整理匯總了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;
}
 
開發者ID:miguelbcr,項目名稱:RxGpsService,代碼行數:18,代碼來源:PlaceMapFragment.java

示例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);
}
 
開發者ID:AdrianBZG,項目名稱:PhoneChat,代碼行數:23,代碼來源:PluginPolyline.java

示例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);
    }
}
 
開發者ID:clementf2b,項目名稱:FaceT,代碼行數:24,代碼來源:NearbyLocationActivity.java

示例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);
        }
    }
}
 
開發者ID:jmarkstar,項目名稱:TuristHelper,代碼行數:26,代碼來源:GoogleMapFragment.java

示例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);
    }
}
 
開發者ID:mvhs-apps,項目名稱:mvhs-app,代碼行數:27,代碼來源:MapActivity.java

示例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();
        }
    }
}
 
開發者ID:Balthair94,項目名稱:AppGoogleMaps,代碼行數:11,代碼來源:MainActivity.java

示例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();
    }
}
 
開發者ID:Ubudu,項目名稱:GoogleMapsLayout-Android,代碼行數:15,代碼來源:MapLayout.java

示例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();
        }
    }
}
 
開發者ID:CMPUT301F16T02,項目名稱:Dryver,代碼行數:13,代碼來源:MapUtil.java

示例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);
        }
        //}
    }
}
 
開發者ID:MarcProe,項目名稱:lp2go,代碼行數:41,代碼來源:MapHelper.java

示例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;
}
 
開發者ID:nogalavi,項目名稱:Bikeable,代碼行數:14,代碼來源:ColorizeUphillSections.java

示例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;
}
 
開發者ID:nogalavi,項目名稱:Bikeable,代碼行數:10,代碼來源:BikeableRoute.java

示例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);
}
 
開發者ID:kyleivey,項目名稱:QueenCityBusChaser,代碼行數:10,代碼來源:MainActivity.java

示例13: cleanup

import com.google.android.gms.maps.model.Polyline; //導入方法依賴的package包/類
void cleanup() {
    for (Polyline polyline : gridLines) {
        polyline.remove();
    }
    gridLines.clear();
}
 
開發者ID:mosquitolabs,項目名稱:referendum_1o_android,代碼行數:7,代碼來源:DebugHelper.java

示例14: remove

import com.google.android.gms.maps.model.Polyline; //導入方法依賴的package包/類
/**
 * Remove from the map
 */
public void remove() {
    for (Polyline polyline : polylines) {
        polyline.remove();
    }
}
 
開發者ID:ngageoint,項目名稱:geopackage-android-map,代碼行數:9,代碼來源:MultiPolyline.java

示例15: removePath

import com.google.android.gms.maps.model.Polyline; //導入方法依賴的package包/類
private Polyline removePath(Polyline polyline) {
    if (polyline != null) {
        polyline.remove();
    }
    return null;
}
 
開發者ID:miguelbcr,項目名稱:RxGpsService,代碼行數:7,代碼來源:PlaceMapFragment.java


注:本文中的com.google.android.gms.maps.model.Polyline.remove方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。