Skip to content
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

[location-component] Add isLocatedAt API to location component plugin. #99

Merged
merged 2 commits into from
Feb 24, 2021

Conversation

pengdev
Copy link
Member

@pengdev pengdev commented Feb 12, 2021

PRs must be submitted under the terms of our Contributor License Agreement CLA.
Fixes: < Link to related issues that will be fixed by this pull request, if they exist >

Pull request checklist:

  • Briefly describe the changes in this PR.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality. If tests were not written, please explain why.
  • Add example if relevant.
  • Document any changes to public APIs.
  • Apply changelog label ('breaking change', 'bug 🪲', 'build', 'docs', 'feature 🍏', 'performance ⚡', 'testing 💯') or use the label 'skip changelog'
  • Add an entry inside this element for inclusion in the mapbox-maps-android changelog: <changelog></changelog>.

Summary of changes

This PR adds the isPointOnLocationPuck API to the location component plugin, it can be used to validate if a MapClicked event is invoked on top of the location component puck.

User impact (optional)

@pengdev pengdev force-pushed the peng-add-point-at-location-component branch from 1ed2450 to 4fc3cc7 Compare February 12, 2021 10:27
@pengdev pengdev self-assigned this Feb 12, 2021
@pengdev pengdev requested a review from a team February 12, 2021 10:27
@pengdev pengdev force-pushed the peng-add-point-at-location-component branch from 4fc3cc7 to e93db26 Compare February 15, 2021 10:53
@pengdev
Copy link
Member Author

pengdev commented Feb 24, 2021

@tobrun @kiryldz I renamed the following:
isPointOnLocationPuck to isLocatedAt
And

/**	
 * Listener that gets invoked when the is point on location puck validation finished.	
 */
fun interface IsPointOnLocationPuckListener {	
  /**	
   * This method is called when the is point on location puck validation finished.	
   *	
   * @param isOnLocationPuck true if the given point is on the location puck, false otherwise.	
   */	
  fun isPointOnLocationPuck(isOnLocationPuck: Boolean)	
}

to

/**
 * Listener that gets invoked when the is location puck rendered on point validation finished.
 */
fun interface LocatedAtValidationListener {
  /**
   * This method is called when the is location puck rendered on point validation finished.
   *
   * @param isLocationRenderedAtPoint true if the given point is on the rendered location puck, false otherwise.
   */
  fun onResult(isLocationRenderedAtPoint: Boolean)
} 

Please take a second look before I merge.

cc @nishant-karajgikar

@pengdev pengdev force-pushed the peng-add-point-at-location-component branch from 635cb05 to a2f9a5e Compare February 24, 2021 10:17
@pengdev pengdev marked this pull request as ready for review February 24, 2021 10:18
@kiryldz
Copy link
Contributor

kiryldz commented Feb 24, 2021

@tobrun @kiryldz I renamed the following:
isPointOnLocationPuck to isLocatedAt
And

/**	
 * Listener that gets invoked when the is point on location puck validation finished.	
 */
fun interface IsPointOnLocationPuckListener {	
  /**	
   * This method is called when the is point on location puck validation finished.	
   *	
   * @param isOnLocationPuck true if the given point is on the location puck, false otherwise.	
   */	
  fun isPointOnLocationPuck(isOnLocationPuck: Boolean)	
}

to

/**
 * Listener that gets invoked when the is location puck rendered on point validation finished.
 */
fun interface LocatedAtValidationListener {
  /**
   * This method is called when the is location puck rendered on point validation finished.
   *
   * @param isLocationRenderedAtPoint true if the given point is on the rendered location puck, false otherwise.
   */
  fun onResult(isLocationRenderedAtPoint: Boolean)
} 

Please take a second look before I merge.

cc @nishant-karajgikar

Personally do not like that LocatedAtValidationListener especially validation.
Perhaps smth like PuckLocatedAtPointListener and fun onResult inside?

@pengdev pengdev changed the title [location-component] Add isPointOnLocationPuck API. [location-component] Add isLocatedAt API to location component plugin. Feb 24, 2021
@pengdev pengdev force-pushed the peng-add-point-at-location-component branch from a2f9a5e to 66b83c1 Compare February 24, 2021 10:28
Copy link
Contributor

@kiryldz kiryldz left a comment

Choose a reason for hiding this comment

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

Nice job!

@pengdev pengdev merged commit 68d12be into main Feb 24, 2021
@pengdev pengdev deleted the peng-add-point-at-location-component branch February 24, 2021 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants