当前位置: 首页>>代码示例>>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;未经允许,请勿转载。