Results 1 to 3 of 3

Thread: How to hide the compass (instantly)

  1. #1
    Neuer skobbler
    Join Date
    06.07.2014
    Posts
    8

    How to hide the compass (instantly)

    Hi,

    I'm showing and hiding the compass like so:

    self.mapView.settings.showCompass = YES;
    self.mapView.settings.showCompass = NO;

    It works, but only after I drag the map around.

    This wouldn't be good from a UX perspective (for example, if there was a menu where users could tap to hide / show the compass).

    I also tried to hide / show the compass on the main thread, like so:

    dispatch_async(dispatch_get_main_queue(), ^{
    self.mapView.settings.showCompass = NO;
    });

    But no luck.

    I wonder, is it by design? Would there be anything I could do?

    Thanks.

  2. #2
    Dev platform evangelist dandronic's Avatar
    Join Date
    31.03.2014
    Posts
    177
    The behaviour you are experiencing is a bug ("showing/hiding the compass did not trigger a map render") - it will be fixed in a future release.

    A workaround for this would be simply setting the visible region to the current visible region.
    self.mapView.visibleRegion = self.mapView.visibleRegion;

  3. #3
    Neuer skobbler
    Join Date
    06.07.2014
    Posts
    8
    Cool, I got it. Thanks for replying.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •