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

Add View.ToMap and View.ToScreen conversion methods #160

Merged
merged 2 commits into from
Apr 15, 2023

Conversation

TimPurdum
Copy link
Collaborator

Closes #156

  • Added both ToMap to convert a screen coordinates point to a map point and ToScreen to do the reverse
  • Added a simple round trip test to the click even handler in the Events.razor samples page.

@TimPurdum TimPurdum requested a review from seahro April 13, 2023 21:55
@TimPurdum TimPurdum self-assigned this Apr 13, 2023
{
_clickJson = BuildViewableJson(clickEvent);
ScreenPoint screenPoint = await _view.ToScreen(clickEvent.MapPoint);
Copy link
Collaborator

Choose a reason for hiding this comment

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

excited about putting this to use. I will need to look some at the docs to see more if the same conversion methods will apply the same when drawing lines, polygons etc when multiple points are applied to the graphic, vs singular points

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Even though there is a Point referenced here, it is not necessarily a graphic, and the conversions would not be available for a line or polygon, but you could for example convert a single point from a line/polygon.

Copy link
Collaborator

@seahro seahro left a comment

Choose a reason for hiding this comment

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

Looks good.

@TimPurdum TimPurdum merged commit 96f98eb into develop Apr 15, 2023
@TimPurdum TimPurdum deleted the feature/156_screen_to_map branch April 15, 2023 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add View.ToMap Method
2 participants