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


Java RoadManager.buildRoadOverlay方法代码示例

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


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

示例1: createPolyline

import org.osmdroid.bonuspack.routing.RoadManager; //导入方法依赖的package包/类
private boolean createPolyline() {
        if (map == null || road.mStatus == Road.STATUS_INVALID || road.mStatus == Road.STATUS_TECHNICAL_ISSUE)
            return false;// some error with the road
        roadOverlay = RoadManager.buildRoadOverlay(road);
        roadOverlay.setColor(context.getResources().getColor(R.color.colorAccent));
        roadOverlay.setWidth(16);
        roadOverlay.setGeodesic(true);

//        Drawable nodeIcon = context.getResources().getDrawable(R.drawable.ic_location);
//        for (int i = 0; i < road.mNodes.size(); i++) {
//            RoadNode node = road.mNodes.get(i);
//            Marker nodeMarker = new Marker(map);
//            nodeMarker.setPosition(node.mLocation);
//            nodeMarker.setIcon(nodeIcon);
//            nodeMarker.setTitle("Step " + i);
//            map.getOverlays().add(nodeMarker);
//            nodeMarker.setSnippet(node.mInstructions);
//            nodeMarker.setSubDescription(Road.getLengthDurationText(context, node.mLength, node.mDuration));
//            Drawable icon = context.getResources().getDrawable(R.drawable.ic_filter_selected);
//            nodeMarker.setImage(icon);
//        }
        map.getOverlays().add(roadOverlay);
        map.invalidate();
        return true;
    }
 
开发者ID:CityZenApp,项目名称:Android-Development,代码行数:26,代码来源:RouteCreationTask.java

示例2: calcRoute

import org.osmdroid.bonuspack.routing.RoadManager; //导入方法依赖的package包/类
/**
 * Calculates a route from your start location to the next bus stop
 */
private  void calcRoute()
{
    StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();//Strict mode for ignore NetworkOnMainExceptions (!for anytime, have to put in threading)
    StrictMode.setThreadPolicy(policy);

    ArrayList<GeoPoint> waypoints = new ArrayList<GeoPoint>(); //Build up list of geopoints
    waypoints.add(currenLocation);
    GeoPoint endPoint = new GeoPoint(destinationLocation);
    waypoints.add(endPoint);
    Road road = roadManager.getRoad(waypoints);
    double d = road.mDuration; // get duration
    double x = road.mLength; // get length
    String st_timeLeft = String.format("%s min", String.valueOf(myRound(d / 60,3)));//format string
    String st_dist = String.valueOf(myRound(x * 1000,2)) + " m";

    timeLeft.setText(st_timeLeft);
    distGoal.setText(st_dist);
    Polyline roadOverlay = RoadManager.buildRoadOverlay(road, Activity2.this);// draw route
    mMapView.getOverlays().add(roadOverlay);
    mMapView.invalidate();


}
 
开发者ID:flbbr,项目名称:Run2Stop,代码行数:27,代码来源:Activity2.java

示例3: calcRoute

import org.osmdroid.bonuspack.routing.RoadManager; //导入方法依赖的package包/类
/**
 * Calulates a route from current destination to the next bus stop
 */
private  void calcRoute()
{


    ArrayList<GeoPoint> waypoints = new ArrayList<GeoPoint>();
    waypoints.add(currenLocation);
    GeoPoint endPoint = new GeoPoint(destinationLocation);
    waypoints.add(endPoint);
    StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
    StrictMode.setThreadPolicy(policy);
    Road road = roadManager.getRoad(waypoints);
    double d = road.mDuration;
    double x = road.mLength;
    Polyline roadOverlay = RoadManager.buildRoadOverlay(road, MainActivity.this);
    mMapView.getOverlays().add(roadOverlay);
    mMapView.invalidate();


}
 
开发者ID:flbbr,项目名称:Run2Stop,代码行数:23,代码来源:MainActivity.java

示例4: updateUIWithRoad

