Web Design Discussion > General Web Design Discussion

SVG Banners

(1/5) > >>

theFXexpert:
TM has been without proper banners long enough so I spent the last week coding up an implementation for dynamically generating SVG banners. I tried to write it in a way that is hopefully modular so different variations can be easily added. It should also account for routes that have multiple banners like those Alt Truck routes in PA. I made a pull request for a simple beta implementation on clinched.php:

https://github.com/TravelMapping/Web/pull/631

My dev environment for php stuff has been dismantled for a while since I have been mainly using other languages recently, so the server-side code is mostly untested. I at least tested preg_split() to make sure it worked as expected in the w3schools editor.

The result should output similar to this on clinched.php


The svg templates are based on the svgs found in Wikimedia Commons: https://commons.wikimedia.org/wiki/Commons:WikiProject_U.S._Roads/Auxiliary_plates

Jim:
Thanks for this contribution.  I've got it up on tmstage.teresco.org for some testing, but it's looking good to me.

theFXexpert:
I had forgotten future Interstates were their own system and forgot to include them in the switch statement along side usai.

Jim:

--- Quote from: theFXexpert on February 16, 2021, 08:28:45 pm ---I had forgotten future Interstates were their own system and forgot to include them in the switch statement along side usai.

--- End quote ---

Added, thanks.

mapcat:

--- Quote from: Jim on February 16, 2021, 07:47:55 pm ---Thanks for this contribution.  I've got it up on tmstage.teresco.org for some testing, but it's looking good to me.

--- End quote ---

Agreed!

In VA we're treating "Wye" as a banner, and "Wye" still shows up in text above the routes since there's no corresponding Wye plate in the new set. And there probably shouldn't be one, since those routes are marked with a Y in the shield under the number. Should we change how we handle wyes?

Navigation

[0] Message Index

[#] Next page

Go to full version