Author Topic: Better edge/connection popups  (Read 27508 times)

0 Members and 1 Guest are viewing this topic.

Offline yakra

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4422
  • Last Login:November 11, 2024, 12:50:03 pm
  • I like C++
Re: Better edge/connection popups
« Reply #30 on: July 16, 2019, 05:36:12 pm »
LOL, I was just poking fun at my own poor use of language there.
(If we're able to actually get the best of both worlds, and neither "world" has to settle for second-best, then by definition there's not really any need to compromise.
OTOH, if we are compromising, that implies that both worlds are settling for less.)


But seriously, I haven't tried out the new enhancement myself yet, just read the discussion & michih's reviews & description of how it works.
And it sounds pretty good, for what we're working with.

How about this?
Test whether the northernmost point is inside the viewport.
If so, then open the popup at the northernmost point.
If not, then open the popup at the click location.
Would this work?
Sri Syadasti Syadavaktavya Syadasti Syannasti Syadasti Cavaktavyasca Syadasti Syannasti Syadavatavyasca Syadasti Syannasti Syadavaktavyasca

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Today at 09:35:08 pm
Re: Better edge/connection popups
« Reply #31 on: July 16, 2019, 07:32:13 pm »
How about this?
Test whether the northernmost point is inside the viewport.
If so, then open the popup at the northernmost point.
If not, then open the popup at the click location.
Would this work?

I like the idea, but I think the test is complicated a bit by the fact that we'd want to make sure that not only the northernmost point is in the viewport, but whether it's far enough down from the top that there's room for the popup without an automatic pan to get it on.

I'm planning to leave what I have for now.  Once we can get that on the production site, we'll see what people think of the current behavior.

Offline yakra

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4422
  • Last Login:November 11, 2024, 12:50:03 pm
  • I like C++
Re: Better edge/connection popups
« Reply #32 on: July 17, 2019, 10:49:12 am »
A quick comparison Firefox <-> Chromium shows the popup to be the same height. Assuming the CSS gets this uniform across browsers...
Pixel position <-> latitude can be converted similar to
https://github.com/yakra/tmtools/blob/master/tmg2html/tmg2html.cpp#L417
https://github.com/yakra/tmtools/blob/master/tmg2html/tmg2html.cpp#L420-L421
https://github.com/yakra/tmtools/blob/master/tmg2html/tmg2html.cpp#L562
That's the basic idea, it'd be a little different in a Leaflet setting.
Don't take this as me clamoring for this feature though, I'm just overthinking it for fun.
Sri Syadasti Syadavaktavya Syadasti Syannasti Syadasti Cavaktavyasca Syadasti Syannasti Syadavatavyasca Syadasti Syannasti Syadavaktavyasca