use of com.here.android.mpa.common.LocationDataSource in project here-android-sdk-examples by heremaps.
the class PositioningService method initMapEngine.
/**
* Initialize HERE SDK map engine.
*/
private void initMapEngine() {
if (MapEngine.isInitialized()) {
return;
}
final MapEngine engine = MapEngine.getInstance();
engine.init(new ApplicationContext(getApplicationContext()), new OnEngineInitListener() {
@Override
public void onEngineInitializationCompleted(Error error) {
if (error == OnEngineInitListener.Error.NONE) {
mNotificationUtils.updateNotification(R.drawable.ic_paused, R.string.notificationTitle, R.string.notificationMapEngineReady);
if (mListener != null) {
try {
mListener.onEngineIntialized();
} catch (RemoteException ex) {
// ignored
}
}
final PositioningManager posManager = PositioningManager.getInstance();
final LocationDataSource hereLocation = LocationDataSourceHERE.getInstance();
if (hereLocation == null) {
Log.e(TAG, "initMapEngine: failed to instantiate HERE location");
return;
}
posManager.setDataSource(hereLocation);
} else {
Log.e(TAG, "initMapEngine: MapEngine.init failed: " + error.getDetails());
}
}
});
}
Aggregations