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