• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java PathOverlay类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.osmdroid.views.overlay.PathOverlay的典型用法代码示例。如果您正苦于以下问题:Java PathOverlay类的具体用法?Java PathOverlay怎么用?Java PathOverlay使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PathOverlay类属于org.osmdroid.views.overlay包,在下文中一共展示了PathOverlay类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: addPolyline

import org.osmdroid.views.overlay.PathOverlay; //导入依赖的package包/类
@Override
public int addPolyline(final Polyline aPolyline) {
	if (mPolylines == null) {
		mPolylines = new HashMap<Integer, PathOverlay>();
	}
	final PathOverlay overlay = new PathOverlay(aPolyline.color, aPolyline.width, mMapView.getContext());
	overlay.addPoints(aPolyline.points);
	mMapView.getOverlays().add(0, overlay); // add polyline overlay below markers, etc
	final int id = random.nextInt();
	mPolylines.put(id, overlay);
	return id;
}
 
开发者ID:osmdroid,项目名称:osmdroid,代码行数:13,代码来源:OsmdroidMapWrapper.java


示例2: getPolyline

import org.osmdroid.views.overlay.PathOverlay; //导入依赖的package包/类
private PathOverlay getPolyline(final int id) {
	if (mPolylines == null) {
		throw new IllegalArgumentException("No such id");
	}
	final PathOverlay polyline = mPolylines.get(id);
	if (polyline == null) {
		throw new IllegalArgumentException("No such id");
	}
	return polyline;
}
 
开发者ID:osmdroid,项目名称:osmdroid,代码行数:11,代码来源:OsmdroidMapWrapper.java


示例3: clear

import org.osmdroid.views.overlay.PathOverlay; //导入依赖的package包/类
@Override
public void clear() {
	if (mItemizedOverlay != null) {
		mItemizedOverlay.removeAllItems();
	}
	if (mPolylines != null) {
		for(final PathOverlay polyline : mPolylines.values()) {
			mMapView.getOverlays().remove(mPolylines.remove(polyline));
		}
		mPolylines.clear();
	}
}
 
开发者ID:osmdroid,项目名称:osmdroid,代码行数:13,代码来源:OsmdroidMapWrapper.java


示例4: onCreateView

import org.osmdroid.views.overlay.PathOverlay; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
	fragmentView = (LinearLayout) inflater.inflate(R.layout.main, container, false);

	layout1 = (LinearLayout) fragmentView.findViewById(R.id.linearLayout1);
	layout2 = (LinearLayout) fragmentView.findViewById(R.id.linearLayout2);
	layout4 = (LinearLayout) fragmentView.findViewById(R.id.linearLayout4);
	layout5 = (LinearLayout) fragmentView.findViewById(R.id.linearLayout5);

	defineWidgets(fragmentView);

	if (savedInstanceState != null)
		chrono.setBase(chronoBaseValue);

	chrono.setOnChronometerTickListener(new OnChronometerTickListener() {
		public void onChronometerTick(Chronometer arg0) {
			showCalculatedData(arg0);

			if (prefs.getInt("practice_display5", TypesOfPractices.BASIC_PRACTICE.getTypes()) == TypesOfPractices.HIIT_PRACTICE
					.getTypes())
				showHiitTrainingDataInDisplay(arg0);
		}
	});

	mapView = (MapView) fragmentView.findViewById(R.id.practice_mapview);
	mapView.getOverlays().clear();
	mapView.setBuiltInZoomControls(true);
	mapView.setMultiTouchControls(true);
	mapView.setUseSafeCanvas(true);

	setHardwareAccelerationOff();

	mapController = (MapController) mapView.getController();

	ScaleBarOverlay mScaleBarOverlay = new ScaleBarOverlay(mContext);
	mapView.getOverlays().add(mScaleBarOverlay);

	pathOverlay = new PathOverlay(Color.BLUE, mContext);
	pathOverlay.getPaint().setStyle(Style.STROKE);
	pathOverlay.getPaint().setStrokeWidth(3);
	pathOverlay.getPaint().setAntiAlias(true);
	mapView.getOverlays().add(pathOverlay);

	this.mCompassOverlay = new CompassOverlay(mContext, new InternalCompassOrientationProvider(mContext),
			mapView);
	mCompassOverlay.setEnabled(true);
	mapView.getOverlays().add(mCompassOverlay);

	this.mLocationOverlay = new MyLocationNewOverlay(mContext, new GpsMyLocationProvider(mContext),
			mapView);
	mLocationOverlay.setDrawAccuracyEnabled(true);
	mapView.getOverlays().add(mLocationOverlay);

	MapOverlay touchOverlay = new MapOverlay(mContext);
	mapView.getOverlays().add(touchOverlay);

	mLocationOverlay.runOnFirstFix(new Runnable() {
		public void run() {
			if (centerPoint == null)
				centerPoint = mLocationOverlay.getMyLocation();

			centerMyLocation(centerPoint);
		}
	});

	mapView.postInvalidate();

	return fragmentView;
}
 
