How to return an custom func obserable

What I am trying to do is simple.
I have (also my code is really ugly, i am hoping there is a better way than a million nested thens etc.

` Geolocation.getCurrentPosition().then((position) => {
  console.log(`got position at ${position.coords.latitude}, ${position.coords.longitude}`);
  
  this.testService.loadUserSettings().subscribe(() => {
    console.log("user settings loaded");
    
    this.testService.loadDataWithPosition(position.coords.latitude, position.coords.longitude)
      .subscribe(data => {
        console.log("acquired data with position");
        this.testService.setData(data);
        this.rootPage = TabsPage;
      }, (error) => {
        console.error("aquired data with position failed", error);
      });

  }, (error) => {
    console.error("loading users data failed", error);
  });

})`

Once loadusersettings completes I want to call the rest of my code because it depends on it, but it seems that nothing ever gets returned because it seems loadDataWithPosition never is called.

I have tried to create an obserable to subscribe to so i can make sure my dependent code has everything before its called.

Here is my loadusersettings code

 setMeasurementTypeToDefault() {
    console.log("setting measurement type to default");
    let measurementTypeDefault = "0";
    this.measurementType = measurementTypeDefault;
    this.storage.set("measurementType", measurementTypeDefault);

}
setDistanceToDefault() {
    let distanceDefault = 15;
    console.log("setting distance to default");
    this.storage.set("distance", distanceDefault);
    this.distance = distanceDefault;
}
loadUserSettings(): Observable<any> {
    return Observable.create(observer => {
        this.storage.get("userId")
            .then((val) => {
                if (val != null) {
                    this.userId = val;
                    console.log("found userid in storage " + val);
                    this.storage.get("measurementType")
                        .then((val) => {
                            if (val) {
                                console.log("found measurement type in storage " + val);
                                this.measurementType = val;
                            }
                            else {
                                this.setMeasurementTypeToDefault();
                            }

                        }).then(() => {
                            this.storage.get("distance")
                                .then((val) => {
                                    if (val) {
                                        console.log("found distance  in storage " + val);
                                        this.distance = val;
                                    }
                                    else {
                                        this.setDistanceToDefault();
                                    }

                                })
                        }).then(() => { return null });
                }
                else {
                    console.log("generating user id");
                    this.generateUserId().subscribe(data => {
                        this.storage.set("userId", data);
                        this.userId = data;
                        this.setDistanceToDefault();
                        this.setMeasurementTypeToDefault();

                        console.log("generated user id " + data);
                        return null;
                    });

                }

            });


    });

}

stackoverflow is your friend… http://stackoverflow.com/questions/34523338/rxjs-sequence-equvalent-to-promise-then