コード例 #1
0
 private LatLngBounds getBounds() {
   LatLngBounds.Builder builder = LatLngBounds.builder();
   for (RoutePoint point : route.getRoutePointList()) {
     LatLng latLng = new LatLng(point.getLatitude(), point.getLongitude());
     builder.include(latLng);
   }
   return builder.build();
 }
コード例 #2
0
 private void showRoute() {
   PolylineOptions rectOptions = new PolylineOptions();
   LatLng latLng = null;
   for (RoutePoint point : route.getRoutePointList()) {
     latLng = new LatLng(point.getLatitude(), point.getLongitude());
     rectOptions.add(latLng);
   }
   rectOptions.color(0xA00080FF);
   map.addPolyline(rectOptions);
   MarkerOptions endMarker = new MarkerOptions();
   endMarker.position(latLng);
   String label = place != null ? place.getName() : "Parking Spot";
   endMarker.title(label + " @ " + RouteCursorAdapter.getRouteTimeAgo(this, route));
   endMarker.icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_launcher));
   endMarker.anchor(0.5f, 0.5f);
   map.addMarker(endMarker);
 }