Android 城市地图的选址问题

Android 城市地图的选址问题,android,citymaps,Android,Citymaps,我遇到了一些关于城市地图的位置问题,如下所示: 1、 我创建了一个扩展FragmentActivity的活动,它实现了接口MapViewReadyListener、LocationSource、LocationListener,然后初始化SupportCityMapFragment实例,设置一些参数如下: fragment = (SupportCitymapsMapFragment)getSupportFragmentManager().findFragmentById(R.id.map

我遇到了一些关于城市地图的位置问题,如下所示:

1、 我创建了一个扩展FragmentActivity的活动,它实现了接口MapViewReadyListener、LocationSource、LocationListener,然后初始化SupportCityMapFragment实例,设置一些参数如下:

    fragment = (SupportCitymapsMapFragment)getSupportFragmentManager().findFragmentById(R.id.map);
    mLocationManager = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE);
    mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this);
    mParams = new LocationParams(1, 1000, 1000);


    if (fragment != null) {
        fragment.getMapView().startUpdatingLocation();
        fragment.getMapView().getBusinessLayer().setVisible(false);
        fragment.getMapView().getRegionLayer().setVisible(false);
        fragment.setMapViewReadyListener(MainActivity.this);
        fragment.getMapView().setLocationSource(this);
    }
在方法onLocationChangedLocation中,我将地图位置设置为:

    CitymapsMapView map = fragment.getMapView();
    map.getBusinessLayer().setVisible(false);
    map.getRegionLayer().setVisible(false);
    LonLat position = new LonLat(location.getLongitude(), location.getLatitude());
    int zoom = 15;
    float orientation = 45.0f;
    float tilt = 15.0f;
    MapPosition mapPosition = new MapPosition(position, zoom, orientation, tilt);
    map.setMapPosition(mapPosition);
但当我打开gps和我的应用程序时,我发现地图上显示的位置不是我的当前位置,而是最后一个位置,更重要的是,地图有时无法加载,即使我的网络很好,为什么

2、 我正在尝试用其他方法获取经纬度坐标,我用传统的方法创建地图视图。当我去一个新的地方打开我的应用程序时,我发现箭头仍然在最后一个位置,但祝酒词给了我关于我当前位置的正确提示。大约半小时后,再次打开应用程序,它刚好正确,为什么是这样吗


3、 我已将标签添加到标记,是否可以自定义标签的字体样式?

我是Citymaps SDK的开发人员,我将尽我所能回答您的问题

1您似乎误解了LocationSource接口的工作原理。请查看以查看示例实现

2如果您使用的是自定义位置源,则由您在位置发生更改时通知地图

3此时,该API未公开。如果希望使用自定义字体的标记标签,我建议将自定义视图组渲染为位图,并将该位图设置为标记的图像