Module talk:Location map/Archive 8: Difference between revisions

Content deleted Content added
m Tidy bug affecting font tags wrapping links; <font> → <span style>
m Fixed Lint errors on this page (stripped tags)
 
(3 intermediate revisions by 3 users not shown)
Line 3:
== Detecting missing parameters, and illogical combinations ==
 
I want to incorporate the following code: <sourcesyntaxhighlight lang=text enclose=div>{{#switch:{{#if:{{{lat|}}}|1|0}}{{#if:{{{lon|}}}|1|0}}{{#if:{{{lat_deg|}}}|1|0}}{{#if:{{{lon_deg|}}}|1|0}}{{#if:{{{lat_min|}}}|1|0}}{{#if:{{{lon_min|}}}|1|0}}{{#if:{{{lat_sec|}}}|1|0}}{{#if:{{{lon_sec|}}}|1|0}}
|11000000|00110000|00111100|00111111=<!-- valid combinations - do none -->
|#default=[[Category:Location map parameter errors]]
}}{{#ifeq:{{#if:{{{lat_dir|}}}|1|0}}|{{#if:{{{lon_dir|}}}|1|0}}|<!-- valid combination - do none -->|[[Category:Location map parameter errors]]}}</sourcesyntaxhighlight> But I have no idea how to do it in Lua. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] ([[User talk:Redrose64|talk]]) 12:29, 4 February 2015 (UTC)
:{{ping|Redrose64}} I set this up, but with the generic error category instead of a new one, and also with visible messages explaining exactly what the problem is. [[User:Jackmcbarn|Jackmcbarn]] ([[User talk:Jackmcbarn|talk]]) 18:45, 4 February 2015 (UTC)
::
Line 66:
:::{{ec}} Thanks, {{ping|Jackmcbarn}}, that seems to work for modules, but not for templates.
:::Unfortunately, I have now just discovered that [[:Template:Location map Scotland Highland]] has a piped name <code>Highland (council area)<nowiki>{{!}}</nowiki>Highland</code>, which is expecting to be linked. Which is the correct specification for what {{param|name}} is supposed to be?
:::I wrote the above sentences before Alakzi's reply. (Can we do something clever to detect the presence of a pipe character?) An example of a "misbehaving" infobox is {{tlx|Infobox UK feature}}. --<span style="border:1px solid #006000">[[User:Dr Greg|<span style="color:#FFFF80;background:#006000">'''&nbsp;Dr&nbsp;Greg&nbsp;'''</span>]][[User talk:Dr Greg|<span style="color:#006000;background:#FFFF80">&nbsp;<small>talk</small>&nbsp;</font></span>]]</span> 19:13, 2 July 2015 (UTC)
:::: Only [https://en.wikipedia.org/w/index.php?title=Special%3ASearch&profile=default&search=Template%3A+intitle%3ALocation+map+intitle%3A-doc+insource%3A%2Fname.*%5C%7B%5C%7B%21%5C%7D%5C%7D%2F&fulltext=Search 16] of them in the Template namespace. [[User:Alakzi|Alakzi]] ([[User talk:Alakzi|talk]]) 19:27, 2 July 2015 (UTC)
:::: And [https://en.wikipedia.org/w/index.php?title=Special%3ASearch&profile=default&search=Template%3A+insource%3A%2F%5C%5B%5C%5B%5C%7B%5C%7B%5C%23invoke%5C%3ALocation+map%5C%7Cdata%2F&fulltext=Search these] are all of the infoboxes which link to the name. [[User:Alakzi|Alakzi]] ([[User talk:Alakzi|talk]]) 19:30, 2 July 2015 (UTC)
Line 323:
== Accuracy ==
 
Is there a hard limit on the number of locations that can be displayed accurately using the Location+ template? It seems to start randomly off-setting the locations around when I reach 13-15 dots on one map. It doesn't break down completely but the error is enough to make it unusuable. Help? Thanks, [[User:Shannon1|<fonti facestyle="font-family:Perpetua"; color=":#008080"; font-size="3:medium">''Shann''</fonti>]][[User talk:Shannon1|<font colorb style= "color:#DC143C"; font-size:medium; = "3" face = "font-family:Perpetua">'''''o'''''</fontb>]][[Special:Contributions/Shannon1|<fonti facestyle="font-family:Mistral"; color=":#4B6CFC"; font-size="3:medium">''n''</font></spani>]]<font color = "blue"></font> 06:58, 2 November 2016 (UTC)
:{{ping|Shannon1}} The map code itself can handle huge numbers of points. For example, [[Template:Syrian Civil War detailed map]] has over 5000 points and still looks fine. If you're using {{tl|Location map+}} to use a lot of points, it's possible that you have some extra whitespace, which causes issues. What page do you notice inaccuracies on? [[User:Jackmcbarn|Jackmcbarn]] ([[User talk:Jackmcbarn|talk]]) 22:14, 2 November 2016 (UTC)
::{{ping|Jackmcbarn}} Thanks for the quick reply. I have a test page on [[User:Shannon1/Sandbox_3]], for locations of stream gauging stations in California. The ones in the top left are displaying correctly but the ones further down (RUS, AMR, ANF and SJF) are for some reason located quite a bit further south/west than they should. I checked the coordinates multiple times and can't seem to find the source of the problem. [[User:Shannon1|<fonti facestyle="font-family:Perpetua"; color=":#008080"; font-size="3:medium">''Shann''</fonti>]][[User talk:Shannon1|<font colorb style= "color:#DC143C"; font-size:medium; = "3" face = "font-family:Perpetua">'''''o'''''</fontb>]][[Special:Contributions/Shannon1|<fonti facestyle="font-family:Mistral"; color=":#4B6CFC"; font-size="3:medium">''n''</font></spani>]]<font color = "blue"></font> 23:53, 2 November 2016 (UTC)
:::{{ping|Shannon1}} The problem was indeed that you had extra whitespace. I removed it and now it looks normal to me. [[User:Jackmcbarn|Jackmcbarn]] ([[User talk:Jackmcbarn|talk]]) 21:16, 4 November 2016 (UTC)
::::Oh wow, that looks much better. Thanks so much! I had no idea that the blank lines affected the display of coordinates. [[User:Shannon1|<fonti facestyle="font-family:Perpetua"; color=":#008080"; font-size="3:medium">''Shann''</fonti>]][[User talk:Shannon1|<font colorb style= "color:#DC143C"; font-size:medium; = "3" face = "font-family:Perpetua">'''''o'''''</fontb>]][[Special:Contributions/Shannon1|<fonti facestyle="font-family:Mistral"; color=":#4B6CFC"; font-size="3:medium">''n''</font></spani>]]<font color = "blue"></font> 21:25, 4 November 2016 (UTC)
 
== Template-protected edit request on 31 August 2016 ==