在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):jd-alexander/Google-Directions-Android开源软件地址(OpenSource Url):https://github.com/jd-alexander/Google-Directions-Android开源编程语言(OpenSource Language):Java 100.0%开源软件介绍(OpenSource Introduction):Google-Directions-AndroidThis project allows you to calculate the direction between two locations and display the route on a Google Map using the Google Directions API - This project isn't actively been maintained. SampleThe sample makes use of the Google Places API for Android in order to provide a real life example of how the library can be used.You can check it out on the store. DownloadGrab via Maven: <dependency>
<groupId>com.github.jd-alexander</groupId>
<artifactId>library</artifactId>
<version>1.1.0</version>
</dependency> or Gradle: compile 'com.github.jd-alexander:library:1.1.0' UsageTo calculate the route you simply instantiate a Routing object and trigger the execute function. *You can execute the task in this manner. ( See the example for more details on the exact implementation) Routing routing = new Routing.Builder()
.travelMode(/* Travel Mode */)
.withListener(/* Listener that delivers routing results.*/)
.waypoints(/*waypoints*/)
.key(/*api key for quota management*/)
.build();
routing.execute();
actual code start = new LatLng(18.015365, -77.499382);
waypoint= new LatLng(18.01455, -77.499333);
end = new LatLng(18.012590, -77.500659);
Routing routing = new Routing.Builder()
.travelMode(Routing.TravelMode.WALKING)
.withListener(this)
.waypoints(start, waypoint, end)
.build();
routing.execute();
.....
@Override
public void onRoutingSuccess(ArrayList<Route> route, int shortestRouteIndex)
{
//code to add route to map here. See sample app for more details.
} DemostrationDemo AppKnown Issues
ContributionPlease fork repository and contribute using pull requests. Any contributions, large or small, major features, bug fixes, additional language translations, unit/integration tests are welcomed and appreciated but will be thoroughly reviewed and discussed. Contributors
License
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论