-
-
Notifications
You must be signed in to change notification settings - Fork 866
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
Added MapController.pointToLatLng() to get LatLng of given screen point #1115
Added MapController.pointToLatLng() to get LatLng of given screen point #1115
Conversation
Fantastic! I recently manually coded this using parts from the library, but I couldn't do it easily because I didn't have access to internal variables. |
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.
I like this, does it pass dartfmt ok ? (not sure what we're using these days, but line 86 indentation map.dart looks like it should be spaced out, but this is very minor)?
Nope sorry, I'll Is there a way to get it done automatically? |
I just pushed a fix that caused calculation to be wrong when user zoomed the map. RPReplay_Final1641984191.movHas anyone an idea? |
I updated my example but still can't figure out what's wrong :( It looks like Kapture.2022-01-13.at.07.58.49.mp4 |
258ce7a
to
772db9c
Compare
Are you still having problems with the rotation issue ? |
Yes no updates here. Might need some help... We've - for now - disabled rotation on our app when this is active. |
See if this works for you....
If it does (the icon rotates around its own center, but I think either a nonrotatedwidget or an opposite rotation would probably fix), maybe the rotated matrix stuff could be broken out into a separate method, as there may be uses for it being called elsewhere.... |
Just wondering on this one, if pointToLatLng should take the option of using the maps rotation (then it could use the matrix code). As some may want to use this as a separate method sometimes for a straightforward calculation ignoring rotation. This also needs pull upstream so we can merge whenever, as there have been some changes since. |
I'll be on vacation for two weeks, might work back on it around mi-february. Feel free to work on it during this time :) |
@HugoHeneault Any news on this? Thanks. |
No and I don't have time this days so if you'd like to investigate do not hesitate :) |
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
This should still be reviewed and fixed as I'm sure other people will need it... |
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
@HugoHeneault would you mind re-basing this branch from master when you have time? I'll take a look at it after that. |
I'm on it :) |
Yeah, I can't do anything directly as it's someone else's fork. I'll try fixing it through suggestions... |
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.
Maybe now?
If it's working, I'll apply the suggested fix tomorrow morning with formating, if you haven't figured it out already. Thanks guys for your help (I'm sorry I didn't followed the suggestion as I've moved on another project) |
@HugoHeneault Thanks. All is needed now (I think) is just the addition of a trailing newline. Should just be able to run |
d682baf
to
3e63a08
Compare
I did the reformat and tested. It works! Thanks alot @ibrierley for the solution and @pablojimpas & @JaffaKetchup for the follow-up! LGTM :) |
Co-authored-by: Polo <gitpjp@pm.me> and ibrierley Update lib/src/map/map.dart Update lib/src/map/map.dart Fix trailing lines
3e63a08
to
c228f78
Compare
Seems good to me, thanks to: Will merge now... |
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.
LGTM!
wow, just in time, perfect, thanks! |
Hi @ibrierley |
Are you all sorted on this now (I noted your other issue is closed), or still having an issue ? |
@ibrierley Thanks ,i got it working now. |
Hi, @ibrierley I am sorry to disturb you, I have been trying to achieve this for days. Without luck, I am trying here to convert LatLng Point (I need the point to be a LatLng point so Local/Global position won't work) to a point (Offset) with taking mind map rotation.
can you help me, please. |
Why do you need the latlng from screen point out of interest, normally there is a simpler way. |
@ibrierley Thanks for response, I am using flutter_map_line_editor |
Why are your touch and point positions not the same ? |
@ibrierley , Because the point the and the touch position will not be same |
From the info provided, I can't really see what you need to have working beyond the original code, so I'm probably missing something. If you want to provide a minimal example I can run, to highlight your issue, I will take a look and see if I can help. |
can we chat on the discord channel to make things easier , I will give in short time an example |
@ibrierley Hi , Here is a minimal example https://filebin.net/f3na2ig0nilvp4hp/example.zip When you start the app make sure you have rotation on the map to see the effect |
You need to create a smaller single example, without any plugins and highlight what is wrong with pointToLatLng with a rotation. |
@ibrierley There is no wrong with pointToLatLng, I just want LatLngToPoint with rotation |
Ok, this issue is about pointToLatLng, and the code you quoted is that :D. Probably why the confusion with no example. Can you open a new issue that is latLngToPoint, not pointToLatLng, so it's clear what you need. |
@ibrierley yes sure |
I wanted to get LatLng of a given point on screen, but couldn't find an easy way to.
So I've implemented a
MapController.pointToLatLng()
inspired by @maRci002's answer.Ref #496, ref #607, ref #981, ref #1010