use of com.google.android.gms.maps.model.Dot in project android-maps-utils by googlemaps.
the class GeoJsonPolygonStyleTest method testStrokePattern.
@Test
public void testStrokePattern() {
List<PatternItem> strokePatternItems = new ArrayList<>();
strokePatternItems.add(new Dot());
polygonStyle.setStrokePattern(strokePatternItems);
assertEquals(strokePatternItems, polygonStyle.getStrokePattern());
assertEquals(strokePatternItems, polygonStyle.toPolygonOptions().getStrokePattern());
}
use of com.google.android.gms.maps.model.Dot in project NavitiaSDKUX_android by CanalTP.
the class JourneyMapViewComponentSpec method onBind.
@OnBind
static void onBind(final ComponentContext context, final MapView mapView, @Prop Bundle savedInstanceState, @Prop final Journey journey) {
mapView.onCreate(savedInstanceState);
mapView.getMapAsync(new OnMapReadyCallback() {
@SuppressWarnings("unchecked")
@Override
public void onMapReady(final GoogleMap googleMap) {
mapView.onResume();
googleMap.setOnCameraIdleListener(new GoogleMap.OnCameraIdleListener() {
@Override
public void onCameraIdle() {
redrawIntermediatePointCircles(googleMap);
}
});
googleMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {
@Override
public boolean onMarkerClick(Marker marker) {
return true;
}
});
JourneyPathElements journeyPathElements = new JourneyPathElements(journey);
for (SectionPolyline sectionPolyline : journeyPathElements.getSectionPolylines()) {
PolylineOptions polylineOptions = new PolylineOptions().zIndex(1);
if (sectionPolyline.getType().equalsIgnoreCase(SectionPolyline.TYPE_STREET_NETWORK) && sectionPolyline.getMode().equalsIgnoreCase(SectionPolyline.MODE_WALKING)) {
polylineOptions.pattern(Arrays.asList(new Dot(), new Gap(10)));
}
polylineOptions.width(sectionPolyline.getWidth()).color(sectionPolyline.getColor());
polylineOptions.addAll(sectionPolyline.getSectionPathCoordinates());
googleMap.addPolyline(polylineOptions);
}
intermediatePointsCircles.clear();
for (LatLng centerCoord : journeyPathElements.getIntermediatePointsCirclesCoords()) {
CircleOptions circleOptions = new CircleOptions().center(centerCoord).strokeColor(Color.BLACK).strokeWidth(8).fillColor(Color.WHITE).radius(getCircleRadiusDependingOnCurrentCameraZoom(googleMap.getCameraPosition().zoom)).zIndex(2);
intermediatePointsCircles.add(googleMap.addCircle(circleOptions));
}
LatLng[] ridesharingCoordinates = getRidesharingJourneyCoordinates(journey);
LatLng departureCoordinates = getJourneyDepartureCoordinates(journey);
LatLng arrivalCoordinates = getJourneyArrivalCoordinates(journey);
String departureLabel = context.getString(R.string.departure);
String arrivalLabel = context.getString(R.string.arrival);
if (departureCoordinates.equals(ridesharingCoordinates[0])) {
MarkerOptions departureMarkerOptions = new MarkerOptions().position(ridesharingCoordinates[0]).icon(BitmapDescriptorFactory.fromBitmap(getPlaceMarkerIcon(context, departureLabel, Configuration.colors.getOrigin(), true)));
googleMap.addMarker(departureMarkerOptions);
} else {
if (ridesharingCoordinates[0] != null) {
MarkerOptions ridesharingDepartureMarkerOptions = new MarkerOptions().position(ridesharingCoordinates[0]).icon(BitmapDescriptorFactory.fromBitmap(getPlaceMarkerIcon(context, null, null, true)));
googleMap.addMarker(ridesharingDepartureMarkerOptions);
}
MarkerOptions departureMarkerOptions = new MarkerOptions().position(departureCoordinates).icon(BitmapDescriptorFactory.fromBitmap(getPlaceMarkerIcon(context, departureLabel, Configuration.colors.getOrigin(), false)));
googleMap.addMarker(departureMarkerOptions);
}
if (arrivalCoordinates.equals(ridesharingCoordinates[1])) {
MarkerOptions arrivalMarkerOptions = new MarkerOptions().position(ridesharingCoordinates[1]).icon(BitmapDescriptorFactory.fromBitmap(getPlaceMarkerIcon(context, arrivalLabel, Configuration.colors.getDestination(), true)));
googleMap.addMarker(arrivalMarkerOptions);
} else {
if (ridesharingCoordinates[1] != null) {
MarkerOptions ridesharingArrivalMarkerOptions = new MarkerOptions().position(ridesharingCoordinates[1]).icon(BitmapDescriptorFactory.fromBitmap(getPlaceMarkerIcon(context, null, null, true)));
googleMap.addMarker(ridesharingArrivalMarkerOptions);
}
MarkerOptions arrivalMarkerOptions = new MarkerOptions().position(arrivalCoordinates).icon(BitmapDescriptorFactory.fromBitmap(getPlaceMarkerIcon(context, arrivalLabel, Configuration.colors.getDestination(), false)));
googleMap.addMarker(arrivalMarkerOptions);
}
zoomToPolyline(googleMap, journeyPathElements.getJourneyPolylineCoords(), false);
}
});
}
Aggregations