当前位置: 首页>>代码示例>>Java>>正文


Java PolylineOptions.zIndex方法代码示例

本文整理汇总了Java中com.google.android.gms.maps.model.PolylineOptions.zIndex方法的典型用法代码示例。如果您正苦于以下问题:Java PolylineOptions.zIndex方法的具体用法?Java PolylineOptions.zIndex怎么用?Java PolylineOptions.zIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.android.gms.maps.model.PolylineOptions的用法示例。


在下文中一共展示了PolylineOptions.zIndex方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addPolyline

import com.google.android.gms.maps.model.PolylineOptions; //导入方法依赖的package包/类
/**
 * If an origin and destination exist this will draw a line between them and
 * render the time it takes to reach the {@link DistanceAction#destination}
 */
private void addPolyline() {
    if (this.origin == null || this.destination == null) {
        return;
    }
    releasePolyline();
    this.destination.marker.setTitle(getTitleForDistance(getDistance()));
    this.destination.marker.setSnippet(this.snippet);
    this.destination.marker.showInfoWindow();
    final PolylineOptions polylineOptions = new PolylineOptions();
    polylineOptions.add(this.origin.latLng);
    polylineOptions.add(this.destination.latLng);
    polylineOptions.width(5);
    polylineOptions.color(this.colorAccent);
    polylineOptions.zIndex(1000);
    this.polyline = this.mapController.addPolyline(polylineOptions);
}
 
开发者ID:ZafraniTechLLC,项目名称:Companion-For-PUBG-Android,代码行数:21,代码来源:DistanceAction.java

示例2: toPolyline

import com.google.android.gms.maps.model.PolylineOptions; //导入方法依赖的package包/类
/**
 * Convert a {@link LineString} to a {@link PolylineOptions}
 *
 * @param lineString
 * @return
 */
public PolylineOptions toPolyline(LineString lineString) {

    PolylineOptions polylineOptions = new PolylineOptions();
    Double z = null;

    // Try to simplify the number of points in the line string
    List<Point> points = simplifyPoints(lineString.getPoints());

    for (Point point : points) {
        LatLng latLng = toLatLng(point);
        polylineOptions.add(latLng);
        if (point.hasZ()) {
            z = (z == null) ? point.getZ() : Math.max(z, point.getZ());
        }
    }

    if (lineString.hasZ() && z != null) {
        polylineOptions.zIndex(z.floatValue());
    }

    return polylineOptions;
}
 
开发者ID:ngageoint,项目名称:geopackage-android-map,代码行数:29,代码来源:GoogleMapShapeConverter.java

示例3: drawSubsection

import com.google.android.gms.maps.model.PolylineOptions; //导入方法依赖的package包/类
public static void drawSubsection(GoogleMap map, List<LatLng> coords, int startIndex, int endIndex, int color){
  if(sectionPolyline != null){
    sectionPolyline.remove();
  }

  PolylineOptions line = new PolylineOptions();
  line.geodesic(true);
  line.width(14);
  line.zIndex(100);
  line.color(color);

  int start = startIndex;
  int end = endIndex;

  if(startIndex > endIndex){
    int temp = startIndex;
    start = endIndex;
    end = temp;
  }

  for(LatLng ll : coords.subList(start, end)){
    line.add(ll);
  }

  sectionPolyline = map.addPolyline(line);
}
 
开发者ID:fiskurgit,项目名称:KortidTol,代码行数:27,代码来源:MapTools.java

示例4: drawPath

import com.google.android.gms.maps.model.PolylineOptions; //导入方法依赖的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

示例5: addPolylineToPath

import com.google.android.gms.maps.model.PolylineOptions; //导入方法依赖的package包/类
/**
 *
 * NOTE: cannot draw a polyline if there are no points, or only single point, specified in the PolylineOptions given as argument
 *
 * @param uuid path uuid
 * @param polylineOptions polyline options
 * @return true if polyline has been successfully added to Google Maps, false otherwise
 */
public boolean addPolylineToPath(String uuid, PolylineOptions polylineOptions) {

    if(polylineOptions.getPoints()==null || polylineOptions.getPoints().size()<2) {
        // cannot draw a polyline because there are no points or only single point
        return false;
    }

    polylineOptions.zIndex(POLYLINE_Z_INDEX);

    Path path = getPathWithUuid(uuid);
    // if path does not exist, create it
    if(path==null) {
        path = new Path(uuid);
        pathVsPolylinesMap.put(path,new ArrayList<Polyline>());
    }
    // add polyline
    path.addPolyline(polylineOptions);
    // get all polyline objects already drawn on Google Maps
    List<Polyline> polylines = pathVsPolylinesMap.get(path);
    // add to Google Maps the new polyline described by the given poliylineOptions object
    Polyline polyline = addPolylineToGoogleMap(polylineOptions);
    // add newly added polyline object to the list
    polylines.add(polyline);
    // update the mapping
    pathVsPolylinesMap.put(path,polylines);

    return true;
}
 
开发者ID:Ubudu,项目名称:GoogleMapsLayout-Android,代码行数:37,代码来源:MapLayout.java

示例6: drawSegmentPathUser

import com.google.android.gms.maps.model.PolylineOptions; //导入方法依赖的package包/类
private void drawSegmentPathUser(LatLng latLng) {
    PolylineOptions polyLineOptions = new PolylineOptions();
    polyLineOptions.width(getResources().getDimension(R.dimen._2dp));
    polyLineOptions.color(ContextCompat.getColor(getContext(), R.color.blue));
    polyLineOptions.zIndex(2f);

    if (polylineUserLastPath != null) {
        for (LatLng latLngOld : polylineUserLastPath.getPoints())
            polyLineOptions.add(latLngOld);
    }

    polyLineOptions.add(latLng);
    polylineUserLastPath = removePath(polylineUserLastPath);
    polylineUserLastPath = googleMap.addPolyline(polyLineOptions);
}
 
开发者ID:miguelbcr,项目名称:RxGpsService,代码行数:16,代码来源:PlaceMapFragment.java

示例7: addBikePathToMap

import com.google.android.gms.maps.model.PolylineOptions; //导入方法依赖的package包/类
public static void addBikePathToMap (GoogleMap mMap) {
    if (isBikePathPolylinesAdded)
        return;
    bikePathsPolylines = new ArrayList<>();
    for (PolylineOptions line : bikePathPolylinesOpts) {
        line.zIndex(20); // TODO: not hard coded
        line.width(5); // TODO: not hard coded
        line.visible(false);
        bikePathsPolylines.add(mMap.addPolyline(line));
    }
    isBikePathPolylinesAdded = true;
}
 
开发者ID:nogalavi,项目名称:Bikeable,代码行数:13,代码来源:IriaData.java

示例8: toPolylineOptions

import com.google.android.gms.maps.model.PolylineOptions; //导入方法依赖的package包/类
/**
 * Gets a new PolylineOptions object containing styles for the GeoJsonLineString
 *
 * @return new PolylineOptions object
 */
public PolylineOptions toPolylineOptions() {
    PolylineOptions polylineOptions = new PolylineOptions();
    polylineOptions.color(mPolylineOptions.getColor());
    polylineOptions.geodesic(mPolylineOptions.isGeodesic());
    polylineOptions.visible(mPolylineOptions.isVisible());
    polylineOptions.width(mPolylineOptions.getWidth());
    polylineOptions.zIndex(mPolylineOptions.getZIndex());
    return polylineOptions;
}
 
开发者ID:josegury,项目名称:AndroidMarkerClusteringMaps,代码行数:15,代码来源:GeoJsonLineStringStyle.java

示例9: createPolyline

import com.google.android.gms.maps.model.PolylineOptions; //导入方法依赖的package包/类
/**
 * Create polyline
 * @param args
 * @param callbackContext
 * @throws JSONException 
 */
@SuppressWarnings("unused")
private void createPolyline(final JSONArray args, final CallbackContext callbackContext) throws JSONException {
  final PolylineOptions polylineOptions = new PolylineOptions();
  int color;
  LatLngBounds.Builder builder = new LatLngBounds.Builder();
  
  JSONObject opts = args.getJSONObject(1);
  if (opts.has("points")) {
    JSONArray points = opts.getJSONArray("points");
    List<LatLng> path = PluginUtil.JSONArray2LatLngList(points);
    int i = 0;
    for (i = 0; i < path.size(); i++) {
      polylineOptions.add(path.get(i));
      builder.include(path.get(i));
    }
  }
  if (opts.has("color")) {
    color = PluginUtil.parsePluginColor(opts.getJSONArray("color"));
    polylineOptions.color(color);
  }
  if (opts.has("width")) {
    polylineOptions.width(opts.getInt("width") * this.density);
  }
  if (opts.has("visible")) {
    polylineOptions.visible(opts.getBoolean("visible"));
  }
  if (opts.has("geodesic")) {
    polylineOptions.geodesic(opts.getBoolean("geodesic"));
  }
  if (opts.has("zIndex")) {
    polylineOptions.zIndex(opts.getInt("zIndex"));
  }
  
  Polyline polyline = map.addPolyline(polylineOptions);
  String id = "polyline_" + polyline.getId();
  this.objects.put(id, polyline);

  String boundsId = "polyline_bounds_" + polyline.getId();
  this.objects.put(boundsId, builder.build());
  
  JSONObject result = new JSONObject();
  result.put("hashCode", polyline.hashCode());
  result.put("id", id);
  callbackContext.success(result);
}
 
开发者ID:AdrianBZG,项目名称:PhoneChat,代码行数:52,代码来源:PluginPolyline.java


注:本文中的com.google.android.gms.maps.model.PolylineOptions.zIndex方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。