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

Allow annotation images to be updated - #3146

Closed
RomainQuidet wants to merge 3 commits into
mapbox:masterfrom
Mappy:issue-2210
Closed

RomainQuidet wants to merge 3 commits into
mapbox:masterfrom
Mappy:issue-2210

Conversation

@RomainQuidet

Copy link
Copy Markdown
Contributor

Add possibility to delete / update a sprite in order to update an AnnotationImage
#2210

Fixes #2517

@incanus

incanus commented Nov 30, 2015

Copy link
Copy Markdown
Contributor

Thanks for this @RomainQuidet. May take a bit, but we will try to review this soon. It looks pretty clean.

/cc @kkaefer @jfirebaugh @1ec5

Comment thread include/mbgl/ios/MGLAnnotationImage.h Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MGLMapView currently assumes that the reuse identifier is non-null. With a nil identifier, this line would crash. Is there a need for it to be nullable?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
That was a reminder to make it nullable as in the official MapKit. This identifier is used to recycle the instance for performance reason, it should not be used internally like today to reference the image view in a dictionary or even deeper with the sprites

@RomainQuidet

Copy link
Copy Markdown
Contributor Author

@1ec5 : do you need me to update the pull request or will you merge it ?

@1ec5

1ec5 commented Dec 14, 2015

Copy link
Copy Markdown
Contributor

Since we use fast-forward merging, it'd be cleaner for you to rebase and resolve the conflicts. I'd be happy to do it but I'd have to open a new PR and close this one.

@RomainQuidet

Copy link
Copy Markdown
Contributor Author

@1ec5 : branch rebased and corrections done according to your code review

@1ec5 1ec5 changed the title Issue 2210 Allow annotation images to be updated Dec 15, 2015
@1ec5

1ec5 commented Dec 16, 2015

Copy link
Copy Markdown
Contributor

Merged in 9d0ab55...82a5575. The test failure above is a random KIF failure, and Bitrise won’t let me rebuild the fork branch.

Thanks @RomainQuidet!

@alexagat

Copy link
Copy Markdown

When I update the image property on a MGLAnnotationImage, for example in the didSelectAnnotation function:

func mapView(mapView: MGLMapView, didSelectAnnotation annotation: MGLAnnotation) {
    annotationsTitlesAndImages[annotation.title!!]!.image = UIImage(named: "map-pin-active")!
}

...I see the below block of code in mapbox-gl framework run, but the annotation image does not update:

- (void)setImage:(UIImage *)image {
    _image = image;
    [self.delegate annotationImageNeedsRedisplay:self];
}

Is this still an issue?

@1ec5

1ec5 commented Mar 31, 2016

Copy link
Copy Markdown
Contributor

@alexagat, can you open a new issue about this? It sounds like a regression if that’s the case.

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

Labels

feature iOS Mapbox Maps SDK for iOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants