Jump to content

Module talk:OSM Location map

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

Preparing to go live with replacement for the wiki-template version

[edit]

I have finally got to grips with enough of Lua/Scribuntu to convert the whole of the existing suite of {{OSM Location map}} templates to into a Lua module. The intention here is to retain complete 'functional equivalence', but for various reasons there may be tiny shifts in position of some elements, which I would propose to 'leave be'. Differences which have a significant impact on existing maps, or throw up errors, will need to be addressed before going live, if at all possible.

The main objectives in this rewrite are:

  • Better performance/lower resource use. The maps via the module are making much lower demands on the resources and load-times.
  • Enable 'notionally unlimited' amount of dots, instead of the 60 limit. Clearly there would be a point beyond which the resources will be affected, but the module has no built in limit.
  • Use of Lua will make it possible to add features within more maintainable code.
  • Also to develop an alternative more condensed parameter regime, to give more flexibility/control options and more concise template text (and one day, maybe external data file).

This last point will be a thing to look at in detail later on. The first task at this point is to test out any potentially troublesome maps before going live, so any help in checking maps would be much appreciated.

{{OSM Location map/sandbox}} is now using the new module, so you can test a map 'in-situ' by simply adding '/sandbox' to the template name and preview it. (Note: don't leave it saved with the sandbox version, as it might be being used later for testing stuff). If you find errors the next step is to paste the full template code into a 'testcases table' template at {{OSM Location map/testcases}}. This allows side-by-side comparison of how it is supposed to look, so the issue can be debugged. My suggestion is that you notify about problem maps on this talk page, which is also a good place to initiate any other discussions on the switch-over to using the module

Thanks for any input people can make. RobinLeicester (talk) 23:34, 5 March 2025 (UTC)[reply]

A test case identified that module is not parsing extended character set for labels and only displaying ASC11 character set. This will break many maps. I will paste an example as this is breaking till fixed. ChaseKiwi (talk) 08:39, 8 March 2025 (UTC)[reply]

Test for full character set in labels and correct labelling positioning

[edit]

The bugs at time of initial testing in Test case are:

  • Lua module not displaying full character sets in labels
  • number code labels misaligned
    1. lapel position top about 5px to high
    2. label 2 which was on a CurveC goes mad with the ldy2 = 16 by probably a factor of ten
Map
About OpenStreetMaps
Maps: terms of use
8km
5miles
M
ý
r
d
a
l
s
j
ö
k
u
l
l
K
ö
t
l
u
j
ö
k
u
l
l
Ice cauldron 20 ref.
C20
Ice cauldron 20 ref.
Ice cauldron 20 ref.
Ice cauldron 15 ref.
C15
Ice cauldron 15 ref.
Ice cauldron 15 ref.
Ice cauldron 14 ref.
C14
Ice cauldron 14 ref.
Ice cauldron 14 ref.
Ice cauldron 13 ref.
C13
Ice cauldron 13 ref.
Ice cauldron 13 ref.
Ice cauldron 12 ref.
C12
Ice cauldron 12 ref.
Ice cauldron 12 ref.
Ice cauldron 11 ref.
C11
Ice cauldron 11 ref.
Ice cauldron 11 ref.
Ice cauldron 10 ref.
C10
Ice cauldron 10 ref.
Ice cauldron 10 ref.
Ice cauldron 18 in region of 1823 eruption ref.
C18
Ice cauldron 18 in region of 1823 eruption ref.
Ice cauldron 18 in region of 1823 eruption ref.
Ice cauldron 16 in region of 1823 eruption ref.
C16
Ice cauldron 16 in region of 1823 eruption ref.
Ice cauldron 16 in region of 1823 eruption ref.
Ice cauldron 9 in region of 1918 eruption ref.
C9
Ice cauldron 9 in region of 1918 eruption ref.
Ice cauldron 9 in region of 1918 eruption ref.
Ice cauldron 17 in region of 1918 eruption ref.
C17
Ice cauldron 17 in region of 1918 eruption ref.
Ice cauldron 17 in region of 1918 eruption ref.
Ice cauldron 8 in region of 1918 eruption ref.
C8
Ice cauldron 8 in region of 1918 eruption ref.
Ice cauldron 8 in region of 1918 eruption ref.
Ice cauldron 19 ref.
C19
Ice cauldron 19 ref.
Ice cauldron 19 ref.
Ice cauldron 7 ref.
C7
Ice cauldron 7 ref.
Ice cauldron 7 ref.
Ice cauldron 6 in region of 1755 eruption ref.
C6
Ice cauldron 6 in region of 1755 eruption ref.
Ice cauldron 6 in region of 1755 eruption ref.
Ice cauldron 5 in region of 1755 eruption ref.
C5
Ice cauldron 5 in region of 1755 eruption ref.
Ice cauldron 5 in region of 1755 eruption ref.
Ice cauldron 4 ref.
C4
Ice cauldron 4 ref.
Ice cauldron 4 ref.
Ice cauldron 3 ref.
C3
Ice cauldron 3 ref.
Ice cauldron 3 ref.
Ice cauldron 2 ref.
C2
Ice cauldron 2 ref.
Ice cauldron 2 ref.
Ice cauldron 1 ref.
C1
Ice cauldron 1 ref.
Ice cauldron 1 ref.
8
7
6
From Múlakvísl river area towards Kerlingardalsfjara beach
From Múlakvísl river area towards Kerlingardalsfjara beach
5
From Kötlujökull to Múlakvísl river area of Mýrdalssandur towards Höfðabrekkufjara beach
From Kötlujökull to Múlakvísl river area of Mýrdalssandur towards Höfðabrekkufjara beach
4
From Kötlujökull towards Kötlutangi beach
From Kötlujökull towards Kötlutangi beach
3
From Kötlujökull to Blautakvísl river area of Mýrdalssandur
From Kötlujökull to Blautakvísl river area of Mýrdalssandur
2
1
CURRENT CODE Arrows show recent jökulhlaup flows from Mýrdalsjökull ice cap. Current ice cauldrons are shown in violet:[1][2]: 17 [a][b]
1:from Kötlujökull to Leirá in 1721, 1755, 1918
2:from Kötlujökull / Sandfellsjökull to Austastikælir stream / Skálm river in 1612, 1625, 1660, 1721, 1755, 1823, 1860, 1918, 2024[3]
3:from Kötlujökull to Blautakvísl river area of Mýrdalssandur in (1625), 1660, 1755, 1823, 1918
4:from Kötlujökull to Múlakvísl river area of Mýrdalssandur towards Kötlutangi and Höfðabrekkufjara beaches in 1612, 1625, 1660, 1721, 1755, 1823, 1860, 1918
5:from Kötlujökull to Múlakvísl river area of Mýrdalssandur towards Höfðabrekkufjara beach in 1612, 1625, 1660, 1721, 1755, 1823, 1860, 1918, 1955, 1999, 2011, 2014, 2017
6:from Múlakvísl river area towards Kerlingardalsfjara beach in 1660, 1721, 1755, 1823, 1860
7:from Sólheimajökull towards Sólheimasandur in 1860, 1999
8:from Jökulsárgilsjökull towards Jökulsárgil in 1936


Map
About OpenStreetMaps
Maps: terms of use
7km
4miles
M
ý
r
d
a
l
s
j
ö
k
u
l
l
K
ö
t
l
u
j
ö
k
u
l
l
Ice cauldron 20ref.
C20
Ice cauldron 20ref.
Ice cauldron 15ref.
C15
Ice cauldron 15ref.
Ice cauldron 14ref.
C14
Ice cauldron 14ref.
Ice cauldron 13ref.
C13
Ice cauldron 13ref.
Ice cauldron 12ref.
C12
Ice cauldron 12ref.
Ice cauldron 11ref.
C11
Ice cauldron 11ref.
Ice cauldron 10ref.
C10
Ice cauldron 10ref.
Ice cauldron 18 in region of 1823 eruptionref.
C18
Ice cauldron 18 in region of 1823 eruptionref.
Ice cauldron 16 in region of 1823 eruptionref.
C16
Ice cauldron 16 in region of 1823 eruptionref.
Ice cauldron 9 in region of 1918 eruptionref.
C9
Ice cauldron 9 in region of 1918 eruptionref.
Ice cauldron 17 in region of 1918 eruptionref.
C17
Ice cauldron 17 in region of 1918 eruptionref.
Ice cauldron 8 in region of 1918 eruptionref.
C8
Ice cauldron 8 in region of 1918 eruptionref.
Ice cauldron 19ref.
C19
Ice cauldron 19ref.
Ice cauldron 7ref.
C7
Ice cauldron 7ref.
Ice cauldron 6 in region of 1755 eruptionref.
C6
Ice cauldron 6 in region of 1755 eruptionref.
Ice cauldron 5 in region of 1755 eruptionref.
C5
Ice cauldron 5 in region of 1755 eruptionref.
Ice cauldron 4ref.
C4
Ice cauldron 4ref.
Ice cauldron 3ref.
C3
Ice cauldron 3ref.
Ice cauldron 2ref.
C2
Ice cauldron 2ref.
Ice cauldron 1ref.
C1
Ice cauldron 1ref.
8
7
6
From Múlakvísl river area towards Kerlingardalsfjara beach
5
From Kötlujökull to Múlakvísl river area of Mýrdalssandur towards Höfðabrekkufjara beach
4
From Kötlujökull towards Kötlutangi beach
3
From Kötlujökull to Blautakvísl river area of Mýrdalssandur
2
1
NEW LUA MODULE TEST CASE Arrows show recent jökulhlaup flows from Mýrdalsjökull ice cap. Current ice cauldrons are shown in violet:[1][2]: 17 [a][b]
1:from Kötlujökull to Leirá in 1721, 1755, 1918
2:from Kötlujökull / Sandfellsjökull to Austastikælir stream / Skálm river in 1612, 1625, 1660, 1721, 1755, 1823, 1860, 1918, 2024[3]
3:from Kötlujökull to Blautakvísl river area of Mýrdalssandur in (1625), 1660, 1755, 1823, 1918
4:from Kötlujökull to Múlakvísl river area of Mýrdalssandur towards Kötlutangi and Höfðabrekkufjara beaches in 1612, 1625, 1660, 1721, 1755, 1823, 1860, 1918
5:from Kötlujökull to Múlakvísl river area of Mýrdalssandur towards Höfðabrekkufjara beach in 1612, 1625, 1660, 1721, 1755, 1823, 1860, 1918, 1955, 1999, 2011, 2014, 2017
6:from Múlakvísl river area towards Kerlingardalsfjara beach in 1660, 1721, 1755, 1823, 1860
7:from Sólheimajökull towards Sólheimasandur in 1860, 1999
8:from Jökulsárgilsjökull towards Jökulsárgil in 1936


Thanks, ChaseKiwi. Both issues fixed, I think. Not sure if my fix for the label positions will work in all sizes and angles, but seems to hold up pretty well. I will also look further at extended character set risk. Please add anything that looks off. Much obliged, RobinLeicester (talk) 01:16, 10 March 2025 (UTC)[reply]

References

  1. ^ a b Cite error: The named reference hi was invoked but never defined (see the help page).
  2. ^ a b Cite error: The named reference McCluskey2019 was invoked but never defined (see the help page).
  3. ^ a b "Hlaup úr Mýrdalsjökli. Hlaupið hefur ekki náð hámarki við þjóðveg 1" (in Icelandic). Icelandic Weather Office. 28 July 2024. Retrieved 28 July 2024.

script errors

[edit]

@RobinLeicester there might be some issues for you to attend to in Category:Pages with script errors. For example, 2003 Casablanca bombings reports:

Lua error in Module:OSM_Location_map at line 406: bad argument #1 to 'rad' (number expected, got string).

TIA. --Joy (talk) 18:27, 21 March 2025 (UTC)[reply]

Thanks for that. Hopefully the issue is fixed, but if other issues are showing up, please let me know. Much appreciated. RobinLeicester (talk) 23:53, 21 March 2025 (UTC)[reply]

Could someone please look into the Lua error at Killing of Brian Thompson#Timeline? I tried but found myself hopelessly lost. * Pppery * it has begun... 16:01, 22 March 2025 (UTC)[reply]

Thanks Pppery. It turns out to have just been the lessthan comparison falling over when given letters instead of numbers, for which I apologise. Thanks for having a look. The 'sort' stuff is horribly convoluted but turns out to not be the guilty party. RobinLeicester (talk) 00:15, 23 March 2025 (UTC)[reply]


Cite error: There are <ref group=lower-alpha> tags or {{efn}} templates on this page, but the references will not show without a {{reflist|group=lower-alpha}} template or {{notelist}} template (see the help page).