Author Topic: Clinched Routes Highway Shields  (Read 150879 times)

0 Members and 3 Guests are viewing this topic.

Offline mapcat

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 1767
  • Last Login:Yesterday at 01:48:41 pm
Re: Clinched Routes Highway Shields
« Reply #30 on: January 08, 2017, 04:12:46 pm »
CHM had the capability to display multiple shields for the same route, and cycled through them when displayed.  One example:

http://cmap.m-plex.com/hb/hwymap.php?sys=cantch&rg=all&gr=p&r=on.tchott&showint=0&dl=0

Thanks--I forgot about that. I think this would be the nicest solution for Tennessee, although it would require the most work. I'd be willing to put together the list of route attributes (P, S, & P/S) if theFXexpert thinks it's doable.
« Last Edit: January 08, 2017, 04:16:04 pm by mapcat »
Clinched:

Offline theFXexpert

  • TM Collaborator
  • Full Member
  • *****
  • Posts: 136
  • Gender: Male
  • Last Login:July 12, 2024, 01:20:07 am
Re: Clinched Routes Highway Shields
« Reply #31 on: January 09, 2017, 07:54:55 pm »
Is it possible to use different fonts? Any limit?
The fonts available are listed in the roadgeek.css file -> http://tm.teresco.org/fonts/roadgeek.css

CHM had the capability to display multiple shields for the same route, and cycled through them when displayed.  One example:

http://cmap.m-plex.com/hb/hwymap.php?sys=cantch&rg=all&gr=p&r=on.tchott&showint=0&dl=0

Thanks--I forgot about that. I think this would be the nicest solution for Tennessee, although it would require the most work. I'd be willing to put together the list of route attributes (P, S, & P/S) if theFXexpert thinks it's doable.
CHM uses animated GIF images for multi shield routes which is different from the SVGs that we have been using so far. What I have been thinking so far was to simply display both shields side-by-side at once. To replicate the CHM way, both SVGs will need to be loaded and then change which shield is displayed using javascript. As for how the route list would be incorporated, this is the pseudocode I have in mind for shieldgen.php:
Code: [Select]
switch ( $routeNum ) {
    // Primary routes
    case : 5
    case : 8
    case : 19 // etc...
    usePrimaryShield();
    break;

    // Secondary routes
    case : 234
    case : 138
    case : 493 // etc...
    useSecondaryShield();
    break;

    // Both Primary and Secondary routes
    case : 2
    case : 56
    case : 87 // etc...
    useBothShields();
    break;
}
A limitation with this code would be if a route is discontinuous and uses different shields. Say one segment is only primary while the other is only secondary. It would display both when only one for each respective segment is desired.

Offline mapcat

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 1767
  • Last Login:Yesterday at 01:48:41 pm
Re: Clinched Routes Highway Shields
« Reply #32 on: January 09, 2017, 09:27:48 pm »
A limitation with this code would be if a route is discontinuous and uses different shields. Say one segment is only primary while the other is only secondary. It would display both when only one for each respective segment is desired.

That would be the case for TN8 (and possibly others). But wouldn't it also read the root in the process, and be able to differentiate tn008 (primary) from tn008cha (secondary)? At least it shouldn't be difficult to overcome on route pages such as http://tm.teresco.org/hb/?u=mapcat&r=tn.tn008, right?
Clinched:

Offline rickmastfan67

  • TM Collaborator (A)
  • Hero Member
  • *****
  • Posts: 2064
  • Gender: Male
  • Last Login:Today at 12:07:50 am
Re: Clinched Routes Highway Shields
« Reply #33 on: January 10, 2017, 01:24:13 am »
Option 2 would be to use both, but would require that:
    A: The shield generator check against a list of route numbers and spit out the appropriate shield(s) This item will probably take the most work.
    B: Support the display of more than one shield in the hb and the clinched.php page. It looks like all that will need to be done would be to simply put the 2nd shield in the same span element and adjust the width on the hb page. What needs to be figured out is how to return two shields at once with php.

I personally would love to see something like 'Option 2B' for states like Pennsylvania and Florida to deal with the special 'toll' highway shields that are used.  PA-43, PA-66, FL-414, FL-528 are just a few examples that use the default 'state' shield, and a special 'toll' shield for different segments, but are all one file here on the site.  We would also need to code in the 'toll' shields to be the default for routes like PA-576, & FL-417 which are solely 'toll' highways.

Offline theFXexpert

  • TM Collaborator
  • Full Member
  • *****
  • Posts: 136
  • Gender: Male
  • Last Login:July 12, 2024, 01:20:07 am
Re: Clinched Routes Highway Shields
« Reply #34 on: January 10, 2017, 10:29:32 am »
That would be the case for TN8 (and possibly others). But wouldn't it also read the root in the process, and be able to differentiate tn008 (primary) from tn008cha (secondary)? At least it shouldn't be difficult to overcome on route pages such as http://tm.teresco.org/hb/?u=mapcat&r=tn.tn008, right?
Forgive me. I didn't take a closer look before posting. The route pages call a generate function in shieldgen.php to echo the shield. The generate function performs an SQL query that returns all attributes of the route that it's generating for. I assume it includes the abbreviation and that can be used.

Option 2 would be to use both, but would require that:
    A: The shield generator check against a list of route numbers and spit out the appropriate shield(s) This item will probably take the most work.
    B: Support the display of more than one shield in the hb and the clinched.php page. It looks like all that will need to be done would be to simply put the 2nd shield in the same span element and adjust the width on the hb page. What needs to be figured out is how to return two shields at once with php.

I personally would love to see something like 'Option 2B' for states like Pennsylvania and Florida to deal with the special 'toll' highway shields that are used.  PA-43, PA-66, FL-414, FL-528 are just a few examples that use the default 'state' shield, and a special 'toll' shield for different segments, but are all one file here on the site.  We would also need to code in the 'toll' shields to be the default for routes like PA-576, & FL-417 which are solely 'toll' highways.
List items A and B weren't options, just requirements needed to implement option 2. But yes I have been thinking that this would be a good way to implement toll shields too.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Yesterday at 10:17:44 pm
Re: Clinched Routes Highway Shields
« Reply #35 on: January 10, 2017, 08:20:13 pm »
Recent pull requests are merged and live on the main site.  It looks like some things aren't good.  deua and usadc shields both didn't work.

Offline bejacob

  • Full Member
  • ***
  • Posts: 233
  • Last Login:Yesterday at 07:01:58 pm
Re: Clinched Routes Highway Shields
« Reply #36 on: January 10, 2017, 08:49:25 pm »
Recent pull requests are merged and live on the main site.  It looks like some things aren't good.  deua and usadc shields both didn't work.

Also eure.

Offline rschen7754

  • Jr. Member
  • **
  • Posts: 51
  • Gender: Male
  • Last Login:November 19, 2024, 12:18:38 am
    • Rschen7754
Re: Clinched Routes Highway Shields
« Reply #37 on: January 10, 2017, 09:30:31 pm »
It seems to be some sizing problem. I'm still looking at usadc.

usala(1) is also broken but I've figured out what the issue is (it's usala1, not usala)

Edit: seems to be that the viewbox is missing: https://css-tricks.com/scale-svg/
« Last Edit: January 10, 2017, 09:38:54 pm by rschen7754 »

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Yesterday at 10:17:44 pm
Re: Clinched Routes Highway Shields
« Reply #38 on: January 10, 2017, 09:44:49 pm »
DC and LA fixes are up.

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4849
  • Last Login:Yesterday at 11:21:09 am
Re: Clinched Routes Highway Shields
« Reply #39 on: January 11, 2017, 01:46:14 pm »
Recent pull requests are merged and live on the main site.  It looks like some things aren't good.  deua and usadc shields both didn't work.

Also eure.

Sorry, I've never made svg files before. Scaling failed because of missing viewbox attributes. Should be fixed with my latest pull request. Dunno why it was automatically in the deub file but not in any other file...

