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


Java Polyline.setColor方法代码示例

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


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

示例1: drawRoute

import org.osmdroid.bonuspack.overlays.Polyline; //导入方法依赖的package包/类
public static void drawRoute(Context context, MapView map, List<Point> points) {
    Polyline line = new Polyline(context);

    line.setSubDescription(Polyline.class.getCanonicalName());
    line.setWidth(15f);
    line.setColor(ContextCompat.getColor(context, R.color.orange_partially_transparent));

    List<GeoPoint> geoPoints = new ArrayList<>();

    for(Point point : points) {

        geoPoints.add(point.Position);
    }

    line.setPoints(geoPoints);
    line.setGeodesic(true);
    map.getOverlayManager().add(line);
}
 
开发者ID:LenaShervarly,项目名称:TreasureHunting,代码行数:19,代码来源:MapHelper.java

示例2: applyDefaultStyling

import org.osmdroid.bonuspack.overlays.Polyline; //导入方法依赖的package包/类
public void applyDefaultStyling(Polyline lineStringOverlay, Style defaultStyle, KmlPlacemark kmlPlacemark,
		KmlDocument kmlDocument, MapView map){
	Context context = map.getContext();
	Style style = kmlDocument.getStyle(kmlPlacemark.mStyle);
	if (style != null){
		lineStringOverlay.setColor(style.getOutlinePaint().getColor());
		lineStringOverlay.setWidth(style.getOutlinePaint().getStrokeWidth());
	} else if (defaultStyle!=null && defaultStyle.mLineStyle!=null){ 
		lineStringOverlay.setColor(defaultStyle.getOutlinePaint().getColor());
		lineStringOverlay.setWidth(defaultStyle.getOutlinePaint().getStrokeWidth());
	}
	if ((kmlPlacemark.mName!=null && !"".equals(kmlPlacemark.mName)) 
			|| (kmlPlacemark.mDescription!=null && !"".equals(kmlPlacemark.mDescription))
			|| (lineStringOverlay.getSubDescription()!=null && !"".equals(lineStringOverlay.getSubDescription()))
			){
		if (mDefaultLayoutResId == BonusPackHelper.UNDEFINED_RES_ID){
			String packageName = context.getPackageName();
			mDefaultLayoutResId = context.getResources().getIdentifier("layout/bonuspack_bubble", null, packageName);
		}
		lineStringOverlay.setInfoWindow(new BasicInfoWindow(mDefaultLayoutResId, map));
	}
	lineStringOverlay.setEnabled(kmlPlacemark.mVisibility);
}
 
开发者ID:jeffallen,项目名称:MarshrutMe,代码行数:24,代码来源:KmlLineString.java

示例3: drawDirections

import org.osmdroid.bonuspack.overlays.Polyline; //导入方法依赖的package包/类
public static void drawDirections(Context context, MapView map, List<AudioPoint> points) {
    for(AudioPoint point : points) {
        Polyline line = new Polyline(context);
        line.setSubDescription(Polyline.class.getCanonicalName());
        line.setWidth(3f);
        line.setColor(0xFFFF0050);
        ArrayList<GeoPoint> tmp = new ArrayList<>();
        tmp.add(point.Position);
        tmp.add(new Vector2(point.Position).add(point.Direction.mult(0.0005)).toGeoPoint());
        line.setPoints(tmp);
        map.getOverlayManager().add(line);
    }
}
 
开发者ID:LenaShervarly,项目名称:TreasureHunting,代码行数:14,代码来源:MapHelper.java

示例4: buildRoadOverlay

import org.osmdroid.bonuspack.overlays.Polyline; //导入方法依赖的package包/类
public static Polyline buildRoadOverlay(Road road, int color, float width, Context context){
    Polyline roadOverlay = new Polyline(context);
    roadOverlay.setColor(color);
    roadOverlay.setWidth(width);

    if (road != null) {
        ArrayList<GeoPoint> polyline = road.mRouteHigh;
        roadOverlay.setPoints(polyline);
    }
    return roadOverlay;
}
 
开发者ID:Arman92,项目名称:Mapsforge-OsmDroid-GraphHopper,代码行数:12,代码来源:MFMapView.java

示例5: buildRoadOverlay

import org.osmdroid.bonuspack.overlays.Polyline; //导入方法依赖的package包/类
/**
 * Using the road high definition shape, builds and returns a Polyline. 
 * @param road
 * @param color
 * @param width
 * @param context
 */
public static Polyline buildRoadOverlay(Road road, int color, float width, Context context){
	Polyline roadOverlay = new Polyline(context);
	roadOverlay.setColor(color);
	roadOverlay.setWidth(width);
	if (road != null) {
		ArrayList<GeoPoint> polyline = road.mRouteHigh;
		roadOverlay.setPoints(polyline);
	}
	return roadOverlay;
}
 
开发者ID:jeffallen,项目名称:MarshrutMe,代码行数:18,代码来源:RoadManager.java


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