wtf nth

  • Archive
  • RSS

GeoCoordinateWatcher.Position has NaN values

I was trying to get the current position of the Windows Phone:

        new GeoCoordinateWatcher(GeoPositionAccuracy.High).Position;

Position’s fields are almost entirely NaN. To remedy this, call Start() first:

        GeoCoordinateWatcher watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High);
        watcher.Start();
        GeoPosition<GeoCoordinate> geoPos = watcher.Position;

Then your values will be as expected.

  • 4 months ago
  • Permalink
  • Share
    Tweet
← Previous • Next →

About

stuff I learned the hard way

Pages

  • why
  • me
  • RSS
  • Random
  • Archive
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr