HustleTime Development: F express in Brooklyn

It’s been a few weeks since I last posted to the blog, and I wanted to let you know that I’m still here and working on HustleTime (on Ios anyway).

I’ve decided to abandon Android development for the time being, as the react-native-maps library is woefully out of date, and now only community supported. There are some strange things happening in Android that have caused me too much grief to continue to spin my wheels on it.

If HustleTime takes off on Ios, I’ll consider revamping and retooling the Android version, but for now, I’m sticking with Ios.

F Express

The MTA in its infinite wisdom has decided to add 2 express F trains in Brooklyn every morning (just two!) So in the next update to HustleTime, you’ll be able to see those trains and ignore them in the app.

I’ve also added a timeout to more of the gps functions in the app, so if you’re not able to get gps coordinates on the first function call, you should now be able to do that again. The code looks like this:

  getLocation = () => {
    navigator.geolocation.getCurrentPosition(
      currentPosition => {
        this.props.dispatchedCircleCenter({
          latitude: currentPosition.coords.latitude,
          longitude:currentPosition.coords.longitude})}, 
      error => null,
      { timeout: 2000 }
    )
  }

getCurrentPosition() takes 3 arguments, the third being a timeout, which I had conspicuously omitted from prior versions. This would explain strange behavior when underground (for example) when you couldn’t get your location, nor could you update your position if you connected to a network.