Skip to content

Commit

Permalink
update demo
Browse files Browse the repository at this point in the history
  • Loading branch information
onlylemi committed Apr 25, 2016
1 parent 9115250 commit 9e685c3
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ public void onBitmapClick(BitmapLayer layer) {
public void onMapLoadFail() {
Log.i(TAG, "onMapLoadFail");
}

@Override
public void onGetCurrentMap(Bitmap bitmap) {
Log.i(TAG, "onGetCurrentMap");
}
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ public void onMapLoadFail() {

}

@Override
public void onGetCurrentMap(Bitmap bitmap) {

}
});


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,14 @@ protected void onCreate(Bundle savedInstanceState) {
@Override
public void onMapLoadSuccess() {
Log.i(TAG, "onMapLoadSuccess");
mapView.setCurrentRotateDegrees(60);
//mapView.setCurrentRotateDegrees(60);
}

@Override
public void onMapLoadFail() {
Log.i(TAG, "onMapLoadFail");
}

@Override
public void onGetCurrentMap(Bitmap bitmap) {
Log.i(TAG, "onGetCurrentMap");
}
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ public void onMapLoadFail() {

}

@Override
public void onGetCurrentMap(Bitmap bitmap) {

}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Point;
import android.graphics.PointF;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;

Expand All @@ -17,7 +15,9 @@
import com.onlylemi.mapview.library.utils.MapUtils;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class RouteLayerTestActivity extends AppCompatActivity {

Expand All @@ -40,7 +40,7 @@ protected void onCreate(Bundle savedInstanceState) {
nodesContract = TestData.getNodesContactList();
marks = TestData.getMarks();
marksName = TestData.getMarksName();
MapUtils.init(nodes, nodesContract);
MapUtils.init(nodes.size(), nodesContract.size());

mapView = (MapView) findViewById(R.id.mapview);
Bitmap bitmap = null;
Expand Down Expand Up @@ -76,9 +76,6 @@ public void markIsClick(int num) {
public void onMapLoadFail() {
}

@Override
public void onGetCurrentMap(Bitmap bitmap) {
}
});
}

Expand All @@ -93,8 +90,17 @@ public boolean onOptionsItemSelected(MenuItem item) {
if (mapView.isMapLoadFinish()) {
switch (item.getItemId()) {
case R.id.route_layer_tsp:


List<PointF> list = new ArrayList<>();
list.add(marks.get(39));
list.add(marks.get(new Random().nextInt(10)));
list.add(marks.get(new Random().nextInt(10) + 10));
list.add(marks.get(new Random().nextInt(10) + 20));
list.add(marks.get(new Random().nextInt(10) + 9));
List<Integer> routeList = MapUtils.getBestPathBetweenPoints(list, nodes,
nodesContract);
routeLayer.setNodeList(nodes);
routeLayer.setRouteList(routeList);
mapView.refresh();
break;
default:
break;
Expand Down

0 comments on commit 9e685c3

Please sign in to comment.