Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.14.9

* Adds `PlatformCap` for `PlatformPolyline.startCap` and `endCap`.

## 2.14.8

* Updates Java compatibility version to 11.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,8 @@ static String interpretPolylineOptions(
float density) {
sink.setConsumeTapEvents(polyline.getConsumesTapEvents());
sink.setColor(polyline.getColor().intValue());
sink.setEndCap(toCap(polyline.getEndCap(), assetManager, density));
sink.setStartCap(toCap(polyline.getStartCap(), assetManager, density));
sink.setEndCap(capFromPigeon(polyline.getEndCap(), assetManager, density));
sink.setStartCap(capFromPigeon(polyline.getStartCap(), assetManager, density));
sink.setGeodesic(polyline.getGeodesic());
sink.setJointType(jointTypeFromPigeon(polyline.getJointType()));
sink.setVisible(polyline.getVisible());
Expand Down Expand Up @@ -874,25 +874,24 @@ private static List<PatternItem> patternFromPigeon(
return pattern;
}

private static Cap toCap(Object o, AssetManager assetManager, float density) {
final List<?> data = toList(o);
switch (toString(data.get(0))) {
case "buttCap":
private static Cap capFromPigeon(
Messages.PlatformCap cap, AssetManager assetManager, float density) {
switch (cap.getType()) {
case BUTT_CAP:
return new ButtCap();
case "roundCap":
case ROUND_CAP:
return new RoundCap();
case "squareCap":
case SQUARE_CAP:
return new SquareCap();
case "customCap":
if (data.size() == 2) {
return new CustomCap(toBitmapDescriptor(data.get(1), assetManager, density));
} else {
return new CustomCap(
toBitmapDescriptor(data.get(1), assetManager, density), toFloat(data.get(2)));
case CUSTOM_CAP:
if (cap.getRefWidth() == null) {
throw new IllegalArgumentException("A Custom Cap must specify a refWidth value.");
}
default:
throw new IllegalArgumentException("Cannot interpret " + o + " as Cap");
return new CustomCap(
toBitmapDescriptor(cap.getBitmapDescriptor(), assetManager, density),
cap.getRefWidth().floatValue());
}
throw new IllegalArgumentException("Unrecognized Cap type: " + cap.getType());
}

static String interpretTileOverlayOptions(
Expand Down
Loading