Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

[ASMapNode] bug fixes + added the ability to zoom in on the annotations + example project #1792

Merged
merged 5 commits into from
Jul 12, 2016

Conversation

george-gw
Copy link
Contributor

@george-gw george-gw commented Jun 21, 2016

A minor change: Fixed typo in some comment

…hive#1753)

[ASMapNode] Change map snapshot when updating it with a new region (facebookarchive#1754)
[ASMapNode] Commented out code that is causing inaccurate behavior
[ASMapNode] Added the ability to zoom in and show annotations, similar to showAnnotations:animated: of MKMapView.
Added a basic example for ASMapNode to try out the different changes
@ghost
Copy link

ghost commented Jun 21, 2016

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

@ghost
Copy link

ghost commented Jun 21, 2016

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

options.scale = oldOptions.scale;
options.region = region;
self.options = options;
// self.options.region = region;
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the motivation for this change?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I see, it's to trigger a new snapshot. Hmm. Let's use [self.options copy] instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

@george-gw yes, @Adlai-Holler is right - we should copy the options, then just write to the region value, and set it back to self.options.

Copy link
Contributor Author

@george-gw george-gw Jul 11, 2016

Choose a reason for hiding this comment

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

@appleguy @Adlai-Holler I had written it with [self.options copy] before, but it didn't work for some reason, that's why I did what I did there. But I must have done something wrong somewhere else because it seems to work fine now with [self.options copy].

Thanks!

@appleguy
Copy link
Contributor

Looks like a number of revisions are required here. Thanks for contributing, @george-gw! This is an important component, so we should get at least two ASDK accepts to land.

@george-gw
Copy link
Contributor Author

george-gw commented Jul 11, 2016

@appleguy I fixed everything except setting userInteractionEnabled = YES by default because of the pending discussion, I hope that's ok!

Thank you for the revisions and this library!

@hannahmbanana
Copy link
Contributor

@Adlai-Holler @maicki - time for a 2nd review on this.

@Adlai-Holler
Copy link
Contributor

Would you be willing to protect the new showAnnotationsOptions flag with a lock? I doubt it will be contended often, but better safe than sorry. And then once it's protected, ensure that the property is only read once during setAnnotations:.

Once that is in, 👍 from me!

@hannahmbanana
Copy link
Contributor

@george-gw

@george-gw
Copy link
Contributor Author

george-gw commented Jul 12, 2016

@Adlai-Holler: Wouldn't it potentially cause a problem in addLiveMap if I protect it with a mutex, since it requires to be called on the main thread?

PS: I added the lock

@george-gw
Copy link
Contributor Author

That's odd! Why would the test fail based on the new commit?
I tried running the test locally, it worked fine for me.

@Adlai-Holler
Copy link
Contributor

Adlai-Holler commented Jul 12, 2016

@george-gw It should be OK because it's acceptable for the main thread to wait on background threads.

Strange that an arbitrary ASDisplayLayer test failed. I've restarted the tests – let's see if the failure occurs again.

@appleguy @hannahmbanana Maybe we have a fragile test? Here's the failure:

_ASDisplayLayerTests
  testDelegateDrawInContextAsync, ((asyncDelegate.drawRectCount) equal to (0u)) failed: ("1") is not equal to ("0")
  /Users/travis/build/facebook/AsyncDisplayKit/AsyncDisplayKitTests/ASDisplayLayerTests.m:361
    XCTAssertEqual(layer.drawInContextCount, 0u);
    XCTAssertEqual(asyncDelegate.drawRectCount, 0u);
    dispatch_resume([_ASDisplayLayer displayQueue]);
     Executed 308 tests, with 1 failure (0 unexpected) in 26.641 (27.338) seconds

@george-gw
Copy link
Contributor Author

george-gw commented Jul 12, 2016

@Adlai-Holler Alright, cool! And thanks for restarting the test, seems good now!

@Adlai-Holler Adlai-Holler merged commit e40597e into facebookarchive:master Jul 12, 2016
@Adlai-Holler
Copy link
Contributor

Thanks for following through on this one @george-gw ! Glad to have this in.

@george-gw
Copy link
Contributor Author

george-gw commented Jul 12, 2016

I enjoyed the collaboration, thank you for your input @Adlai-Holler :)

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

Successfully merging this pull request may close these issues.

6 participants