Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[google_maps_flutter] Partial Android host API Pigeon conversion #6967

Merged
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.10.0

* Converts some platform calls to Pigeon.

## 2.9.1

* Converts inspector interface platform calls to Pigeon.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,11 +439,15 @@ static Object latLngToJson(LatLng latLng) {

static Messages.PlatformLatLng latLngToPigeon(LatLng latLng) {
return new Messages.PlatformLatLng.Builder()
.setLat(latLng.latitude)
.setLng(latLng.longitude)
.setLatitude(latLng.latitude)
.setLongitude(latLng.longitude)
.build();
}

static LatLng latLngFromPigeon(Messages.PlatformLatLng latLng) {
return new LatLng(latLng.getLatitude(), latLng.getLongitude());
}

static Object clusterToJson(String clusterManagerId, Cluster<MarkerBuilder> cluster) {
int clusterSize = cluster.getSize();
LatLngBounds.Builder latLngBoundsBuilder = LatLngBounds.builder();
Expand Down Expand Up @@ -500,17 +504,12 @@ static LatLng toLatLng(Object o) {
return new LatLng(toDouble(data.get(0)), toDouble(data.get(1)));
}

static Point toPoint(Object o) {
Object x = toMap(o).get("x");
Object y = toMap(o).get("y");
return new Point((int) x, (int) y);
static Point pointFromPigeon(Messages.PlatformPoint point) {
return new Point(point.getX().intValue(), point.getY().intValue());
}

static Map<String, Integer> pointToJson(Point point) {
final Map<String, Integer> data = new HashMap<>(2);
data.put("x", point.x);
data.put("y", point.y);
return data;
static Messages.PlatformPoint pointToPigeon(Point point) {
return new Messages.PlatformPoint.Builder().setX((long) point.x).setY((long) point.y).build();
}

private static LatLngBounds toLatLngBounds(Object o) {
Expand Down
Loading