1

我试过喜欢 [with 2 Lat Long Details]

              final LatLng latlong = new LatLng(lat,lng);
              final LatLng latlongcr = new LatLng(currentlat,currentlong);

                 mapView.addMarker(new MarkerOptions().position(latlongcr).title("Here You Are"));
                 mapView.addMarker(new MarkerOptions().position(latlong).title(addr));

                 mapView.moveCamera(CameraUpdateFactory.newLatLngZoom(latlong, 20));
                 mapView.moveCamera(CameraUpdateFactory.newLatLngZoom(latlongcr, 20));
                 mapView.animateCamera(CameraUpdateFactory.zoomTo(20), 2000, null);

但只获得一个标记。想要显示 2 个标记 Mapview 工作正常

4

1 回答 1

3

尝试使用LatLngBounds.Builder

LatLngBounds.Builder builder = new LatLngBounds.Builder();
builder.include(latlongcr);
builder.include(latlong);
LatLngBounds bounds = builder.build();
mapView.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 20));
于 2013-04-24T09:48:28.577 回答