gpt4 book ai didi

android google maps v2 想要显示 2 市场显示

转载 作者:行者123 更新时间:2023-11-29 18:00:51 24 4
gpt4 key购买 nike

我试过喜欢 [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 工作正常

最佳答案

尝试使用 LatLngBounds.Builder:

LatLngBounds.Builder builder = new LatLngBounds.Builder();
builder.include(latlongcr);
builder.include(latlong);
LatLngBounds bounds = builder.build();
mapView.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 20));

关于android google maps v2 想要显示 2 市场显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16188326/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com