New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new CardPartMapView #185
Conversation
This also includes some cleanup of the zoom property, as it isn't being used actively in the example.
Initially, I chose to use the mapview setRegion signature that allowed latitudinal and longitudinal meter properties to define the "zoom" level of the map. After reading online, it seemed like the more appropriate way to do this is to use the span (MKCoordinateSpan) property to set the map zoom level.
Below code can be simplified even more cleaner
This layout{} method also sets translatesAutoResizing to false as well.. |
$0.leading == self.leadingAnchor | ||
$0.trailing == self.trailingAnchor | ||
$0.bottom == self.bottomAnchor | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome , looks very clean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that was very nice cleanup. Thanks for that.
Awesome work, @codethebeard! I think a few potentially awesome properties to expose as bindable would be:
It's awesome that you made the Again, we appreciate the contributions and are open to hear about any other features you'd like to see in CardParts. Thanks! |
@croossin Thanks man! I appreciate the opportunity. I can certainly add those properties. |
So I just started looking at this and realized that both the MKMapView.annotations I could potentially expose them as a ControlProperty possibly which might be able to give you some mechanism to observe on those changes, however in the case of userLocation the recommended way to obtain that value is to implement the MKMapView's Any thoughts? I'm a little new to this level of RX but would love to learn a thing if there's a way to properly do what you're asking. |
@codethebeard What if for the annotations we used Maybe we take a look at how RxMKMapView deals with annotation binding. I just felt that binding annotations to the mapview would be a key request, but we can discuss if we want to have that as a "to-do" feature. |
@croossin Yeah, I can see a lot of people wanting that type of feature. I'll start taking a look at the RxMKMapView when I get some free time today to see what they are doing and report back. |
@codethebeard Awesome! I'm sure we can figure out this problem 🤓 |
@croossin So, I took a look at RxMKMapView to see how they are doing the annotation binding. I gave it the ol' college try but that rabbit hole goes pretty deep and it's honestly a little over my head. Maybe someone out there in the community with more Swift/RxSwift experience and time could be able to make this Card Part what it really needs to be. |
No worries at all @codethebeard. Awesome work thus far. I will go ahead and merge/release this tomorrow! We can add that support later on. Feel free to email (chase_roossin@intuit.com) your t-shirt size as well as mailing address if you’d like some Intuit swag for helping participate and contribute during Hacktoberfest! We really appreciate all the work. |
Related to #183
Alright! Putting myself out there for the first time. Here's my first stab at it. I added three different properties that can be accessed via the RX binding syntax:
I also made sure the the underlying MKMapView was available so that users could access its delegate functions or interact with the map directly as needed.
In my example, I showed how you could bind directly to a CardPartTextField's value and change the location of the map. At the same time, I'm cycling through different "zoom levels".
I'm totally open to adding more bindable properties if you think it needs more.
On a personal note, this was a lot of fun and this library is very well organized. Well done to all of the other contributors that have worked on this project.