Showing a route between two points with multiple waypoints

前端 未结 3 1842
温柔的废话
温柔的废话 2020-12-19 18:44

I am new to android and developing a navigation based application for android.My question is I want to show a route with multiple way-points between source and destination n

3条回答
  •  清歌不尽
    2020-12-19 19:06

    You can use the map intent like this:

        String address = "http://maps.google.com/maps?daddr=" + "Latitude" + "," + "Longitude" + "+to:" +"Latitude" + "," + "Longitude";
        Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(address));                                                         
        startActivity(intent);
    

    in this case the start point will be your current location and you can add as many intermediate points as you want using "+to:"

提交回复
热议问题