开发者ID:scintero,项目名称:moveon,代码行数:70,代码来源:Main.java


示例5: addPathOverlay

import org.osmdroid.views.overlay.PathOverlay; //导入依赖的package包/类
private void addPathOverlay() {
	pathOverlay = new PathOverlay(Color.BLUE, mContext);
	pathOverlay.getPaint().setStyle(Style.STROKE);
	pathOverlay.getPaint().setStrokeWidth(3);
	pathOverlay.getPaint().setAntiAlias(true);
	mapView.getOverlays().add(pathOverlay);
}
 
开发者ID:scintero,项目名称:moveon,代码行数:8,代码来源:Summary1.java


示例6: setupTrackToView

import org.osmdroid.views.overlay.PathOverlay; //导入依赖的package包/类
private void setupTrackToView() {


        // simulate flight Track
        if (flightLog.size() == 0)
            simulateTrack();

        // Info Table
        gpsData = (ListView) findViewById(R.id.fm_table);
        gpsListAdapterView = new GpsListAdapter(this);
        gpsData.setAdapter(gpsListAdapterView);
        for (int j = 0; j < flightLog.size(); j++)
            gpsListAdapterView.add(flightLog.get(j));

        gpsData.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            public void onItemClick(AdapterView<?> arg0, View arg1,
                                    int position, long arg3) {

                map.getController().setCenter(
                        new GeoPoint(flightLog.get(position).getLatitude(),
                                flightLog.get(position).getLongitude()));
            }

            public void onNothingSelected(AdapterView parentView) {

            }
        });

        double speedMax = 0.;
        double heightMin = 0., heightMax = 0.;
        for (int k = 0; k < flightLog.size(); k++) {
            double speed = flightLog.get(k).getSpeedValue(SPEED.ms);
            if (speedMax < speed)
                speedMax = speed;

            double height = flightLog.get(k).getAltitude();
            if (heightMin > height)
                heightMin = height;
            if (heightMax < height)
                heightMax = height;
        }

        StringBuilder flightInfo = new StringBuilder();
        flightInfo.append("max. Speed " + speedMax + " m/s\n");
        flightInfo.append("min. Height " + heightMin + ", max. Height "
                + heightMax);
        tv_info.setText(flightInfo.toString());

        // Overlay Path
        PathOverlay myPath = new PathOverlay(Color.RED, this);
        for (int i = 0; i < flightLog.size(); i++) {
            myPath.addPoint(new GeoPoint(flightLog.get(i).getLatitude(),
                    flightLog.get(i).getLongitude()));
        }
        map.getOverlays().add(myPath);

        // Special Points
        map.getController().setCenter(getCenterPoint());

        resourceProxy = new DefaultResourceProxyImpl(getApplicationContext());
        poi = new ArrayList<>();

        OverlayItem start = new OverlayItem("Start", "Position",
                new GeoPoint(flightLog.get(0).getLatitude(), flightLog.get(0)
                        .getLongitude()));
        Drawable blkMarker = getResources().getDrawable(
                R.drawable.map_blk_marker_small);
        start.setMarker(blkMarker);
        poi.add(start);

        OverlayItem end = new OverlayItem("End", "Position", new GeoPoint(
                flightLog.get(flightLog.size() - 1).getLatitude(), flightLog
                .get(flightLog.size() - 1).getLongitude()));
        Drawable blueMarker = getResources().getDrawable(
                R.drawable.map_blue_marker_small);
        end.setMarker(blueMarker);
        poi.add(end);
        POIItemizedOverlay overlay = new POIItemizedOverlay(this, poi);
        map.getOverlays().add(overlay);
    }
 
开发者ID:fabianhu,项目名称:FCM-Android,代码行数:81,代码来源:FlightMap.java


示例7: createOverlays

import org.osmdroid.views.overlay.PathOverlay; //导入依赖的package包/类
/**
 * Creates overlays over the OSM view
 */
private void createOverlays() {

	pathOverlay = new PathOverlay(Color.BLUE, this);
//	pathOverlay.
	osmView.getOverlays().add(pathOverlay);

   //    osmView.set
	myLocationOverlay = new SimpleLocationOverlay(this);
	osmView.getOverlays().add(myLocationOverlay);

	
	wayPointsOverlay = new WayPointsOverlay(this, currentTrackId);
	osmView.getOverlays().add(wayPointsOverlay);

	
}
 
开发者ID:WanderWiki,项目名称:WanderWiki-client,代码行数:20,代码来源:DisplayTrackMap.java


示例8: clearPolyline

import org.osmdroid.views.overlay.PathOverlay; //导入依赖的package包/类
@Override
public void clearPolyline(final int id) {
	final PathOverlay polyline = getPolyline(id);
	mMapView.getOverlays().remove(polyline);
	mPolylines.remove(id);
}
 
开发者ID:osmdroid,项目名称:osmdroid,代码行数:7,代码来源:OsmdroidMapWrapper.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BufferedReader类代码示例发布时间:2022-05-22
下一篇:
Java EventSourcingHandler类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap