Module talk:Coordinates: Difference between revisions

Content deleted Content added
 
(34 intermediate revisions by 15 users not shown)
Line 303:
|maxarchivesize = 75K
|counter = 2
|minthreadsleft = 47
|minthreadstoarchive = 12
|algo = old(90d365d)
|archive = Module talk:Coordinates/Archive %(counter)d
}}
Line 378:
:::::::Yeah, I like how frwp does their coordinates. [[User:Galobtter|Galobtter]] ([[User talk:Galobtter|talk]]) 10:04, 1 May 2023 (UTC)
:I revived the indicator change in the sandbox. Some changes were made to the css to ensure 100% similar positioning. CSS for original however is still in place. This means we can do the template change without making a CSS cache mess and we can postpone actual CSS rework to when this change settles. —[[User:TheDJ|Th<span style="color: green">e</span>DJ]] ([[User talk:TheDJ|talk]] • [[Special:Contributions/TheDJ|contribs]]) 09:36, 21 May 2023 (UTC)
::The problem that I reported at 10:59, 5 February 2022 (UTC), which had been fixed, has returned again in the same form. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] &#x1f339; ([[User talk:Redrose64|talk]]) 19:22, 28 May 2023 (UTC)
 
:::@[[User:PpperyRedrose64|PpperyRedrose64]] TheI erroradded isa causednew by the callfix to <code>frame:preprocess</code>the at [[Module:Mapframe#L-599]], butsandbox. I'm notalso sureadded whytestcases it's thereto incover the firstissue, place.although @[[User:Evad37|Evad37]]they Doneed you know if it wouldto be safechecked to remove the call to <code>frame:preprocess</code>?manually. <span class="nowrap">– [[User:BrandonXLF|<span style="color:blue;">Brandon</span><span style="color:green;">XLF</span>]] ([[User talk:BrandonXLF|talk]])</span> 1023:0059, 2228 May 2023 (UTC)
== The [[Template:Coord]] template intersects articles' infoboxes/main text on [[Wikipedia:Vector_2022|Vector 2022]] (default skin) ==
::::{{ty}} The live module is now working as expected. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] &#x1f339; ([[User talk:Redrose64|talk]]) 19:40, 5 June 2023 (UTC)
 
{{Admin help|answered=yes}}
It appears as though the position of the template, when used under the <code>display=title</code> parameter, is '''absolute''' and cares little about neighboring [[Template:Infobox|infoboxes]], images, or suspected article text. This issue has far reaching implications, as seen in articles such as [[Andaman_Islands]], [[Operation Rheinübung]], [[Aegadian Islands]], [[Arabian Sea]], or even the [[United States]] articles, '''particularly''' when page width is at its slim default. The issue is mitigated when other minimal templates such as [[Template:Main]] are used, but this may be more rare than common. I request administrator help as the Module in question is [[WP:FULL|Fully Protected]], in addition to my inability to suggest a concrete improvement/<code>Template:Edit fully-protected</code> to solve this objective issue. I already have slight troubles editing Templates, but a Module is out of my expertise. I suspect it has to do with adding margin/changing the CSS display type somewhere but I'll leave the details to whomever picks this up. [[User:ZaptorZap|<span style="color:orangered;">Zaptor</span><span style="color:red;">''Zap''</span>]] ([[User_talk:ZaptorZap|<code style="color:purple">talk</code>]]) 02:14, 28 April 2023 (UTC)
 
:Please see [[Module talk:Coordinates#coordinsert feature broken|#Coordinsert feature broken]] up above, which already discusses this problem. —[[User:TheDJ|Th<span style="color: green">e</span>DJ]] ([[User talk:TheDJ|talk]] • [[Special:Contributions/TheDJ|contribs]]) 08:46, 28 April 2023 (UTC)
::Oh, my bad. Sorry for the inapproproiate use of that template. [[User:ZaptorZap|<span style="color:orangered;">Zaptor</span><span style="color:red;">''Zap''</span>]] ([[User_talk:ZaptorZap|<code style="color:purple">talk</code>]]) 10:16, 28 April 2023 (UTC)
 
I've noticed this a lot in the last two days. Coincidence, or has something changed lately? Any solution that avoids the overlapping would be an improvement. {{ping|izno|TheDJ}} the list of [[Module_talk:Coordinates#Outstanding_problems_for_indicators|steps to fix indicators]] seems reasonable, are these waiting on new people to jump in or is there pushback elsewhere? <span style="color:#666">&ndash;&nbsp;[[User:Sj|SJ]][[User Talk:Sj|<span style="color:#f90;">&nbsp;+</span>]]</span> 14:03, 29 April 2023 (UTC)
 
:No coincidence. The sitesub header (with From wikipedia the free encyclopedia) has accidentally disappeared in last weeks' release, further aggravating this problem. —[[User:TheDJ|Th<span style="color: green">e</span>DJ]] ([[User talk:TheDJ|talk]] • [[Special:Contributions/TheDJ|contribs]]) 14:27, 29 April 2023 (UTC)
:: I see, didn't notice that at first. Thanks to [[user:Izno|Izno]] for the [[phab:T335625|hackaround]]. We can pray for better release testing + reversion for regressions... but this seems another mark in favor of the indicator switch. <span style="color:#666">&ndash;&nbsp;[[User:Sj|SJ]][[User Talk:Sj|<span style="color:#f90;">&nbsp;+</span>]]</span> 14:40, 29 April 2023 (UTC), 02:47, 30 April 2023 (UTC)
 
== Updating this module to use Kartographer ==
 
Please see [[Wikipedia:Village pump (proposals)#RfC: Updating Template:Coord to use Kartographer]]. [[User:Galobtter|Galobtter]] ([[User talk:Galobtter|talk]]) 06:24, 10 May 2023 (UTC)
 
== Lua errors ==
 
Recent edits to this module seem to have caused Lua errors to appear at a bunch of articles, such as [[Ferry Point International Bridge]] and [[Calvert Marine Museum]] [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun...</sub>]] 14:55, 21 May 2023 (UTC)
:I think it's due to switching to use the indicator tag. If coord is just using "display=title" then Module:Mapframe isn't seeing the the geohack url to parse. You can get the same error if you just used "coordinates=x" in the infobox. The article can be fixed by changing the coord params to "display=inline,title" but the Module:Mapframe should be improved to fail more gracefully when it can't find a coord value. -- [[User:WOSlinker|WOSlinker]] ([[User talk:WOSlinker|talk]]) 15:22, 21 May 2023 (UTC)
:: Error handling aside, shouldn't that use case be supported? Presumably the same fix that worked for coordinsert above (which I don't fully understand) should work for this case too. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun...</sub>]] 18:23, 21 May 2023 (UTC)
::: There does seem to be a row in the infobox though with just Coordinates as a title and a blank area to the right of that if just the display=title option is used. So another option is to move the coords outside of the infobox if just the title option is desired. -- [[User:WOSlinker|WOSlinker]] ([[User talk:WOSlinker|talk]]) 18:43, 21 May 2023 (UTC)
:: {{ping|BrandonXLF}} in case you are interested in this. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun...</sub>]] 18:24, 21 May 2023 (UTC)
:::@[[User:Pppery|Pppery]] The error is caused by the call to <code>frame:preprocess</code> at [[Module:Mapframe#L-599]], but I'm not sure why it's there in the first place. @[[User:Evad37|Evad37]] Do you know if it would be safe to remove the call to <code>frame:preprocess</code>? <span class="nowrap">– [[User:BrandonXLF|<span style="color:blue;">Brandon</span><span style="color:green;">XLF</span>]] ([[User talk:BrandonXLF|talk]])</span> 10:00, 22 May 2023 (UTC)
 
This problem appears to occur in general when the rare {{para|display|title}} is used rather than the much more common {{para|display|inline,title}}. I set [[German Museum of Technology]], which uses {{tl|Infobox museum}}, to use {{para|display|title}}, and it displays the error in preview. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 14:21, 23 May 2023 (UTC)
 
===LDS temples===
''I wrote the following before noticing this section, I guess this is the same issue?''<br>A recent edit has led to "Lua error in Module:Mapframe at line 384: attempt to perform arithmetic on local 'lat_d' (a nil value)" in many articles ([https://en.wikipedia.org/w/api.php?action=query&list=categorymembers&cmprop=title&cmlimit=500&cmnamespace=0&format=xml&cmtitle=Category:Pages_with_script_errors list]), for example [[Helsinki Finland Temple]] which uses {{tl|LDS Temple/Helsinki Finland Temple}} as in:
*<code><nowiki>{{ LDS Temple/Helsinki Finland Temple |format= Infobox LDS Temple }}</nowiki></code>
I guess the problem is that {{tl|Infobox LDS Temple}} includes <code><nowiki>{{coord|...|display=title}}</nowiki></code>. The article is somehow pulling the coordinates from {{Q|Q2603891}}. I'm dropping this here as a start for others to continue an investigation. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 08:02, 22 May 2023 (UTC)
:Are you sure that the article is pulling "60°13'30"N, 24°46'54"E" from Wikidata and then displaying "Coordinates: 60°13′30.69479″N 24°46′54.42599″E", the value from {{tl|LDS Temple/Helsinki Finland Temple}}? That seems like it is not happening. Regardless, removing {{para|display|title}} from {{tl|LDS Temple/Helsinki Finland Temple}} makes the Lua error go away, but then the coordinates do not appear at the top of [[Helsinki Finland Temple]]. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 14:08, 23 May 2023 (UTC)
::Yes, you are right. I didn't look hard enough. Pretty weird situation but it's not really satisfactory to leave 150 articles with a big red error due to the recent change to this module. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 03:16, 24 May 2023 (UTC)
:::I've fixed those. I made sure all the "Template:LDS Temple/" subpages has type:landmark in their coords params, then removed coordinsert from [[Template:Infobox LDS Temple]] and then updated those that just had display=title to also have inline. -- [[User:WOSlinker|WOSlinker]] ([[User talk:WOSlinker|talk]]) 06:38, 24 May 2023 (UTC)
::::Thanks. I don't know how coordinsert works but you have probably seen my comment at 05:06, 24 May 2023 below where I mention that it receives an indicator strip marker rather than coordinates. I guess that some of its usages involve coordinates being directly passed to the function, while attempts to pass what Module:Coordinates produces will now fail. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 07:18, 24 May 2023 (UTC)
 
== Coord2text ==
 
I would like to call the function coord2text from another module. Can I make [https://en.wikipedia.org/w/index.php?title=Special%3AComparePagesModule:Coordinates/sandbox&page1diff=Module%3ACoordinatesprev&page2oldid=Module%3ACoordinates%2Fsandbox1156343669 this change]? &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 11:02, 22 May 2023 (UTC)
 
:Seems like pretty straightforward change. —[[User:TheDJ|Th<span style="color: green">e</span>DJ]] ([[User talk:TheDJ|talk]] • [[Special:Contributions/TheDJ|contribs]]) 13:04, 22 May 2023 (UTC)
Line 424 ⟶ 390:
::I am using it to parse wikitext to extract coordinates which can then be imported into wikidata - want more details? &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 21:50, 24 May 2023 (UTC)
:::That's cool, but how is that useful onwiki? I can't see how that would be useful here. And I mean that in the sense of "what are you even doing" and not "oh, Wikidata, go away". :P [[User:Izno|Izno]] ([[User talk:Izno|talk]]) 22:07, 24 May 2023 (UTC)
::::I see I've aroused your curiosity :) I am reading a page like [[User:MSGJ/Sandbox/3|this]] and outputting a page like [[User talk:MSGJ/Sandbox/3|this]] which can then be pasted into [https://quickstatements.toolforge.org QuickStatements] to quickly import data into Wikidata &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 21:51, 27 May 2023 (UTC)
 
== Protected edit request on 24 May 2023 ==
Line 472 ⟶ 439:
::@[[User:Izno|Izno]] I make a few adjustments to the sandbox code, would you be able to add them? <span class="nowrap">– [[User:BrandonXLF|<span style="color:blue;">Brandon</span><span style="color:green;">XLF</span>]] ([[User talk:BrandonXLF|talk]])</span> 22:23, 24 May 2023 (UTC)
:::{{done}} [[User:Izno|Izno]] ([[User talk:Izno|talk]]) 22:52, 24 May 2023 (UTC)
::::Thanks all! [[User:Jon (WMF)|Jon (WMF)]] ([[User talk:Jon (WMF)|talk]]) 04:48, 25 May 2023 (UTC)
Three more:
*[[Beuvry Communal Cemetery Extension]]
*[[Martyrs' Cemetery, Kobanî]]
*[[St. James Episcopal Cemetery]]
[[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 08:57, 26 May 2023 (UTC)
 
:These might be pre existing issues. The templates specify coordinates without making use of template coord, but also without specifying NSWE, which is a format that module:mapframe’s parseCoord does not seem to be able to handle ? —[[User:TheDJ|Th<span style="color: green">e</span>DJ]] ([[User talk:TheDJ|talk]] • [[Special:Contributions/TheDJ|contribs]]) 11:24, 26 May 2023 (UTC)
::Those were GIGO problems. They should have been using {{tl|coord}}, and two of the articles had duplicate coordinates. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 13:23, 26 May 2023 (UTC)
:::Thanks, it's all good now. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 00:33, 27 May 2023 (UTC)
 
== Protected edit request on 29 May 2023 ==
 
{{edit fully-protected|Module:Coordinates|answered=yes}}
Copy the code from [[Module:Coordinates/sandbox]] to the main module. I adjusted the code so coordinsert works properly with the indicator in the title. The only difference to the output is that inline coordinates are now wrapped in a {{tag|span|attribs=class="geo-inline"}} tag, but I don't see anywhere where this would be an issue. I also added some manual testcases for when [[Module talk:Coordinates/testcases/manual/display t coordinsert|display=title]] and when [[Module talk:Coordinates/testcases/manual/display it coordinsert|display=inline title]] to verify the changes. The difference between the sandbox and module can be seen [https://en.wikipedia.org/w/index.php?title=Special%3AComparePages&page1=Module%3ACoordinates&page2=Module%3ACoordinates%2Fsandbox here]. <span class="nowrap">– [[User:BrandonXLF|<span style="color:blue;">Brandon</span><span style="color:green;">XLF</span>]] ([[User talk:BrandonXLF|talk]])</span> 19:41, 29 May 2023 (UTC)
:{{done}}<!-- Template:EP --> also made the change to coord2text noted above &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 15:00, 5 June 2023 (UTC)
::{{re|BrandonXLF|MSGJ}} based on timing, it appears that this change has broken page previews. For instance, hovering over [[Free City of Danzig]] shows just the coordinates, rather than the beginning of the article as it should. I haven't looked too closely to see whether this is a bug in the module or page previews, but you ought to consider reverting. [[User:Vahurzpu|Vahurzpu]] ([[User talk:Vahurzpu|talk]]) 03:15, 6 June 2023 (UTC)
:::This needs to be done, but I favor leaving it as is for a short period to allow debugging. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 03:54, 6 June 2023 (UTC)
 
I'm trying to find the documentation to see what popups needs. It starts at [[mw:Page previews]] but I don't think there is anything relevant there apart from the link to the implementation at [[mw:Special:MyLanguage/Extension:Popups]]. That has a FAQ with two items reproduced below without the links.
*How can I remove content from a page preview? Any element marked with the noexcerpt class will be stripped from the summary.
*Where do summaries come from? These are provided by the summary REST API or the TextExtracts API in case your wiki is using the default mwApiPlain gateway.
Some investigation might show why the new coordinates code is messing up the popup preview or how it can be fixed. {{u|BrandonXLF}} is not active at the moment but I'm pinging to alert them. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 03:54, 6 June 2023 (UTC)
:Strangely, hovering over [[Tokyo]] shows a proper popup. A lot of other ___location links on that page also work. Some examples where the popup does not work (it shows the coordinates) are [[Australia (continent)]] and [[Regional Representative Council]] and [[United Arab Emirates]], as reported at [[Template talk:Coord#Preview page broken]]. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 05:05, 6 June 2023 (UTC)
::The three listed pages have their coords templates defined outside the infobox. None of them are defined with inline accordingly.
::I don't know why that matters, but that's the obvious pattern. [[User:Izno|Izno]] ([[User talk:Izno|talk]]) 05:32, 6 June 2023 (UTC)
:::This smells like [[:phab:T334273]]: because the inline text is hidden via TemplateStyles, and the extracts module doesn't care about TemplateStyles, it decides the text that is being dumped out in the geo-inline is Good Enough. It doesn't have an issue with <code>infobox</code> things because it already yanks all of that before consideration of what it thinks the first paragraph should be.
:::As you can see, I've already argued that this is a flawed expectation for how TemplateStyles should interact with TextExtracts.
:::We can probably work around this locally by adding the <code>noexcerpt</code> class. [[User:Izno|Izno]] ([[User talk:Izno|talk]]) 05:39, 6 June 2023 (UTC)
::::Independently of workarounds, this looks to me like a parsing bug, so I filed {{phab|T338204}} to report it to the maintainers. --[[User:JCrespo (WMF)|JCrespo (WMF)]] ([[User talk:JCrespo (WMF)|talk]]) 07:44, 6 June 2023 (UTC)
:Please:::Also seesounds [[Modulelike talk:Coordinates#coordinsertwe featureare broken|#Coordinsertprepending featuresomething broken]]instead upof above,the whichsafer alreadyoption discussesof thisappending problem.? —[[User:TheDJ|Th<span style="color: green">e</span>DJ]] ([[User talk:TheDJ|talk]] • [[Special:Contributions/TheDJ|contribs]]) 08:4628, 286 AprilJune 2023 (UTC)
:::::No? [[User:Izno|Izno]] ([[User talk:Izno|talk]]) 16:59, 6 June 2023 (UTC)
:::After the recent edit to Module:Coordinates and an low-substance edit on [[Australia (continent)]] the coordinates no longer appear. The [https://en.wikipedia.org/api/rest_v1/page/summary/Australia_(continent) REST endpoint] is still picking up the empty p and newlines: <code>extract: "\n\n"; extract_html: "&lt;p>\n\n&lt;/p>"</code>. Yes, I think it was changing it from a div to a span that did this particular line in. I think we can fix this by changing the hidden inline back to a div and then doing a second passover looking for a div in <code>coordinsert</code>, or changing the regex to be a bit more greedy at the beginning by removing its dependence on the tag. [[User:Izno|Izno]] ([[User talk:Izno|talk]]) 17:12, 6 June 2023 (UTC)
 
== Protected edit request on 28 September 2023 ==
 
{{edit fully-protected|Module:Coordinates|answered=yes}}
Add a format=dec4 function to output decimal degrees rounded to four places from data entered as either DMS or higher precision DEC format. The [[Geographical Names Board of Canada|Canadian Geographical Names Database]], [[Geographic Names Information System]], and [[Ordinance Survey]] provide ___location information with seven decimal degrees of precision. The dec4 format will permit the input data to be checked with the original data source while displaying the more reasonable and compact four decimal degrees of precision (+/- 10 m). [[User:Buaidh|<span style="color:white;background-color:#770022;font-weight:bold;">&nbsp;Buaidh&nbsp;</span>]]<span style="font-size:75%;vertical-align:middle;"> [[w:User talk:Buaidh|talk]] [[Special:EmailUser/Buaidh|e-mail]]</span> 21:57, 28 September 2023 (UTC)
: {{not done}} This is a repost of [[Module talk:Coordinates/Archive 2#Protected edit request on 14 September 2022]], which was closed as needing to be sandboxed and tested. We're a year and two weeks later, and this still hasn't AFAICS been sandboxed and tested. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun...</sub>]] 22:16, 28 September 2023 (UTC)
 
== Interface-protected edit request 27 December 2023 ==
 
{{Admin helpsudo|Module:Coordinates|answered=yes}}
 
Please sync from [[Module:Coordinates/sandbox]] ([https://en.wikipedia.org/wiki/Special:ComparePages?page1=Module%3ACoordinates&rev1=1161270528&page2=Module%3ACoordinates%2Fsandbox&rev2=1192087921&action=&diffonly=&unhide=&diffmode=source diff]).
 
This adds a class and a data-gadget attribute to the span. For now, this is a no-op change. It is intended to facilitate a more performant way of loading the WikiMiniAtlas script, when coupled with the proposed changes in [[MediaWiki talk:Common.js#Class-triggered gadgets]]. – [[User:SD0001|<span style="font-weight: bold; color: #C30">SD0001</span>]] ([[User talk:SD0001|talk]]) 14:36, 27 December 2023 (UTC)
: {{done}} [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun...</sub>]] 16:54, 27 December 2023 (UTC)
 
{{sudo|Module:Coordinates|answered=yes}}
As MediaWiki now supports category-based gadget load, we can switch to that. Please sync from [[Module:Coordinates/sandbox]] ([[Special:Diff/1192107975/1226463973]]). For now, this is a no-op as the gadget isn't actually defined. – [[User:SD0001|<span style="font-weight: bold; color: #C30">SD0001</span>]] ([[User talk:SD0001|talk]]) 20:17, 30 May 2024 (UTC)
:: {{ping|BrandonXLFdone}} in case you are interested in this. [[User:Pppery|* Pppery *]] [[User talk:Pppery|<sub style="color:#800000">it has begun...</sub>]] 1800:2422, 2131 May 20232024 (UTC)
 
== coordinsert problem? ==
 
@[[User:Jonesey95|Jonesey95]] I recently found your [[de:Benutzer_Diskussion:Plenz/OSM_for_Wiki#Errors_at_en:Hatfield_Chase|old question]] on German WP. It could be because of a malformed Geohack link: "Infobox UK place" uses coordinsert which generates a broken string when "coord" got a "title" parameter: https://geohack.toolforge.org/geohack.php?pagename=Hatfield_Chase&params=53.528_N_0.893_W_&title=Tunnel+Pits_region:GB_type:city (see the splitted "params" seperated by the "title" parameter).
"coordinsert" assumes "params" always as last parameter? Which isn't true when "title" is used. [[User:DB111|DB111]] ([[User talk:DB111|talk]]) 09:10, 14 August 2024 (UTC)