nbarone/parking_onx — pull request #1 by Raikia (2012-06-12 00:32:34+00:00)
Title: Fixed scope/GPS problem

I quickly fixed all the bugs I listed in the on{x} thread: https://dev.onx.ms/forums/topic/parking-location-recipe-mentioned-in-video/#post-2464

Here is a quote of my post:

No, === is actually correct. The second “==” should be “===”, but its not required. All that does is type checking (as well as value checking).
As far as how it works, I can’t say specifically. I do notice that you have some scope problems occurring (typically not an issue in Javascript, but I’ve run into similar scope problems with on{x}). You declare longitude_source and latitude_source inside an anonymous function, then use them outside of it. That’s not “allowed” and, thus, outside the anonymous function, it is null.
Not only that, but you also never START the GPS listener. You need a “listener.start()” statement in there somewhere. When you add that, notice that the handler for “changed” is going to run concurrently, so you need to implement some sort of check on your GPS coordinates.
When I get home from work, I’ll fork + patch + commit it so you can see what I mean if you don’t understand. Good start though!