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

I need the LatLng of the midpoint of the widget where I render the map. #361

Closed
GULERTOLGA opened this issue Jul 17, 2020 · 5 comments · Fixed by #380
Closed

I need the LatLng of the midpoint of the widget where I render the map. #361

GULERTOLGA opened this issue Jul 17, 2020 · 5 comments · Fixed by #380
Labels
enhancement New feature or request

Comments

@GULERTOLGA
Copy link
Contributor

I want to make a precise drawing by sliding the map below this point.

@m0nac0
Copy link
Collaborator

m0nac0 commented Jul 17, 2020

@GULERTOLGA So you'd like to access the projection (LatLng of the corners of the currently displayed map section? Center of that should be relatively easy to calculate then.

@m0nac0 m0nac0 added the enhancement New feature or request label Jul 17, 2020
@GULERTOLGA
Copy link
Contributor Author

GULERTOLGA commented Jul 20, 2020

Yes, it can be calculated as you said, but it does not give the exact result. I think it is necessary to make geodetic calculations. I will place a positioned widget (a red circle as pointer) right in the middle of the map. The map will move under this widget. Cartesian coordinates and geographic coordinates will not match.

@m0nac0
Copy link
Collaborator

m0nac0 commented Jul 24, 2020

@GULERTOLGA I'm not quite sure if I correctly understand your issue, unfortunately. Does calculating the center of MapboxMapController.getVisibleRegion() give you a wrong result (= a point that is not exactly in the center)?

@GULERTOLGA
Copy link
Contributor Author

Actually all I want is pixel to coordinate function.

ezgif com-video-to-gif (3)

you can see that the positions of the red dot do not match the symbol.

thanks.

@m0nac0
Copy link
Collaborator

m0nac0 commented Jul 27, 2020

@GULERTOLGA Got you. I have actually been working on a pixel <--> geographic coordinate conversion feature, I hope I'll be able to finish it in the next few weeks when I have more time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants