我在做什么 ::
我想要什么 ::
代码 ::
public class MyRouteMap extends MapActivity {
protected MapView map;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
setupMapView();
displayRoute();
}
// set your map and enable default zoom controls
private void setupMapView() {
this.map = (MapView) findViewById(R.id.map);
map.setBuiltInZoomControls(true);
}
// create a route and display on the map
private void displayRoute() {
RouteManager routeManager = new RouteManager(this);
routeManager.setMapView(map);
routeManager.createRoute("San Francisco, CA", "Fremont, CA");
}
@Override
public boolean isRouteDisplayed() {
return true;
}
}
答案 0 :(得分:1)
我在mapquest论坛http://developer.mapquest.com/web/products/forums/-/message_boards/view_message/255724
中找到了这个例子routeManager.createRoute(" {latLng:{lat:37.765007,lng:-122.239937}}"," Fremont,CA");
答案 1 :(得分:0)
您还可以将路径作为逗号分隔的lat和lng字符串传递:
routeManager.createRoute("37.765007,-122.239937", "Fremont, CA");