Why Does Map Marker Lurch Around The Map

后端 未结 2 1330
臣服心动
臣服心动 2021-01-25 16:34

I\'m in Android Studio and I have a map fragment (com.google.android.gms.maps.SupportMapFragment) that has two markers. One is static and called Target. The other tracks my move

2条回答
  •  醉话见心
    2021-01-25 17:29

    I was using network instead of GPS.

    Changed

     locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);
    

    To

     locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);
    

    It now tracks my movements smoothly. Thanks to Daniel Nugent for pointing this out to me an another post.

    Greg

提交回复
热议问题