If it works fine, I'll add more European shields soon.

Edit: Ah, rschen7754 had the same problem :)

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4849
  • Last Login:Yesterday at 11:21:09 am
Re: Clinched Routes Highway Shields
« Reply #40 on: January 11, 2017, 04:04:09 pm »
I've added:

auta
autb
auts
chea
cheh
deua
deub
eure
ltua
ltuk

I still have problems with autb, chea and cheh. The prefix is not removed but I don't understand why.

@Jim: I've added the relevant code to shieldgen.php with my latest pull request. Have you really updated the file?

I've removed some *_wide.svg file, e.g. eure_wide because I thought they are no longer necessary (identical with the normal svg file). However, they are still online.

@ALL: It explains why it looked like everything is fine with deua and eure but it should be like it's for chea, cheh or autb. If there're more than 2 digits, the default shield should be used.
I don't know why the normal svg files, e.g. "template_chea.svg", are not loaded. Shieldgen.php looks fine. Is only code from shieldgen.php relevant for selecting the svg files?


@ALL: Could there be any problem if the svg uses "mm" instead of px? https://upload.wikimedia.org/wikipedia/commons/b/b0/Autocesta_A1.svg
"mm" is not yet used in our svg files. I've tried to replace mm by px but it doesn't work (much smaller and text doesn't match). Any idea?
« Last Edit: January 11, 2017, 04:06:41 pm by michih »

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2856
  • Last Login:Yesterday at 10:17:44 pm
Re: Clinched Routes Highway Shields
« Reply #41 on: January 11, 2017, 05:40:10 pm »
@Jim: I've added the relevant code to shieldgen.php with my latest pull request. Have you really updated the file?

Don't think I had - did it now so the latest should be up.

Offline bejacob

  • Full Member
  • ***
  • Posts: 233
  • Last Login:Yesterday at 07:01:58 pm
Re: Clinched Routes Highway Shields
« Reply #42 on: January 11, 2017, 09:17:15 pm »
Not sure if everything is fixed, but it appears all the ones I've clinched are good.

Great work by all.  :)

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4849
  • Last Login:Yesterday at 11:21:09 am
Re: Clinched Routes Highway Shields
« Reply #43 on: January 12, 2017, 01:51:27 pm »
http://tm.teresco.org/shields/clinched.php?u=michih&cort=clinched&reload=true

'Switzerland Autobahnen / Autoroutes' didn't work correct 2 hours ago. For instance, A9 is loaded twice. The first shield displayed "9" text, the second one "A9". Some shields were default. I've enabled "Disable Caching (slows loading) and it works for all chea shields correct now (I've loaded it more than 10 times with disabled caching).

eure was correct 2 hours ago but the text is not displayed anymore since I've disabled caching for the first time. It's no longer working in the HB too.

autb and cheh had partially text only 2 hours ago. But no shield has text now ("traveled only" must be selected). Same in HB.

I have a minor "bug" in shieldgen.php (forgot that some autb routes begin with L) but I cannot see any other problem on my end. No idea what's going on....

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4849
  • Last Login:Yesterday at 11:21:09 am
Re: Clinched Routes Highway Shields
« Reply #44 on: January 12, 2017, 03:52:15 pm »
I've enabled "Disable Caching (slows loading) and it works for all chea shields correct now.
eure was correct 2 hours ago but the text is not displayed anymore since I've disabled caching for the first time. It's no longer working in the HB too.

I've checked it for 4 other users and it's always the same behavior: Minimum 1 chea shield is not replaced (default bk/wh instead of wh/rd) and some eure texts are displayed. After selecting "disable cache", all chea shields work but no eure text is displayed any more.

It's identical with FF or IE. That means, I "changed" the behavior only once with FF and it's identical when I load it with IE now.

How does the cache work, is the cache on my end or on the site? Do I generally change the behavior by selecting "disable cache" or is it just on my computer? Can anyone reproduce the same behavior?
« Last Edit: January 12, 2017, 03:54:55 pm by michih »