Author Topic: New HB showroute implementation  (Read 31329 times)

0 Members and 2 Guests are viewing this topic.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Yesterday at 10:17:44 pm
New HB showroute implementation
« on: June 20, 2020, 05:59:23 pm »
Now for your enjoyment and testing on tmtest: a new Highway Browser implementation to view chopped and connected route data, to replace the old functionality of /hb/index.php when r= was specified to load a route.

  • The big new feature is to be able to show an entire connected route at once.  When a connected route is displayed, labels in popups on the map include the .list name for easy selection of endpoints for the new 6-field .list entries that will be announced soon.
  • When viewing a chopped route, there's a link below the .list name label to load the whole connected route (question: should this be there for connected routes consisting of just one chopped route?)
  • When viewing a connected route with more than a single chopped route, you can link to individual chopped routes through the rows in the Route Stats table.
  • Shading to indicate which segments are traveled in the Waypoints table now starts and ends in the middle of the rows corresponding to the endpoints of the travel.  To me this is more accurate and intuitive, but I can put it back if there's an outcry against it.
  • A single marker contains labels for both chopped routes where they meet at region boundaries.
  • Much of this is a reimplementation for efficiency (no more dependency for the HB on waypoints.js.php!).  It should also use somewhat less memory as some redundant or unused data is no longer created and stored.
  • The Zoom to Fit link has been replaced with a button that just fits the existing data onto the screen, and does not require a reload.
  • This reimplementation has been done with an eye toward future (long-requested) functionality to generate .list file lines by selecting points and segments on the map and in the waypoint table.  That will be much more feasible with this simplified implementation.

Route selection using the big, ugly tables is unchanged so far, and still uses the /hb/index.php mechanisms for now, but links to routes will go right to the new showroute.php.  Better search functionality is a project for another day.

I am sure I have some bugs, as this is several hundred lines of new or significantly reorganized or relocated code.  Please report problems here or in GitHub Issues.

Offline yakra

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4422
  • Last Login:November 11, 2024, 12:50:03 pm
  • I like C++
Re: New HB showroute implementation
« Reply #1 on: June 20, 2020, 07:31:15 pm »
Quote
Shading to indicate which segments are traveled in the Waypoints table now starts and ends in the middle of the rows corresponding to the endpoints of the travel.
Nicely done. I like it.

Intersecting/Concurrent Routes:

When browsing a ConnectedRoute, clicking a link under Intersecting/Concurrent Routes links to the intersecting chopped, rather than connected, route.

Replacing the links in the popup with javascript:showRouteWithCurrentView('me.i095') is a step backwards IMO.
Those actual links to the HB were useful for copying link addresses to paste into the forum or GitHub or open in another browser window, and especially to right-click & open in a new tab, which I do frequently.
Was there something in particular that made the use of the javascript function desirable? In any case, we still need to query the DB and load all the new route's info...
Sri Syadasti Syadavaktavya Syadasti Syannasti Syadasti Cavaktavyasca Syadasti Syannasti Syadavatavyasca Syadasti Syannasti Syadavaktavyasca

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Yesterday at 10:17:44 pm
Re: New HB showroute implementation
« Reply #2 on: June 20, 2020, 07:47:53 pm »
When browsing a ConnectedRoute, clicking a link under Intersecting/Concurrent Routes links to the intersecting chopped, rather than connected, route.

I can change it if that's the preferred functionality.

Quote
Replacing the links in the popup with javascript:showRouteWithCurrentView('me.i095') is a step backwards IMO.
Those actual links to the HB were useful for copying link addresses to paste into the forum or GitHub or open in another browser window, and especially to right-click & open in a new tab, which I do frequently.
Was there something in particular that made the use of the javascript function desirable? In any case, we still need to query the DB and load all the new route's info...

Yes, I wanted to get the popups entirely created at startup time so I wouldn't need to store additional info to create them, but I don't know what the coordinates and zoom level will be when someone clicks, so instead I pass through to that JS function.

Offline yakra

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4422
  • Last Login:November 11, 2024, 12:50:03 pm
  • I like C++
Re: New HB showroute implementation
« Reply #3 on: June 20, 2020, 09:26:03 pm »
I can change it if that's the preferred functionality.
Seems most intuitive to continue browsing in the same mode.
OTOH, switching back to &cr mode is just one click away.
What will most travelers find more intuitive & useful?

Yes, I wanted to get the popups entirely created at startup time so I wouldn't need to store additional info to create them, but I don't know what the coordinates and zoom level will be when someone clicks, so instead I pass through to that JS function.
It's been a while since first implemented and I'm a little rusty, but I believe the bones of each popup was created at startup. Clicking on a waypoint marker or on the table would trigger some javascript to rewrite the innerHTML of the popup in question.
https://github.com/TravelMapping/Web/commit/701837f08c3bf7a861acfc3d69cd24de3e3d9c8a
If all popups are stored at startup, I can't see what additional info needs to be stored.
I'd love to be able to continue to copy links from the popup & especially open links in a new tab.
Sri Syadasti Syadavaktavya Syadasti Syannasti Syadasti Cavaktavyasca Syadasti Syannasti Syadavatavyasca Syadasti Syannasti Syadavaktavyasca

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Yesterday at 10:17:44 pm
Re: New HB showroute implementation
« Reply #4 on: June 20, 2020, 09:38:21 pm »
It's been a while since first implemented and I'm a little rusty, but I believe the bones of each popup was created at startup. Clicking on a waypoint marker or on the table would trigger some javascript to rewrite the innerHTML of the popup in question.
https://github.com/TravelMapping/Web/commit/701837f08c3bf7a861acfc3d69cd24de3e3d9c8a
If all popups are stored at startup, I can't see what additional info needs to be stored.
I'd love to be able to continue to copy links from the popup & especially open links in a new tab.

Yes, the main text was created at the start with an element whose contents would be replaced by the actual intersecting route links including the lat/lon/zoom.

I just changed the JS so it will open in a new window/tab.  Maybe that's a good middle ground?

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Yesterday at 10:17:44 pm
Re: New HB showroute implementation
« Reply #5 on: June 20, 2020, 11:33:30 pm »
Re: the intersecting route link, I am going to be storing some extra data with each connection to support the .list entry creation, so it might not be much work or much more memory to store the info to create the popups on the fly and match the current HB's functionality.

Offline yakra

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4422
  • Last Login:November 11, 2024, 12:50:03 pm
  • I like C++
Re: New HB showroute implementation
« Reply #6 on: June 21, 2020, 02:58:44 am »
Ooh, yes please! I would love that.
Sri Syadasti Syadavaktavya Syadasti Syannasti Syadasti Cavaktavyasca Syadasti Syannasti Syadavatavyasca Syadasti Syannasti Syadavaktavyasca

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4849
  • Last Login:Yesterday at 11:21:09 am
Re: New HB showroute implementation
« Reply #7 on: June 21, 2020, 03:11:50 am »
A lot of changes...

When clicking on "Intersecting / Concurrent Routes", a new tab is opened. That's really bad. It should just be opened in the same tab as in actual production HB version so that one can jump from route to route to map the travels.

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4849
  • Last Login:Yesterday at 11:21:09 am
Re: New HB showroute implementation
« Reply #8 on: June 21, 2020, 03:26:37 am »
The user list file entry should be presented a little bit more "visible". Maybe bold or in a different color.
And as mentioned before, I'd love to have a "copy to clipboard" button for it.
« Last Edit: June 21, 2020, 03:29:19 am by michih »

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4849
  • Last Login:Yesterday at 11:21:09 am
Re: New HB showroute implementation
« Reply #9 on: June 21, 2020, 03:33:33 am »
"related routes" is missing

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Yesterday at 10:17:44 pm
Re: New HB showroute implementation
« Reply #10 on: June 21, 2020, 07:42:06 am »
"related routes" is missing

I don't plan to bring that back, given all of its flaws.  If we want to have some sense of what routes are "related" to each other when not in the same connected route, I think we need to augment the data with information about what we mean by that.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Yesterday at 10:17:44 pm
Re: New HB showroute implementation
« Reply #11 on: June 21, 2020, 08:26:38 am »
"related routes" is missing

I don't plan to bring that back, given all of its flaws.  If we want to have some sense of what routes are "related" to each other when not in the same connected route, I think we need to augment the data with information about what we mean by that.

But at least for now, the rte= functionality of mapview will remain for those cases when it provides some useful information.

We had discussion elsewhere about the flaws of rte=, but my quick summary:

  • It relates routes that aren't related, like the unrelated routes worldwide that have names like "A4", the unrelated U.S. Interstates I-84, I-86, I-87, and I-88
  • It fails to relate routes that should be related, like the I-35E/W pairs, and 3dis

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Yesterday at 10:17:44 pm
Re: New HB showroute implementation
« Reply #12 on: June 21, 2020, 08:32:05 am »
When clicking on "Intersecting / Concurrent Routes", a new tab is opened. That's really bad. It should just be opened in the same tab as in actual production HB version so that one can jump from route to route to map the travels.

See upthread, I should be able to restore the same-tab functionality while still allowing a copyable link as I continue toward the .list entry toolbox functionality.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Yesterday at 10:17:44 pm
Re: New HB showroute implementation
« Reply #13 on: June 21, 2020, 01:30:14 pm »
My first pass at .list entry generation in the new HB showroute is up on tmtest.  To try it, click the "Show Toolbox" checkbox in the control bar at the top.  Basic instructions appear in the draggable popup that appears when you enable that checkbox.

Useful?

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4849
  • Last Login:Yesterday at 11:21:09 am
Re: New HB showroute implementation
« Reply #14 on: June 21, 2020, 01:49:13 pm »
I always get the whole route selected. From first to last wp. No chance to select anything else...

edit: Got it! Click on the segment, not at the wp as we are used to...