import org.osmdroid.bonuspack.routing.RoadManager; //导入方法依赖的package包/类
void updateUIWithRoad(Road road) {
	roadNodeMarkers.removeAllItems();
	List<Overlay> mapOverlays = mv.getOverlays();
	if (roadOverlay != null) {
		mapOverlays.remove(roadOverlay);
	}
	if (road == null)
		return;
	if (road.mStatus == Road.STATUS_DEFAULT)
		Toast.makeText(mv.getContext(),
				"We have a problem to get the route", Toast.LENGTH_SHORT)
				.show();
	roadOverlay = RoadManager.buildRoadOverlay(road, mv.getContext());
	Overlay removedOverlay = mapOverlays.set(1, roadOverlay);
	// we set the road overlay at the "bottom", just above the
	// MapEventsOverlay,
	// to avoid covering the other overlays.
	mapOverlays.add(removedOverlay);
	putRoadNodes(road);
	mv.invalidate();
	// Set route info in the text view:
	// ((TextView) findViewById(R.id.routeInfo)).setText(road
	// .getLengthDurationText(-1));
}
 
开发者ID:nirabpudasaini,项目名称:Mero-Bhada-Meter,代码行数:25,代码来源:MapActivity.java

示例5: onPostExecute

import org.osmdroid.bonuspack.routing.RoadManager; //导入方法依赖的package包/类
@Override
protected void onPostExecute(Road[] roads) {
    double minLength = 0;
    Road bestRoad = null;
    roadList = roads;
    if (roads == null)
        return;
    if (roads[0].mStatus == Road.STATUS_TECHNICAL_ISSUE) {
        Toast.makeText(activity, "Technical issue when getting the route", Toast.LENGTH_SHORT).show();
    } else if (roads[0].mStatus > Road.STATUS_TECHNICAL_ISSUE) { //functional issues
        Toast.makeText(activity, "No possible route here", Toast.LENGTH_SHORT).show();
    }
    List<Overlay> mapOverlays = map.getOverlays();
    for (Road road : roads) {
        if(road.mLength < minLength || minLength == 0) {
            minLength = road.mLength;
            bestRoad = road;
        }
    }

    String routeDesc = bestRoad.getLengthDurationText(activity, -1);
    Polyline roadPolyline = RoadManager.buildRoadOverlay(bestRoad);
    roadPolyline.setTitle(getString(R.string.app_name) + " - " + routeDesc);
    roadPolyline.setInfoWindow(new BasicInfoWindow(org.osmdroid.bonuspack.R.layout.bonuspack_bubble, map));
    mapOverlays.add(0, roadPolyline);
    map.invalidate();
}
 
开发者ID:CMPUT301F16T01,项目名称:Carrier,代码行数:28,代码来源:DriverViewRequestActivity.java

示例6: onPostExecute

import org.osmdroid.bonuspack.routing.RoadManager; //导入方法依赖的package包/类
@Override
protected void onPostExecute(Road[] roads) {
    double minLength = 0;
    Road bestRoad = null;
    roadList = roads;
    if (roads == null)
        return;
    if (roads[0].mStatus == Road.STATUS_TECHNICAL_ISSUE) {
        Toast.makeText(activity, "Technical issue when getting the route", Toast.LENGTH_SHORT).show();
    } else if (roads[0].mStatus > Road.STATUS_TECHNICAL_ISSUE) { //functional issues
        Toast.makeText(activity, "No possible route here", Toast.LENGTH_SHORT).show();
    }
    List<Overlay> mapOverlays = map.getOverlays();
    for (Road road : roads) {
        if(road.mLength < minLength || minLength == 0) {
            minLength = road.mLength;
            bestRoad = road;
        }
    }

    String routeDesc = bestRoad.getLengthDurationText(activity, -1);
    bundle.putDouble("distance", bestRoad.mLength);
    bundle.putDouble("duration", bestRoad.mDuration);

    Polyline roadPolyline = RoadManager.buildRoadOverlay(bestRoad);
    roadPolyline.setTitle(getString(R.string.app_name) + " - " + routeDesc);
    roadPolyline.setInfoWindow(new BasicInfoWindow(org.osmdroid.bonuspack.R.layout.bonuspack_bubble, map));
    mapOverlays.add(0, roadPolyline);
    map.invalidate();
}
 
开发者ID:CMPUT301F16T01,项目名称:Carrier,代码行数:31,代码来源:ViewLocationsActivity.java

示例7: onPostExecute

import org.osmdroid.bonuspack.routing.RoadManager; //导入方法依赖的package包/类
@Override
protected void onPostExecute(Road[] roads) {
    double minLength = 0;
    Road bestRoad = null;
    roadList = roads;
    if (roads == null)
        return;
    if (roads[0].mStatus == Road.STATUS_TECHNICAL_ISSUE) {
        Toast.makeText(activity, "Technical issue when getting the route", Toast.LENGTH_SHORT).show();
    } else if (roads[0].mStatus > Road.STATUS_TECHNICAL_ISSUE) { //functional issues
        Toast.makeText(activity, "No possible route here", Toast.LENGTH_SHORT).show();
    }
    List<Overlay> mapOverlays = map.getOverlays();
    for (Road road : roads) {
        if (road.mLength < minLength || minLength == 0) {
            minLength = road.mLength;
            bestRoad = road;
        }
    }

    String routeDesc = bestRoad.getLengthDurationText(activity, -1);
    Polyline roadPolyline = RoadManager.buildRoadOverlay(bestRoad);
    roadPolyline.setTitle(getString(R.string.app_name) + " - " + routeDesc);
    roadPolyline.setInfoWindow(new BasicInfoWindow(org.osmdroid.bonuspack.R.layout.bonuspack_bubble, map));
    mapOverlays.add(0, roadPolyline);
    map.invalidate();
}
 
开发者ID:CMPUT301F16T01,项目名称:Carrier,代码行数:28,代码来源:RiderRequestActivity.java

示例8: doInBackground

import org.osmdroid.bonuspack.routing.RoadManager; //导入方法依赖的package包/类
@Override
protected Polyline doInBackground(GeoPoint... places) {
    // Starts a RoadManager using the key acquired with a Graphhopper account
    RoadManager roadManager = new GraphHopperRoadManager(BuildConfig.GRAPHHOPPER_KEY,true);
    roadManager.addRequestOption("vehicle=foot");
    ArrayList<GeoPoint> wayPoints = new ArrayList<>();
    Collections.addAll(wayPoints, places);
    // Calculates the route
    Road road = roadManager.getRoad(wayPoints);
    if( road.mStatus == 0) // succeed
        return RoadManager.buildRoadOverlay(road);

    taskStatus = ServerResponse.CONNECTION_FAILED;
    return null;
}
 
开发者ID:smartufpa,项目名称:SmartUFPA,代码行数:16,代码来源:SearchRouteTask.java

示例9: doInBackground

import org.osmdroid.bonuspack.routing.RoadManager; //导入方法依赖的package包/类
@Override
protected Polyline doInBackground(LatLng... params) {
    RoadManager roadManager = new GoogleRoadManager();
    ArrayList<GeoPoint> waypoints = new ArrayList<>();
    for (LatLng p : params){
        waypoints.add(new GeoPoint(p.latitude,p.longitude));
    }
    Road road = roadManager.getRoad(waypoints);
    Polyline roadOverlay = RoadManager.buildRoadOverlay(road);
    callback.onFinished(roadOverlay);
    return roadOverlay;
}
 
开发者ID:RSDT,项目名称:Japp16,代码行数:13,代码来源:Navigator.java

示例10: updateUIWithRoads

