Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

MGLAnnotationView not update location immediately on setCoordinate: #5230

Closed

Description

@Gerz-inc

Platform: iOS
Mapbox SDK version: 3.3 alpha-3

Steps to trigger behavior

  1. [annotation setCoordinate:CLLocationCoordinate2DMake(...,...)];

Expected behavior

Updating position of MGLAnnotationView on map view

Actual behavior

Position changing only if map region changed, other annotations added or other manipulations with map

Activity

  1. 1ec5 commented on Jun 3, 2016

    @1ec5
    Contributor

    At one point, I think this code was getting lucky and causing all annotations to be redrawn, including view-backed annotations. But we should add something explicit here to update the annotation views.

    /cc @boundsj

  2. added
    iOSMapbox Maps SDK for iOS
    annotationsAnnotations on iOS and macOS or markers on Android
    on Jun 3, 2016
  3. added this to the ios-v3.3.0 milestone on Jun 3, 2016
  4. 1ec5 commented on Jun 5, 2016

    @1ec5
    Contributor

    Actually, I’m seeing a somewhat different bug. The iosapp demo application is configured so that tapping on an annotation’s callout view changes the annotation’s coordinates to the screen center. But if I remove the (otherwise unused) implementation of -[MGLMapViewDelegate imageForAnnotation:], when tapping a view-backed annotation’s callout, an annotation image (with the default red pin image) also appears at the screen center in addition to the annotation view:

    centered

  5. self-assigned this
    on Jun 5, 2016
  6. added 3 commits that reference this issue on Jun 6, 2016
    5b64c3a
    d524b2e
  7. 1ec5 commented on Jun 20, 2016

    @1ec5
    Contributor

    #5245 would fix this issue for sure by introducing an explicit update of the annotation view in response to the KVO change notification.

  8. added a commit that references this issue on Jun 24, 2016
    a19e6b7
  9. 1ec5 commented on Jul 3, 2016

    @1ec5
    Contributor

    Fixed in #5550, which will be in v3.3.0-beta.3 shortly.

  10. Gerz-inc commented on Aug 1, 2016

    @Gerz-inc
    Author

    I tested on version 3.3.3, no change. The marker position are updated immediately only if to move the map, or after few seconds
    11

  11. 1ec5 commented on Aug 1, 2016

    @1ec5
    Contributor

    That sounds similar to the issue described in #5755 (comment).

  12. prgorasiya commented on Apr 22, 2020

    @prgorasiya

    @Gerz-inc Could you provide the sample code for the animated car movement animation as I am unable to achieve the same results for my project?
    Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

annotationsAnnotations on iOS and macOS or markers on AndroidbugiOSMapbox Maps SDK for iOS

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions