Author Topic: New Mapview on the main site  (Read 2963 times)

0 Members and 1 Guest are viewing this topic.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2732
  • Last Login:Today at 08:47:31 am
New Mapview on the main site
« on: June 09, 2020, 04:27:39 pm »
The new Mapview implementation is now live on the production site.  Please let me know here or in GitHub Issues if you notice any problems or have any suggestions.  I'm going to grab some things from the previous thread and make GitHub Issues and address them as time permits.

Offline yakra

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4234
  • Last Login:February 13, 2024, 07:19:36 pm
  • I like C++
Re: New Mapview on the main site
« Reply #1 on: June 10, 2020, 02:41:54 am »
http://tmtest.teresco.org/user/mapview.php?units=miles&rte=NY17 has vanilla NY17 and PA NY17SWa panned off the west edge of the map. The westernmost bits of NY17Bin are also clipped; +X101 is at or just off the W edge of the map. I still need to zoom out one level to fit all NY17 segments within the viewport. 1680x1050 display.
That seems to happen in various situations, and I'm stumped.  Try rg=CT,RI and western CT might be off the screen for you, as it is for me.  I must not be including something in the bounding box computation to send to the map's fitBounds method, but I can't find it.
http://tmtest.teresco.org/user/mapview.php?units=miles&u=yakra&rg=CT,RI is good.
http://tmtest.teresco.org/user/mapview.php?units=miles&u=yakra&cr=oh.i080 is broken. West edge of my screen is slightly into UT. East edge a little into IL. The route appears at first glance to be off-center a bit too far north, but checks out when we account for the southern extent of I-80 nationwide.


Normally when viewing a ConnectedRoute, chopped routes are in CSV order in the route table. I-80, I-05 & US1 all check out.
Not http://tmtest.teresco.org/user/mapview.php?units=miles&u=yakra&cr=chnjl.g25 for whatever reason.
Right now, the _con.csv line is:
chng;G25;;Tianjin;chnnm.g25,chnjl.g25,chnln.g25,chnhe.g25,chntj.g25,chnhe.g25hua,chnsd.g25bin
but the first 3 chopped routes in the table are JL, LN, NM respectively.
Sri Syadasti Syadavaktavya Syadasti Syannasti Syadasti Cavaktavyasca Syadasti Syannasti Syadavatavyasca Syadasti Syannasti Syadavaktavyasca

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2732
  • Last Login:Today at 08:47:31 am
Re: New Mapview on the main site
« Reply #2 on: June 10, 2020, 09:24:20 am »
http://tmtest.teresco.org/user/mapview.php?units=miles&u=yakra&rg=CT,RI is good.
http://tmtest.teresco.org/user/mapview.php?units=miles&u=yakra&cr=oh.i080 is broken. West edge of my screen is slightly into UT. East edge a little into IL. The route appears at first glance to be off-center a bit too far north, but checks out when we account for the southern extent of I-80 nationwide.

I'm thinking it's centered, just not zoomed out enough.  I'm not sure why the fitBounds function doesn't zoom out beyond a certain level.  I don't think I put any restrictions on it, intentionally.  You might have noticed that when you set the zoom level though the popup, it's limited as to how far out you can go.  That is done intentionally to avoid an initial load with a massive amount of data.  As far as I can tell, there's no way fitBounds should get it's hands on that limit.

Quote
Normally when viewing a ConnectedRoute, chopped routes are in CSV order in the route table. I-80, I-05 & US1 all check out.
Not http://tmtest.teresco.org/user/mapview.php?units=miles&u=yakra&cr=chnjl.g25 for whatever reason.
Right now, the _con.csv line is:
chng;G25;;Tianjin;chnnm.g25,chnjl.g25,chnln.g25,chnhe.g25,chntj.g25,chnhe.g25hua,chnsd.g25bin
but the first 3 chopped routes in the table are JL, LN, NM respectively.

Aside: isn't the CSV order incorrect?

mapview.php is putting things in the array in the chng_con.csv order;

Code: [Select]
mapviewParams.roots.push('chnnm.g25');
mapviewParams.roots.push('chnjl.g25');
mapviewParams.roots.push('chnln.g25');
mapviewParams.roots.push('chnhe.g25');
mapviewParams.roots.push('chntj.g25');
mapviewParams.roots.push('chnhe.g25hua');
mapviewParams.roots.push('chnsd.g25bin');

But.. it's the order of the routes in chng.csv that matters on the query, as that's the order used to gather segments, then from those segments, the routes they comprise to be added to the table.  I think a reorder of the G25 entries in chng.csv would fix this.

Maybe we need to clarify that the order routes show up in abcx.csv should match their order with an entry of abcx_con.csv?  It's possible this is the first time we've depended on that, but unless there's a reason we might want to allow different orderings in those files, I'd rather fix the data than complicate the code.
« Last Edit: June 10, 2020, 10:26:24 am by Jim »

Online si404

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 1944
  • Last Login:Today at 09:11:32 am
Re: New Mapview on the main site
« Reply #3 on: June 10, 2020, 09:46:16 am »
Aside: isn't the CSV order incorrect?
I believe so. Certainly, I've not fixed the connected route errors in China yet. They aren't really a priority at the moment!
Quote
I'd rather fix the data than complicate the code.
Given you wouldn't have to fix the data, but you would have to fix the code that's not surprising.  ;)

But, even as the one who'll have to fix the data, I concur.
« Last Edit: June 10, 2020, 09:48:40 am by si404 »

Offline yakra

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4234
  • Last Login:February 13, 2024, 07:19:36 pm
  • I like C++
Re: New Mapview on the main site
« Reply #4 on: June 10, 2020, 12:29:26 pm »
Ah! I had not even thought about the chopped routes CSV order in all of that.
Sri Syadasti Syadavaktavya Syadasti Syannasti Syadasti Cavaktavyasca Syadasti Syannasti Syadavatavyasca Syadasti Syannasti Syadavaktavyasca

Offline yakra

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4234
  • Last Login:February 13, 2024, 07:19:36 pm
  • I like C++
Re: New Mapview on the main site
« Reply #5 on: June 10, 2020, 01:21:02 pm »
http://tmtest.teresco.org/user/mapview.php?units=miles&u=yakra&cr=ks.i035&rg=OK,MO
gives the same results as
http://tmtest.teresco.org/user/mapview.php?units=miles&u=yakra&cr=ks.i035
It shows all of the I-35 (N. Texas - S. Minnesota) ConnectedRoute, not just restricted to the regions specified.
Sri Syadasti Syadavaktavya Syadasti Syannasti Syadasti Cavaktavyasca Syadasti Syannasti Syadavatavyasca Syadasti Syannasti Syadavaktavyasca

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2732
  • Last Login:Today at 08:47:31 am
Re: New Mapview on the main site
« Reply #6 on: June 10, 2020, 01:35:39 pm »
http://tmtest.teresco.org/user/mapview.php?units=miles&u=yakra&cr=ks.i035&rg=OK,MO
gives the same results as
http://tmtest.teresco.org/user/mapview.php?units=miles&u=yakra&cr=ks.i035
It shows all of the I-35 (N. Texas - S. Minnesota) ConnectedRoute, not just restricted to the regions specified.

I left that out intentionally, thinking it's unlikely to be what anyone wants.  If there's a need for it, I can augment the queries to restrict also to regions for cr= maps.

Offline yakra

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4234
  • Last Login:February 13, 2024, 07:19:36 pm
  • I like C++
Re: New Mapview on the main site
« Reply #7 on: June 10, 2020, 01:41:58 pm »
It's nothing I want especially, just something I decided on a whim to test out. Not especially useful IMO, but how I would expect it behave given that set of params. Not having looked into the code behind this, I'd have thought that might be the simpler way to organize the code. Though that's not necessarily how things work out in reality; having looked at the old code a little, I know there's quite a bit that goes into constructing the SQL queries. :)
Sri Syadasti Syadavaktavya Syadasti Syannasti Syadasti Cavaktavyasca Syadasti Syannasti Syadavatavyasca Syadasti Syannasti Syadavaktavyasca

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2732
  • Last Login:Today at 08:47:31 am
Re: New Mapview on the main site
« Reply #8 on: June 15, 2020, 10:34:57 am »
Geolocation is now on the main site for Mapview and the Highway Browser, if your device supports it and your browser settings permit access.  There's a checkbox you can use to enable/disable the feature, which is remembered in a browser cookie across pages and sessions.  You can also pick your current location as the map center in the Mapview startup and "Jump" popup.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2732
  • Last Login:Today at 08:47:31 am
Re: New Mapview on the main site
« Reply #9 on: June 17, 2020, 01:52:48 pm »
Mapview on the main site now has been updated to include the features implemented on tmtest a few days ago:

Quote
The tmtest version of Mapview now offers selection to load by region and/or system in the popup that comes up on a generic page load or when you hit the "Jump" button.  If you choose at least one region or system, the coords and zoom level will be ignored, and auto-loading of all visible segments is deselected.