🇮🇷 Iran Proxy | https://www.wikipedia.org/wiki/Module_talk:Infobox_road/sandbox
Jump to content

Template talk:Infobox road

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

mapframe implementation

[edit]

I noticed this template doesn't have mapframe implemented in the standard manner (cf. Wikipedia:Mapframe maps in infoboxes). So I implemented it that way in the sandbox.

However, I noticed that the check for unknown parameters was already aware of a subset of mapframe* parameters, but I could find no further implementation.

The code at Module:Infobox road/map seems to me like it only renders normal images. It does seem to interact with Wikidata already, but only where wikidata:Property:P15 exists.

Does anyone remember what happened there? --Joy (talk) 10:50, 26 September 2025 (UTC)[reply]

All I found was this 2020 test by @Fredddie. I guess that just never went live.
I'll proceed then. --Joy (talk) 19:19, 26 September 2025 (UTC)[reply]
Now with those changes I assume, if |map= is not specified but wikidata:Property:P15 still exists, two maps will now be displayed on articles like Cairo–Dakar Highway, California State Route 3, and European route E22. Does anybody like this? Especially like the European route E22 case where both maps basically display the route map (because I assume the wikidata:Property:P402 OpenStreetMap relation ID is available for it)? Or like the California State Route 3 case where the static image map shows the route, but the mapframe only can find and show the wikidata:Property:P625 coordinates? The mapframe on Cairo–Dakar Highway seems more problematic because the mapframe is showing both the P625 coordinate and all of the highway's non-continuous constructed segments, with the map centered in the default zoom setting in the middle of nowhere as a result. My point in that last example is that all roads cannot be adequately represented on a map by a single specific coordinate at such a default zoom setting, and therefore should probably have a manual check before it goes live. Also keep in mind that in the 2020 Wikipedia:Requests for comment/Mapframe maps in infoboxes, there was no consensus to have mapframes to be on by default (i.e. |onByDefault=). Zzyzx11 (talk) 13:45, 2 October 2025 (UTC)[reply]
I would say that the double map issue is quite problematic for the reasons outlined. I've just removed the updates from the live template as a result. Further discussion is needed before this change is implemented, and until the comments above by Zzyzx11, there was no discussion of this change. Imzadi 1979  15:50, 2 October 2025 (UTC)[reply]
This is an implementation issue, we just need to fix the condition, we don't have to destroy the entire feature because of this easily fixable bug. --Joy (talk) 19:24, 2 October 2025 (UTC)[reply]
With regard to the 2020 RFC, the onByDefault logic is not banned by it, it's just conditional by default, which was in fact the intent of my code, it merely didn't work out this way by accident. --Joy (talk) 19:28, 2 October 2025 (UTC)[reply]
BTW, with regard to single points on inherently line maps, I actually happened to bring this up at Template talk:Infobox mapframe#a case of not rendering, please feel free to continue on that topic there :) --Joy (talk) 19:30, 2 October 2025 (UTC)[reply]
BTW2, as it happens, it looks like I also came across the same issue last year at Template talk:Infobox road/Archive 8#mapframe maps 2024 but it got archived without a conclusion at the time. D'oh! :D --Joy (talk) 17:08, 3 October 2025 (UTC)[reply]
OK so the current sandbox code fixes the zoom on the first and the third examples by using the length_* parameters, we just have to map the defaults as we do elsewhere.
I also added an attempt at exclusion of P15 from the defaults, and P15 lookups in the test cases. The intricate sandbox code here was buggy as well. --Joy (talk) 20:44, 2 October 2025 (UTC)[reply]
For some reason, if I try to enable mapframe on the CA 3 infobox, it shows me 0°N 0°E / 0°N 0°E / 0; 0. I'm not sure what's wrong, its d:Q460834 seems to show a P625 property. --Joy (talk) 21:18, 2 October 2025 (UTC)[reply]

default mapframe visuals

[edit]

As I've been working on a mapframe inside infobox road, I noticed how {{maplink-road}} is basically a workaround for that. But anyway, it also has some default style changes from the default mapframe that should probably be discussed.

For example, it has had this edit since late 2022, where @BMACS1002 said: US Roads style guide specifies darker red for stroke color, and the greater Highway project recognises this standard

But I can't find that in Wikipedia:WikiProject U.S. Roads/Standards#Maps, and the linked Wikipedia:Manual of Style/Road junction lists also doesn't seem to mention a dark red. Wikipedia:WikiProject Highways#Maps and images likewise doesn't seem to talk about this.

