相关疑难解决方法(0)

在谷歌地图android中移动带有gps的标记

我想使标记的举动中GOOGLE MAP,而gps位置变化只是喜欢UBER的应用程序.我找到了一些解决方案但无法解决我的问题.解决方案是12

以下是我的onLocationChange()方法

public void onLocationChanged(Location location) {

    double lattitude = location.getLatitude();
    double longitude = location.getLongitude();

    mLastLocation = location;
    if (mCurrLocationMarker != null) {
        mCurrLocationMarker.remove();
    }
    //Place current location marker
    LatLng latLng = new LatLng(lattitude, longitude);
    MarkerOptions markerOptions = new MarkerOptions();
    markerOptions.position(latLng);
    markerOptions.title("I am here");
    markerOptions.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED));

    mCurrLocationMarker = mGoogleMap.addMarker(markerOptions);

    tv_loc.append("Lattitude: " + lattitude + "  Longitude: " + longitude);

    //move map camera
    mGoogleMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));
    mGoogleMap.animateCamera(CameraUpdateFactory.zoomTo(15));

    //stop location updates
    if (mGoogleApiClient …
Run Code Online (Sandbox Code Playgroud)

gps android google-maps google-maps-api-3

18
推荐指数
2
解决办法
7968
查看次数

标签 统计

android ×1

google-maps ×1

google-maps-api-3 ×1

gps ×1