本文整理汇总了Java中com.mapbox.mapboxsdk.overlay.PathOverlay类的典型用法代码示例。如果您正苦于以下问题:Java PathOverlay类的具体用法?Java PathOverlay怎么用?Java PathOverlay使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PathOverlay类属于com.mapbox.mapboxsdk.overlay包,在下文中一共展示了PathOverlay类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: PolygonGeometry
import com.mapbox.mapboxsdk.overlay.PathOverlay; //导入依赖的package包/类
public PolygonGeometry(MapView mv, Builder builder) {
this.mapView = mv;
this.builder = builder;
this.latLngs = new ArrayList<LatLng>();
this.outerRingStroke = new PathOverlay(this.lineColor, this.strokeWidth);
this.outerRingStroke.getPaint().setStyle(Paint.Style.STROKE);
this.outerRingStroke.getPaint().setAlpha(100);
this.outerRingStroke.getPaint().setStrokeWidth(3);
this.outerRingFill = new PathOverlay(this.lineColor, 0);
this.outerRingFill.getPaint().setStyle(Paint.Style.FILL);
this.outerRingFill.getPaint().setAlpha(50);
// Prevent glitching when panning & zooming map (see: https://github.com/mapbox/mapbox-android-sdk/issues/461).
this.outerRingStroke.setOptimizePath(false);
this.outerRingFill.setOptimizePath(false);
this.mapView.getOverlays().add(this.outerRingStroke);
this.mapView.getOverlays().add(this.outerRingFill);
}
开发者ID:affinitybridge,项目名称:cordova-mapbox-android-sdk,代码行数:21,代码来源:PolygonGeometry.java
示例2: buildGeometryAndPathOverlay
import com.mapbox.mapboxsdk.overlay.PathOverlay; //导入依赖的package包/类
private void buildGeometryAndPathOverlay() {
try {
pathOverlay = new PathOverlay();
Paint paint = pathOverlay.getPaint();
paint.setColor(Color.BLACK);
paint.setStrokeWidth(4.0f);
JSONArray coords = feature.getJSONObject("geometry").getJSONArray("coordinates").getJSONArray(0);
int len = coords.length();
Coordinate[] coordinates = new Coordinate[len];
for (int i = 0; i < len; ++i) {
JSONArray coord = coords.getJSONArray(i);
double lng = coord.getDouble(0);
double lat = coord.getDouble(1);
coordinates[i] = new Coordinate(lng, lat);
pathOverlay.addPoint(lat, lng);
}
geom = FPAtlas.GEOMETRY_FACTORY.createPolygon(coordinates);
} catch (JSONException e) {
e.printStackTrace();
}
}
开发者ID:posm,项目名称:OpenMapKitAndroid,代码行数:22,代码来源:FPPage.java
示例3: setSelectedPathOverlay
import com.mapbox.mapboxsdk.overlay.PathOverlay; //导入依赖的package包/类
private void setSelectedPathOverlay(FPPage page) {
clearSelectedPathOverlay();
PathOverlay pathOverlay = page.pathOverlay();
List<Overlay> overlays = mapView.getOverlays();
// Remove overlay to select and then put it in the right place in the list
// so that it is in front of the other PathOverlays but behind the OSM
// overlays.
overlays.remove(pathOverlay);
int len = overlays.size();
boolean overlayMoved = false;
for (int i = 0; i < len; ++i) {
Overlay o = overlays.get(i);
if (o instanceof OSMOverlay || o instanceof OSMItemizedIconOverlay) {
overlays.add(i-1, pathOverlay);
overlayMoved = true;
break;
}
}
if (!overlayMoved) {
overlays.add(pathOverlay);
}
pathOverlay.getPaint().setARGB(255, OSMLine.DEFAULT_R, OSMLine.DEFAULT_G, OSMLine.DEFAULT_B);
selectedPathOverlay = pathOverlay;
}
开发者ID:posm,项目名称:OpenMapKitAndroid,代码行数:27,代码来源:FPAtlas.java
示例4: LineGeometry
import com.mapbox.mapboxsdk.overlay.PathOverlay; //导入依赖的package包/类
public LineGeometry(MapView mv, Builder builder) {
this.mapView = mv;
this.builder = builder;
this.latLngs = new ArrayList<LatLng>();
this.line = new PathOverlay(this.lineColor, this.strokeWidth);
this.mapView.getOverlays().add(this.line);
}
开发者ID:affinitybridge,项目名称:cordova-mapbox-android-sdk,代码行数:8,代码来源:LineGeometry.java
示例5: addPathOverlaysToMapView
import com.mapbox.mapboxsdk.overlay.PathOverlay; //导入依赖的package包/类
private void addPathOverlaysToMapView() {
List<Overlay> overlays = mapView.getOverlays();
for (Overlay o : overlays) {
if (o instanceof PathOverlay) {
overlays.remove(o);
}
}
Collection<FPPage> pagesCollection = pages.values();
for (FPPage p : pagesCollection) {
overlays.add(p.pathOverlay());
}
mapView.invalidate();
}
开发者ID:posm,项目名称:OpenMapKitAndroid,代码行数:14,代码来源:FPAtlas.java
示例6: initializePolyline
import com.mapbox.mapboxsdk.overlay.PathOverlay; //导入依赖的package包/类
private void initializePolyline() {
mLine = new PathOverlay(Color.BLUE, 5);
}
开发者ID:LeotisBuchanan,项目名称:stream-data-analysis-realtime,代码行数:4,代码来源:MainActivity.java
示例7: pathOverlay
import com.mapbox.mapboxsdk.overlay.PathOverlay; //导入依赖的package包/类
public PathOverlay pathOverlay() {
return pathOverlay;
}
开发者ID:posm,项目名称:OpenMapKitAndroid,代码行数:4,代码来源:FPPage.java
示例8: drawRoute
import com.mapbox.mapboxsdk.overlay.PathOverlay; //导入依赖的package包/类
public void drawRoute(){
//line = new PathOverlay(mapContext.getResources().getColor(R.color.RoutePrimaryColor), 10);
line = new PathOverlay(ContextCompat.getColor(this, R.color.RoutePrimaryColor), 10);
for(int a =0; a<route.getPaths().get(0).getPoints().getCoordinates().size(); a++ )
line.addPoint(route.getPaths().get(0).getPoints().getCoordinates().get(a).get(1),
route.getPaths().get(0).getPoints().getCoordinates().get(a).get(0));
mv.getOverlays().add(line);
mv.invalidate();
}
开发者ID:cammace,项目名称:iGuide,代码行数:15,代码来源:RoutingActivity.java
示例9: TrackPathOverlayEvent
import com.mapbox.mapboxsdk.overlay.PathOverlay; //导入依赖的package包/类
/**
* Constructor.
*
* @param mTrackOverlay
*/
public TrackPathOverlayEvent(PathOverlay mTrackOverlay) {
this.mTrackOverlay = mTrackOverlay;
}
开发者ID:enviroCar,项目名称:enviroCar-app,代码行数:9,代码来源:TrackPathOverlayEvent.java
注:本文中的com.mapbox.mapboxsdk.overlay.PathOverlay类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论