I see a number of red lines in Wikipedia:WikiProject Maps#Topographic maps, but also black and white and yellow ones, and no single default. --Joy (talk) 07:28, 4 October 2025 (UTC)[reply]

Wikipedia:WikiProject U.S. Roads/Maps task force BMACS1002 14:53, 4 October 2025 (UTC)[reply]
Ah, thanks. I see this change was made also in late 2022 in this edit by @Fredddie. The only discussion about that seems to be Wikipedia talk:WikiProject U.S. Roads/Maps task force/Archive 2#Business route interactive map line color, but that was about red-green color blindness and using blue for the secondary color, not about shades of red.
The reason I noticed this darker red is also visual - because it seems to blend too much into the background that often has a lot of shades of orange in the base tile context. The 'legacy' bright red default stands out more and is used everywhere else. --Joy (talk) 18:55, 4 October 2025 (UTC)[reply]

mapframe-line/shape defaults here

[edit]

So I removed mapframe-point=off which was meant so facilitate rendering of lines. But I also don't know if maybe some roads have shape relations?

It seems safe to set mapframe-line=yes here, right? I am somewhat afraid of setting mapframe-shape=yes default, though.

@Hike395 any idea? --Joy (talk) 08:23, 8 November 2025 (UTC)[reply]

Road maps seem broken

[edit]

To whom it may concern, the maps in the infoboxes of roads such as A308 road, A3055 road etc. all seem broken, possibly pointing to coordinates 0,0 in the Atlantic. ITookSomePhotos (talk) 20:25, 6 November 2025 (UTC)[reply]

@ITookSomePhotos: Ah, the null island problem. It's normally transient. Try again later. --Redrose64 🌹 (talk) 21:18, 6 November 2025 (UTC)[reply]
Map
This should display A308 road, but it displays Null Island
The problem is also visible in the map on the right, which is using the same markup as generated by the infobox on A308 road. I think it's supposed to fetch and display coordinates from d:Q4649119, but it doesn't. @Redrose64 I haven't seen this before, do you know why or when it happens? Matma Rex talk 14:17, 7 November 2025 (UTC)[reply]
I'm not an expert, I don't even like mapframe - I much prefer our pushpin maps that we used happily for years. I'm just the poor schmuck who keeps noticing complaints like the one above and who also happens to have Template talk:Infobox UK place#Mapframe on my watchlist. --Redrose64 🌹 (talk) 14:35, 7 November 2025 (UTC)[reply]
The problem is with this line:
| mapframe-point = none
at Template:Infobox road. I remove that at Template:Infobox road/sandbox and the problem resoved. So please apply the sandbox. Thanks, Hooman Mallahzadeh (talk) 15:35, 7 November 2025 (UTC)[reply]
I corrected OnByDefault problem with this edit. So please apply sandbox. Hooman Mallahzadeh (talk) 16:02, 7 November 2025 (UTC)[reply]
I've reverted this part, thanks. In parallel we were just talking about that mapframe-point thing at Template talk:Infobox mapframe, it's not a safe default in an infobox. --Joy (talk) 08:11, 8 November 2025 (UTC)[reply]

Problematic statement

[edit]

In articles like A308 road and A3055 road that their Wikidata item don't have P15, these statements return "true":

