Jump to content

Module talk:Location map/Archive 10

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Lowercase sigmabot III (talk | contribs) at 02:34, 17 October 2018 (Archiving 2 discussion(s) from Module talk:Location map) (bot). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Archive 5Archive 8Archive 9Archive 10Archive 11

Edit request: Remove /sandbox from Module:Location map/multi

Last edit[1] had local locmap = require('Module:Location map/sandbox'). The /sandbox should be removed again. Christian75 (talk) 16:22, 23 February 2018 (UTC)

 Done Galobtter (pingó mió) 16:44, 23 February 2018 (UTC)
@Frietjes: looks like the sandbox had got out of sync slightly with the main module, hence the unexplained removals (and also the require being a sandbox version). Bellezzasolo Discuss 20:23, 23 February 2018 (UTC)
Bellezzasolo, yes, your diffs didn't ask for these removals, but when the sandbox was copied, that's what happened. I noticed because there was an explosion in the number of articles generating script errors, but we seem to be doing better now. Frietjes (talk) 20:26, 23 February 2018 (UTC)

Proposed changes

I've made a change over at the module sandbox. This is the inclusion of a new parameter - |excludefrom=. When set, the mark in question is excluded from the specified maps. The syntax for specifying maps is as usual. This is only useful in the context of multiple maps - either some of multiple marks are off the screen, or you have a map of a town, and you don't really want a dot saying that town's name slap bang in the centre - but you do want a map of the country. Bellezzasolo Discuss 07:22, 26 February 2018 (UTC)

Bellezzasolo I do like the idea of supporting a static image without a locator pin (see this thread). there was also some discussion of having |first_valid= and/or |only_valid= parameters which would (1) only show the first valid map and (2) only show the valid maps. a map is valid if the pin is on the map. this would be useful for Template:Infobox telescope which uses Template:Wikidata location map at the moment, but has problems with telescopes in Hawaii since they aren't on the main USA map. I don't see the point of showing maps that don't include any pins, unless these are static images that aren't location maps. Frietjes (talk) 16:48, 26 February 2018 (UTC)
@Frietjes: I was thinking in the context of {{Location map+}} mainly. There it has its uses, I think. Bellezzasolo Discuss 16:51, 26 February 2018 (UTC)
Bellezzasolo can you provide an example in an article? Frietjes (talk) 16:53, 26 February 2018 (UTC)
Frietjes e.g. University of Oxford#Map, which is tested with the new changes over at {{Location map+/testcases}} Bellezzasolo Discuss 17:14, 26 February 2018 (UTC)

Multiple maps layout error

A problem was reported at Wikipedia:Help desk#Incorrect page layout. The example at Template:Location map#User selection of multiple maps displays the radio buttons to the left of the map instead of below. PrimeHunter (talk) 13:21, 4 March 2018 (UTC)

Rabindranath Tagore was using Template:Location map+ with multiple maps. I've fixed the article, but there probably could be some improvements to the templates to detect this. (I don't believe we have any intention of supporting multiple locations and multiple maps simultaneously.) MB 14:38, 4 March 2018 (UTC)
@PrimeHunter and MB: I will see about adding some tracking for this, and then (possibly) a method for correcting it. see Toggle options appear in the wrong place and Multiple maps without an infobox. Frietjes (talk) 15:04, 4 March 2018 (UTC)
The example at Template:Location map#User selection of multiple maps still looks wrong to me but I don't know whether it does something unsupported. PrimeHunter (talk) 15:19, 4 March 2018 (UTC)
see Toggle options appear in the wrong place and Multiple maps without an infobox. Frietjes (talk) 15:46, 4 March 2018 (UTC)

Captions - suggested change

I sometime encounter code like Template:Wikidata location map.

Location of {{#if:{{{name|}}}|{{{name}}}|{{PAGENAMEBASE}}}}

This is problematic when it comes to multiple maps. As a result, I'd suggest supporting caption templating like Module:Location map/data/USA utilizes in the x and y parameter.
Something like |caption=Location in $name. Bellezzasolo Discuss 23:21, 10 March 2018 (UTC)

Bug with most recent changes

@Bellezzasolo: not sure what happened, but comparing

the sandbox version (which is the version before I rolled back) has the map spilling out of the infobox. I will see if I can figure out what went wrong. Frietjes (talk) 22:02, 29 March 2018 (UTC)

it looks like it's triggered by the additional outer <div>...</div> Frietjes (talk) 22:04, 29 March 2018 (UTC)
Bellezzasolo, I think I found the problem. {{infobox protected area}} uses |default_width= and |max_width=, but the code that you added was ignoring these values. I moved the width determination code to a subfunction and added some more logic, and it seems to have fix the problem diff. but, we probably need more testing? Frietjes (talk) 22:28, 29 March 2018 (UTC)
Yeah, although I’m not sure about what some good testcases would be. Ideas? Bellezzasolo Discuss 22:31, 29 March 2018 (UTC)