Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Feature] Ruler / Draw on Map #306

Open
jwalatham opened this issue Apr 26, 2024 · 7 comments
Open

[Feature] Ruler / Draw on Map #306

jwalatham opened this issue Apr 26, 2024 · 7 comments

Comments

@jwalatham
Copy link

It would be great to utilise the Openlayers ruler code, to draw a line between two points on the map and measure the distance and bearing between them. For example, to measure how far an aircraft is from my location or another point, or the distance between two aircraft.

@jwalatham jwalatham changed the title [Feature] [Feature] Ruler / Draw on Map Apr 26, 2024
@RundesBalli
Copy link

Very nice idea, I support this feature request. :-)

@mpentler
Copy link
Contributor

I've wanted to try and do this for a while but couldn't figure it out. It'd be like ATC staff have on their displays and would be cool for better situational awareness. I'd love to see this but foresee it being difficult to integrate with scrolling and map clicking. Maybe a button up top to enter that mode?

@mpentler
Copy link
Contributor

Well, I started to learn how to make a layer and draw on it, and now I've added a ruler button that turns the layer on and off and draws a dot at 0,0.

Baby steps. This is helping me to learn the tar1090 flow too. I need to figure out where to add some click handlers to be able to draw on the map, though.

@wiedehopf
Copy link
Owner

Really one issue is where to put an extra button.

I suppose the extra button can be enabled from the settings menu ...

@mpentler
Copy link
Contributor

mpentler commented May 28, 2024

You're right. I am not running globe mode on my local install, so I had no replay button and could stick it there. Otherwise it'd just have to go next to it, and then that's 5 buttons on the top row: U/H/T/Replay/Ruler

Other option is a button on the top left, somewhere untouched by other things right now. Although my ruler controls are currently displayed up there when you turn the ruler mode on, so that won't work for me during this testing.

Could make it a drop down thing - but the problem with the design side is that there's too many possibilities with it. I am trying to match the design of the map as-is right now.

Edit: Is this where the magic happens? I'll need to put in code to handle ruler mode here, and I expect I will need to modify the other clauses. Current idea I have right now is to disable everything else when in ruler mode (so selecting and deselecting planes, double click to follow etc) - not sure if you have opinions on this?

OLMap.on(['click', 'dblclick'], function(evt) {
  more here
  ...

Edit: Seemingly it is! I can click the map and have some coordinates put into my little window.

@mpentler
Copy link
Contributor

mpentler commented Jun 3, 2024

Got a working prototype going, but I don't think my code is really up to scratch. I will probably put it in a branch on my own fork. It also respects your DisplayUnits choice.

Only issue is this looks awful on mobile and interferes with those buttons. Also 5 in a row doesn't look great on mobile (say, if Replay button is there).

image
image

@mpentler
Copy link
Contributor

mpentler commented Jun 8, 2024

Now up on my repo, ruler branch. It's very shit.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants