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

[ASMapNode] Toggling liveMap on does not enable touches #1753

Closed
george-gw opened this issue Jun 16, 2016 · 5 comments
Closed

[ASMapNode] Toggling liveMap on does not enable touches #1753

george-gw opened this issue Jun 16, 2016 · 5 comments

Comments

@george-gw
Copy link
Contributor

Scenario:
1- Create ASMapNode
2- At some point during the app, toggle liveMap = true
3- Map does not receive touches
Solution:
when you set liveMap = true, set mapNode.userInteractionEnabled = true

Looking at the code, I saw that self.userInteractionEnabled = YES is only enabled in didLoad of ASMapNode when the node is created with liveMap = true, was there a reason for it to be that way rather than enabling and disabling it in addLiveMap and removeLiveMap respectively?

@george-gw george-gw changed the title [ASMapNode] toggling liveMap on does not enable touches [ASMapNode] Toggling liveMap on does not enable touches Jun 16, 2016
@hannahmbanana
Copy link
Contributor

@george-gw: Great question - thanks for watching out for the consistency of ASDK's API!

@aaronschubert0: It looks like you were the original author of this feature. Could you weigh in on this? Was this the intended behavior?

@hannahmbanana
Copy link
Contributor

@george-gw: I just checked out the code and this does seem to be an oversight rather than a feature. Do you feel confident putting up a pull request for this?

@hannahmbanana
Copy link
Contributor

@george-gw: I tested this and userInteraction is enabled after setting liveMap=YES (sometime after creating the map node). However, it seems that the mapNode is capturing the touch events.

@aaronschubert0
Copy link
Contributor

aaronschubert0 commented Jun 17, 2016

@hannahmbanana @george-gw Yeah seems to be an oversight, strange it wasn't flagged earlier. @george-gw happy for you to submit a PR for this if you wish (so you can test on your specific scenario), otherwise I can fix it.

george-gw added a commit to george-gw/AsyncDisplayKit that referenced this issue Jun 17, 2016
…ive#1753)

ASMapNode: Change map snapshot when updating it with a new region (facebookarchive#1754)
ASMapNode: Commented out code that is causing inaccurate behavior
george-gw added a commit to george-gw/AsyncDisplayKit that referenced this issue Jun 17, 2016
…ive#1753)

ASMapNode: Change map snapshot when updating it with a new region (facebookarchive#1754)
ASMapNode: Commented out code that is causing inaccurate behavior
Added a basic example for ASMapNode to try out the different changes
@george-gw
Copy link
Contributor Author

@hannahmbanana I have added an Example in the pull request, I don't know if this should be there, but it's a way for you to test out the different solutions, you can actually take that code and run it on the old version (without my changes) to see the differences.
I have also NSLoged the userInteractionEnabled variable so you can see its value as you tap the toggle button to switch liveMap on and off.

george-gw added a commit to george-gw/AsyncDisplayKit that referenced this issue Jun 21, 2016
…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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants