polfdz / osmbonuspack

Automatically exported from code.google.com/p/osmbonuspack
0 stars 0 forks source link

Routing #99

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I do the routing example of the tuttorial_1.

What is the expected output? What do you see instead?
The expected output is the map with de route but it fails.  (The aplication 
fails) 

What version of the products are you using (Android SDK, osmdroid,
OSMBonusPack)?
slf4j-android-1.6.1-RC1.jar
osmdroid-android-3.0.10.jar
android-support-v4.jar
osmbonuspack_v5.0.jar
gson-2.2.4.jar
commons-lang3-3.3.2.jar
Movile with android 2.3.4

Please provide any additional information below.

Java code:

import java.util.ArrayList;
import org.osmdroid.api.IMapController;
import org.osmdroid.bonuspack.overlays.Polyline;
import org.osmdroid.bonuspack.routing.OSRMRoadManager;
import org.osmdroid.bonuspack.routing.Road;
import org.osmdroid.bonuspack.routing.RoadManager;
import org.osmdroid.tileprovider.tilesource.TileSourceFactory;
import org.osmdroid.util.GeoPoint;
import org.osmdroid.views.MapView;

import com.example.ibiza.R;

import android.app.Activity;
import android.os.Bundle;

public class H extends Activity {

    @Override public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.maparuta);
        MapView map = (MapView) findViewById(R.id.map);
        map.setTileSource(TileSourceFactory.MAPQUESTOSM);
        map.setBuiltInZoomControls(true);
        map.setMultiTouchControls(true);

        GeoPoint startPoint = new GeoPoint(48.13, -1.63);
        IMapController mapController = map.getController();
        mapController.setZoom(9);
        mapController.setCenter(startPoint);

        RoadManager roadManager = new OSRMRoadManager();
        ArrayList<GeoPoint> waypoints = new ArrayList<GeoPoint>();
        waypoints.add(startPoint);
        GeoPoint endPoint = new GeoPoint(48.4, -1.9);
        waypoints.add(endPoint);
        Road road = roadManager.getRoad(waypoints);
        Polyline roadOverlay = RoadManager.buildRoadOverlay(road, this);
        map.getOverlays().add(roadOverlay);
        map.invalidate();

    }
}

XML code:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:orientation="vertical" 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">

        <org.osmdroid.views.MapView android:id="@+id/map"
                android:layout_width="fill_parent" 
                android:layout_height="fill_parent" />

</LinearLayout>

SORRY ABOUT THE BAD ENGLISH, I AM LEARNING. 
Thanks

Original issue reported on code.google.com by jsalced...@gmail.com on 10 Dec 2014 at 5:17

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
First of all, as stated in the installation guide, for OSMBonusPack 5.0, you 
MUST use osmdroid 4.2. 

Answer is probably here: 
http://stackoverflow.com/questions/21213224/roadmanager-for-osmdroid-error-help-
please/21894178#21894178

If not, provide the logcat stacktrace of the failure. 

Original comment by mathieu....@gmail.com on 13 Dec 2014 at 10:15

GoogleCodeExporter commented 9 years ago
Thank´s now goes correctly.

Original comment by jsalced...@gmail.com on 15 Dec 2014 at 3:28

GoogleCodeExporter commented 9 years ago

Original comment by mathieu....@gmail.com on 15 Dec 2014 at 5:46