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:46, 6 November 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)

Help sawiki

I tried importing this module to sawiki (latest code) but it has 100s of module dependencies. It is very difficult to import all associated countries / states / cities to sawiki manually. Can someone please help. Capankajsmilyo (talk) 02:39, 3 April 2018 (UTC)

Capankajsmilyo, I would suggest asking at WP:BOTREQ. basically, you want a bot to import the maps. or, at least the most common maps. the other option is to add them one-at-a-time as you need them. Frietjes (talk) 12:34, 5 April 2018 (UTC)
Thanks, Ive posted bot request. Hope to get a response soon. Capankajsmilyo (talk) 09:14, 15 April 2018 (UTC)

Further help

This contains a function coords2text which needs input as arabic numerals. In sawiki we pass devanagari numerals. Please help... Capankajsmilyo (talk) 09:14, 15 April 2018 (UTC)

@Capankajsmilyo: What you need there is a function that converts one format to the other - split the string into an array, and convert each character individually is a common approach. Bellezzasolo Discuss 10:56, 15 April 2018 (UTC)
Will Module:GetLocalDigits work? How to integrate? And decimals and non-numerals? Capankajsmilyo (talk) 12:20, 15 April 2018 (UTC)
@Capankajsmilyo: see bn.wiki. আফতাব (talk) 14:17, 15 April 2018 (UTC)
Trappist the monk has done recent work I think on this for the citation templates. He may be able to help. --Izno (talk) 18:41, 15 April 2018 (UTC)
The bn.wiki example mentioned above shows how digit translation is done. I don't think that I have anything further to add.
Trappist the monk (talk) 18:53, 15 April 2018 (UTC)

Help Pawiki

I tried importing this module to pawiki (latest code) but when i saw an article, it shows "Lua error in Module:Location_map at line 418: No value was provided for longitude." How can i fix this error? - Satpal Dandiwal (talk) 13:53, 3 June 2018 (UTC)

First, provide a link to the article that has the error in it so that we have a chance to help you. Second, is the article using the {{coord}} template in the infobox? If not, add the coord template to the infobox using the |coordinates= parameter to see if that fixes the problem. – Jonesey95 (talk) 15:04, 3 June 2018 (UTC)
Hello @Jonesey95, here is an article - ਮੈਟਰੋਪੋਲੀਟਨ ਮਿਊਜ਼ੀਅਮ ਆਫ਼ ਆਰਟ - Satpal Dandiwal (talk) 16:09, 3 June 2018 (UTC)
There are a few problems here. Template:Infobox museum does not pass |coordinates= to Template:Location map+. Fix that. Also, Template:Location map+ uses Template:Location map/multi, which does not accept |coordinates=. Update those things and then try it again. – Jonesey95 (talk) 16:24, 3 June 2018 (UTC)