{{#if:{{wikidata|property|P15}}|no|yes}}

or

{{#if:{{#property:P15|from={{{qid|}}}}}|no|yes}}

But I don't know why? Please note that the length of Wikidata string for P15 is zero by this statement:

{{#invoke:String|len|{{#property:P15|from={{{qid|}}}}}}}

Please inspect, Thanks, Hooman Mallahzadeh (talk) 05:43, 8 November 2025 (UTC)[reply]

@Joy Hi, What is your idea? I think the above problem is really critical and should be resolved as soon as possible because many Wikipedia articles have the same issue. I propose to create a new phabricator task with very high priority regarding "if statement" and "Wikidata return vlaue". I can't understand why this "if" returns "true"? Hooman Mallahzadeh (talk) 08:01, 8 November 2025 (UTC)[reply]
Can we move this part to Template talk:Infobox road please? It seems far more intricate than the other bugfix, this probably warrants further investigation. --Joy (talk) 08:12, 8 November 2025 (UTC)[reply]
Ok, I tested that in A308 road article
{{#if:{{wikidata|property|P16}}|no|yes}}
returns "no" but
{{#if:{{wikidata|property|P15}}|no|yes}}
returns "true". So this issue is relevant to Template:Infobox road. You are right! Please move it. Thanks for your response. Hooman Mallahzadeh (talk) 08:19, 8 November 2025 (UTC)[reply]
 moved at request of Joy and Hooman Mallahzadeh. Please continue below. --Redrose64 🌹 (talk) 09:33, 8 November 2025 (UTC)[reply]
Hmm, so you're saying a lookup of d:Property:P16 which is "transport network" works apparently fine (it fails as it should), but a lookup of our d:Property:P15 which is "route map" is succeeding even when d:Q4649119 shows no such route map property?
The check that I had used was this: {{#property:P15|from={{{qid|}}}}} which we can render here:
-><-
That seems fine - it fails, as it should.
Let's test it within #if ({{#if:{{#property:P15|from=Q4649119}}|if says true|if says false}}):
->if says false<-
Can you clarify what you mean more exactly, then? --Joy (talk) 13:33, 8 November 2025 (UTC)[reply]
The problem is with this line at Template:Infobox road surprisingly returns "true":
 | onByDefault = {{#if:{{{map|}}}{{{map_custom|}}}{{#property:P15|from={{{qid|}}}}}|no|yes}}
Even though the output of {{#property:P15|from={{{qid|}}}}} when is inserted at article A308 road is "null", the surprising event is that if statement returns "true", i.e. "if null" returns "true". I don't know why?
Please add this lines to the first of article A308 road to test the issue.
AA{{#property:P15|from={{{qid|}}}}}BB{{#if:{{wikidata|property|P15}}|no|yes}}
Thanks again, Hooman Mallahzadeh (talk) 14:50, 8 November 2025 (UTC)[reply]
I'm not sure what you mean. I tried these two:
AA{{#property:P15}}BB{{#if:{{wikidata|property|P15}}|check is true|check is false}}CC
AA{{#property:P15|from=Q4649119}}BB{{#if:{{wikidata|property|P15|Q4649119}}|check is true|check is false}}CC
And then the preview of both of those returned:
AABBcheck is falseCC
Which seems to be accurate.
The meaning of the onDefault check is to see if there's any other map available. On that article, there is no map parameter to the infobox, no map_custom, and the Wikidata entry doesn't have P15. So with nothing there, it tells mapframe to go on by default - to give it a shot.
Infobox mapframe in turn checks for coordinates, WD P625 (coordinate location), P402 (OSM relation ID), etc, and renders whatever it can find.
In this case, right now it finds P625, and renders that. (This part used to be broken yesterday.)
It's not great, but it's better than nothing. --Joy (talk) 15:22, 8 November 2025 (UTC)[reply]
You are right! That was my mistake. Sorry. :) But showing point for roads does not seem reasonable, better than nothing.Hooman Mallahzadeh (talk) 15:34, 8 November 2025 (UTC)[reply]

Discussion of default rendering of shapes/lines in Template:Infobox mapframe

[edit]

We're discussing how to handle the rendering of shapes/lines in Template:Infobox mapframe, given that OSM data is unreliable. This will likely affect this template. You're welcome to join in the discussion. — hike395 (talk) 09:49, 8 November 2025 (UTC)[reply]

"Route map: "

[edit]

Why do articles like M25 motorway or Interstate 275 (Michigan) have (in desktop view) at the top right the text "Route map:" and then a blank line before the infobox starts? Seems to add no value at all. At California State Route 1 the hatnote text even comes between the "route map" and the infobox. Are there articles where it actually serves a purpose? Fram (talk) 11:46, 8 December 2025 (UTC)[reply]

I don't see any such blank line (logged out, Brave browser on Mac OS). Feel free to upload a screen shot from a logged-out browser on your computer. In any event, I don't think this infobox is causing the Route map wording and globe with pop-down map to appear. In California State Route 1, it is still there if I remove the infobox in Preview. I believe that it is generated by {{Attached KML/California State Route 1}}, which is called from {{Attached KML}} in the footer. The talk page for that template would be a good place to address your concerns. – Jonesey95 (talk) 20:21, 9 December 2025 (UTC)[reply]
You're right, it is caused by the Attached KML template, not by the infobox! Fram (talk) 16:34, 10 December 2025 (UTC)[reply]