maps - Windows Phone - continuously tracking and ReverseGeocodeQuery -


i'm using new windows phone 8 maps , maps toolkit. on each positionchanged event, set userlocationmarker new position. if user taps on userlocationmarker, show map location via reversegeocodequery , set user location pushpin visible. fast, execute reversegeocodequery in positionchanged event.

my question is, if users location changed quickly, execute many reversegeocodequerys. performance issue?

private void initializegeolocator() {     geolocator = new geolocator();     geolocator.desiredaccuracy = positionaccuracy.high;     geolocator.movementthreshold = 5;     geolocator.statuschanged += geolocator_statuschanged;     geolocator.positionchanged += geolocator_positionchanged; }  private void geolocator_positionchanged(geolocator sender, positionchangedeventargs args) {     dispatcher.begininvoke(() =>     {         geoposition geoposition = args.position;          this.userlocationmarker.geocoordinate = geoposition.coordinate.togeocoordinate();         this.userlocationmarker.visibility = system.windows.visibility.visible;          // execute reversegeocodequery...         // set pushpin     }); }  private void userlocationmarker_tap(object sender, gestureeventargs e) {     // show user location pushpin...     userlocationpushpin.visibility = visibility.visible; } 

if reversegeocodequery called inside positionchanged event, yes, can lead performance problems.

as general rule, asynchronous call in windows phone (and windows 8 / winrt) implies may not return value in fixed time - may take 50ms, may take 5 seconds.

with reversegeocodequery, makes network call nokia’s servers (geo.nlp.nokia.com) address. , although call return when using wifi or 3g connection, not true if had poor reception.

and although can understand you’re trying - address in advance when user taps on userlocationmarker, address appears instantly - bad network quality create either delay or exception.

my suggestion follow approach built-in maps app uses. is, when user taps on userlocationmarker, displays “looking...” label, async address lookup, updates label address.

also keep in mind, don’t know if reversegeocodequery rate limited. doesn’t appear be, might change in future other services - such google’s geocoding api.

what ever decide do, handy tools testing are...

  1. fiddler (and how use fiddler wp8 emulator)
  2. simulation dashboard windows phone (simulate bad network conditions, etc)

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -