Position indicator in HERE SDK premium is not show

2019-07-25 13:09发布

Here is my simple implementation.

The MapFragment is already initialized. If I do the simulation mode the position indicator is showing but if I switched to the actual TBT navigation it is not showing where I am located.

PositionManager positioningManager; 
    if(positioningManager == null) {
                        positioningManager = PositioningManager.getInstance();
                        positioningManager.addListener(new WeakReference<>(positionChangedListener));
                        positioningManager.start(PositioningManager.LocationMethod.GPS_NETWORK);
                }

                positionIndicator = mMap.getPositionIndicator();
                positionIndicator.setVisible(true);
                positionIndicator.setAccuracyIndicatorVisible(true);

private PositioningManager.OnPositionChangedListener positionChangedListener =
            new PositioningManager.OnPositionChangedListener() {
        @Override
        public void onPositionUpdated(PositioningManager.LocationMethod locationMethod,
                                      GeoPosition geoPosition, boolean b) {
            Log.d(TAG, "onPositionUpdated " + locationMethod.name());
            Log.d(TAG, "Coordinates " +geoPosition.getCoordinate());


    }

    @Override
    public void onPositionFixChanged(PositioningManager.LocationMethod locationMethod,
                                     PositioningManager.LocationStatus locationStatus) {
        Log.d(TAG, "onPositionFixChanged " + locationMethod.name() + " status " + locationStatus.name());

    }
};

0条回答
登录 后发表回答