【发布时间】:2020-02-19 12:45:59
【问题描述】:
ArrayList<LatLng> arrayList= new ArrayList<LatLng>();
LatLng near = new LatLng(33.549232, 73.125256);
LatLng pass = new LatLng(33.549844, 73.125849);
LatLng qareeb = new LatLng(33.549603, 73.124201);
public void onMapReady(GoogleMap googleMap) {
mMap= googleMap;
for (int i =0; i<arrayList.size();i++){
mMap.addMarker(new MarkerOptions().position(arrayList.get(i)).title("Marker").snippet("and snippet")
.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_ORANGE)));
LatLng latLng = new LatLng(currentLocation.getLatitude(),currentLocation.getLongitude());
MarkerOptions markerOptions = new MarkerOptions().position(latLng).title("Main Yahan hn");
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(arrayList.get(i),15));
mMap.animateCamera(CameraUpdateFactory.zoomIn());
mMap.animateCamera(CameraUpdateFactory.zoomTo(15), 2000, null);
/*mMap.animateCamera(CameraUpdateFactory.zoomTo(15.0f));*/
mMap.moveCamera(CameraUpdateFactory.newLatLng(arrayList.get(i)));
googleMap.addMarker(markerOptions);
}
}
上面是我的代码,我想创建 3 个点来与我当前的位置进行比较,哪个点靠近当前位置。
【问题讨论】:
标签: android api android-gps