How to show set locations in a google map and add navigate button
I am looking to create a map application. I want it to show a location that user selects from a list and show here the location is, then add a button on the map so that the user can navigate from there current location to the one selected.
I have looked at tutorials but cannot find anything that does this.
Anyone know where I might find a tutorial that shows this or how I can extend my simple map to show a given location.
import com.ff.org.R;
import com.google.android.maps.MapActivity; import com.google.android.maps.MapView;
public class Locbrad extends MapActivity {
@Override
protected boolean isRouteDisplayed() {
return false;
}@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.map1);
MapView mapView = (MapView) findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
}
开发者_开发知识库}
I wrote up a simple tutorial that shows a ListView and MapView in two tabs (and one activity). In the tutorial, when you click a location in the ListView, the MapView zooms to that location.
It might be a good start for your application. It doesn't have a button on the map to go to the next list item, but since both the MapView and ListView are in the same activity, you have a reference to the list, and you can zoom to the next item.
精彩评论