Google Maps蓝点位于正确的位置,但放大了错误的位置

时间:2018-10-23 19:49:48

标签: android google-maps-api-3 android-mapview

         LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
        Criteria criteria = new Criteria();

        Location location = locationManager.getLastKnownLocation(locationManager.getBestProvider(criteria, false));
        googleMap.setMyLocationEnabled(true);
        LatLng place = new LatLng(location.getLatitude(), location.getLongitude());
        Log.d("Location", String.valueOf(place));
        CameraUpdate locations = CameraUpdateFactory.newLatLngZoom(
                place, 14);
        googleMap.animateCamera(locations);

此代码的第一行将蓝色点放在地图上的正确位置,但是当地图对缩放进行动画处理时,它将放大到错误的位置(相距不远,可能约为0.2-0.5英里)。

0 个答案:

没有答案