import org.osmdroid.bonuspack.routing.RoadManager; //导入方法依赖的package包/类
void updateUIWithRoads(Road[] roads){
mRoadNodeMarkers.getItems().clear();
TextView textView = (TextView)findViewById(R.id.routeInfo);
textView.setText("");
List<Overlay> mapOverlays = map.getOverlays();
if (mRoadOverlays != null){
	for (int i=0; i<mRoadOverlays.length; i++)
		mapOverlays.remove(mRoadOverlays[i]);
	mRoadOverlays = null;
}
if (roads == null)
	return;
if (roads[0].mStatus == Road.STATUS_TECHNICAL_ISSUE)
	Toast.makeText(map.getContext(), "Technical issue when getting the route", Toast.LENGTH_SHORT).show();
else if (roads[0].mStatus > Road.STATUS_TECHNICAL_ISSUE) //functional issues
	Toast.makeText(map.getContext(), "No possible route here", Toast.LENGTH_SHORT).show();
mRoadOverlays = new Polyline[roads.length];
for (int i=0; i<roads.length; i++) {
	Polyline roadPolyline = RoadManager.buildRoadOverlay(roads[i]);
	mRoadOverlays[i] = roadPolyline;
	if (mWhichRouteProvider == GRAPHHOPPER_BICYCLE || mWhichRouteProvider == GRAPHHOPPER_PEDESTRIAN) {
		Paint p = roadPolyline.getPaint();
		p.setPathEffect(new DashPathEffect(new float[]{10, 5}, 0));
	}
	String routeDesc = roads[i].getLengthDurationText(this, -1);
	roadPolyline.setTitle(getString(R.string.route) + " - " + routeDesc);
	roadPolyline.setInfoWindow(new BasicInfoWindow(org.osmdroid.bonuspack.R.layout.bonuspack_bubble, map));
	roadPolyline.setRelatedObject(i);
	roadPolyline.setOnClickListener(new RoadOnClickListener());
	mapOverlays.add(1, roadPolyline);
	//we insert the road overlays at the "bottom", just above the MapEventsOverlay,
	//to avoid covering the other overlays. 
}
selectRoad(0);
  }
 
开发者ID:MKergall,项目名称:osmbonuspack,代码行数:36,代码来源:MapActivity.java

示例11: onPostExecute

import org.osmdroid.bonuspack.routing.RoadManager; //导入方法依赖的package包/类
@Override
protected void onPostExecute(Object result){
    mapView.getOverlays().clear();
    drawMarkers();
    final Road road = (Road) result;
    final Polyline routeOverlay = RoadManager.buildRoadOverlay(road, getActivity());
    initRouteInstructions(road);
    final TextView lblDistance = (TextView)getView().findViewById(R.id.lblDistance);
    lblDistance.setText(String.format("%.2f", road.mLength)  + "km");
    final TextView lblTime = (TextView)getView().findViewById(R.id.lblTime);
    lblTime.setText(String.format("%.0f",(road.mDuration / 60)) + " " + getResources().getString(R.string.minutes)); //set estimated time in minutes
    mapView.getOverlays().add(routeOverlay);
    mapView.invalidate();
}
 
开发者ID:oSoc14,项目名称:Artoria,代码行数:15,代码来源:MapFragment.java

示例12: getLocations

import org.osmdroid.bonuspack.routing.RoadManager; //导入方法依赖的package包/类
/**
 *  Gets locations from ChooseLocationActivity, prints them, and puts them on the map
 */
public void getLocations() {
    Intent intent = getIntent();
    Gson gson = new Gson();

    // clean the map in case user changes location
    map.getOverlays().clear();

    if (intent.getStringExtra("start") != null) {
        startLocation = new Location("");
        startLocation = gson.fromJson(intent.getStringExtra("start"), startLocation.getClass());
    }
    if (startLocation == null) {
        startLocationText.setText("");
    }
    if (startLocation != null) {
        startLocationText.setText(startLocation.getAddress());
        Marker sMarker = new Marker(map);
        sMarker.setPosition(startLocation.getGeoLocation());
        sMarker.setTitle(startLocation.getAddress());
        sMarker.setIcon(getResources().getDrawable(R.drawable.person));
        sMarker.setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_BOTTOM);
        map.getOverlays().add(sMarker);
    }

    if (intent.getStringExtra("end") != null) {
        endLocation = new Location("");
        endLocation = gson.fromJson(intent.getStringExtra("end"), endLocation.getClass());
    }
    if (endLocation == null)  {
        endLocationText.setText("");
    }
    if (endLocation != null) {
        endLocationText.setText(endLocation.getAddress());
        Marker eMarker = new Marker(map);
        eMarker.setPosition(endLocation.getGeoLocation());
        eMarker.setTitle(endLocation.getAddress());
        eMarker.setIcon(getResources().getDrawable(R.drawable.marker_default));
        eMarker.setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_BOTTOM);
        map.getOverlays().add(eMarker);
    }

    // If both locations specified, draw the route
    if((startLocation != null) & (endLocation != null)) {
        RoadManager roadManager = new OSRMRoadManager(this);
        ArrayList<GeoPoint> waypoints = new ArrayList<GeoPoint>();
        waypoints.add(startLocation.getGeoLocation());
        waypoints.add(endLocation.getGeoLocation());
        Road road = roadManager.getRoad(waypoints);
        Polyline roadOverlay = RoadManager.buildRoadOverlay(road);
        recommendedFare.setText(startLocation.calculateFare(endLocation));
        map.getOverlays().add(roadOverlay);
    }
    map.invalidate();
}
 
开发者ID:CMPUT301F16T19,项目名称:SeekARide,代码行数:58,代码来源:AddRequestActivity.java

示例13: write

import org.osmdroid.bonuspack.routing.RoadManager; //导入方法依赖的package包/类
/**
 * fills in the blank text views with the relavent information from the request.
 */
public void write() {
    description = (TextView) findViewById(R.id.view_Description_Text);
    startLocationText = (TextView) findViewById(R.id.view_Slocation_Text);
    destinationText = (TextView) findViewById(R.id.view_Elocation_Text);
    fare = (TextView) findViewById(R.id.view_Fare_Text);
    riderInfo = (TextView) findViewById(R.id.view_Info_Text);

    description.setText("Description: " + request.getDescription());
    startLocationText.setText("From: " + request.getStart().getAddress());
    destinationText.setText("To: " + request.getDestination().getAddress());
    fare.setText("Fare: $" + ((Double) request.getPrice()).toString());
    riderInfo.setText("Rider: " + request.getRiderProfile().getUsername());
    riderInfo.setPaintFlags(riderInfo.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);

    // Initialize map
    MapView map = (MapView) findViewById(R.id.view_Offer_Map);
    map.setTileSource(TileSourceFactory.MAPNIK);
    map.setBuiltInZoomControls(true);
    map.setMultiTouchControls(true);
    IMapController mapController = map.getController();
    mapController.setZoom(10);

    // Draw start location marker
    Location start = request.getStart();
    Marker startMarker = new Marker(map);
    startMarker.setPosition(start.getGeoLocation());
    startMarker.setTitle(start.getAddress());
    startMarker.setIcon(getResources().getDrawable(R.drawable.person));
    startMarker.setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_BOTTOM);
    map.getOverlays().add(startMarker);
    mapController.setCenter(start.getGeoLocation());

    // Draw destination marker
    Location end = request.getDestination();
    Marker endMarker = new Marker(map);
    endMarker.setPosition(end.getGeoLocation());
    endMarker.setTitle(end.getAddress());
    endMarker.setIcon(getResources().getDrawable(R.drawable.marker_default));
    endMarker.setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_BOTTOM);
    map.getOverlays().add(endMarker);

    // Draw the route in between start and destination
    RoadManager roadManager = new OSRMRoadManager(this);
    ArrayList<GeoPoint> waypoints = new ArrayList<GeoPoint>();
    waypoints.add(start.getGeoLocation());
    waypoints.add(end.getGeoLocation());
    Road road = roadManager.getRoad(waypoints);
    Polyline roadOverlay = RoadManager.buildRoadOverlay(road);
    map.getOverlays().add(roadOverlay);
}
 
开发者ID:CMPUT301F16T19,项目名称:SeekARide,代码行数:54,代码来源:ViewOfferActivity.java

示例14: onCreate

import org.osmdroid.bonuspack.routing.RoadManager; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_rcomplete);
    isRider = getIntent().getBooleanExtra("isRider", false);
    //requestIndex = getIntent().getIntExtra("requestIndex", -1);
    if (isRider) {
        //request = Rider.getInstance().getOpenRequests().get(requestIndex);
        request = Rider.getInstance().getRequestInProgress();
    }
    else {
        //request = Driver.getInstance().getAcceptedRequests().get(requestIndex);
        request = Driver.getInstance().getRequestInProgress();
    }

    StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
    StrictMode.setThreadPolicy(policy);

    // Initialize map
    final MapView map = (MapView) findViewById(R.id.rCompleteMap);
    map.setTileSource(TileSourceFactory.MAPNIK);
    map.setBuiltInZoomControls(true);
    map.setMultiTouchControls(true);
    IMapController mapController = map.getController();
    mapController.setZoom(11);

    // Draw start marker
    Location start = request.getStart();
    Marker startMarker = new Marker(map);
    startMarker.setPosition(start.getGeoLocation());
    startMarker.setTitle(start.getAddress());
    startMarker.setIcon(getResources().getDrawable(R.drawable.person));
    startMarker.setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_BOTTOM);
    map.getOverlays().add(startMarker);
    mapController.setCenter(start.getGeoLocation());

    // Draw destination marker
    Location end = request.getDestination();
    Marker endMarker = new Marker(map);
    endMarker.setPosition(end.getGeoLocation());
    endMarker.setTitle(end.getAddress());
    endMarker.setIcon(getResources().getDrawable(R.drawable.marker_default));
    endMarker.setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_BOTTOM);
    map.getOverlays().add(endMarker);

    // Draw the route between start and destination
    RoadManager roadManager = new OSRMRoadManager(this);
    ArrayList<GeoPoint> waypoints = new ArrayList<GeoPoint>();
    waypoints.add(start.getGeoLocation());
    waypoints.add(end.getGeoLocation());
    Road road = roadManager.getRoad(waypoints);
    Polyline roadOverlay = RoadManager.buildRoadOverlay(road);
    map.getOverlays().add(roadOverlay);

    move();
}
 
开发者ID:CMPUT301F16T19,项目名称:SeekARide,代码行数:57,代码来源:RequestCompleteActivity.java

示例15: onCreate

import org.osmdroid.bonuspack.routing.RoadManager; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    Intent in = getIntent();
    // getting attached intent data
    Bundle extras = in.getExtras();
    double lat = Double.parseDouble(extras.getString("lat"));
    double lon = Double.parseDouble(extras.getString("lon"));

    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_routing);

    LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
    locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this);
    Criteria criteria = new Criteria();
    Location locationNet = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
    Location locationGPS = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);

    //GeoPoint gp = new GeoPoint(48.416312, -4.466546);
    GeoPoint gp = null;
    if(locationGPS != null) {
        gp = new GeoPoint(locationGPS.getLatitude(), locationGPS.getLongitude());
    }
    else if(locationNet != null){
        gp = new GeoPoint(locationNet.getLatitude(), locationNet.getLongitude());
    } else {
        return;
    }

    MapView mMap = (MapView) findViewById(R.id.mapRoute);
    IMapController mapController = mMap.getController();
    RoadManager roadManager = new OSRMRoadManager();

    ArrayList<GeoPoint> waypoints = new ArrayList<GeoPoint>();
    waypoints.add(gp);
    GeoPoint endPoint = new GeoPoint(lat, lon);
    waypoints.add(endPoint);
    Road road = roadManager.getRoad(waypoints);
    Polyline roadOverlay = RoadManager.buildRoadOverlay(road, this);
    mMap.getOverlays().add(roadOverlay);
    //mMap.invalidate();

    /*NominatimPOIProvider poiProvider = new NominatimPOIProvider();
    ArrayList<POI> pois = poiProvider.getPOICloseTo(gp, "garage", 50, 0.1);
    FolderOverlay poiMarkers = new FolderOverlay(this);
    mMap.getOverlays().add(poiMarkers);*/

    mapController.setCenter(endPoint);
    mapController.setZoom(13);
    mMap.setMultiTouchControls(true);
}
 
开发者ID:Darkitty,项目名称:BTB,代码行数:51,代码来源:Routing.java


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