Module talk:OSM Location map: Difference between revisions

Content deleted Content added
 
(12 intermediate revisions by 4 users not shown)
Line 1:
{{Permanently protected}}
Testing an example map within the lede
{{OSM Location map
|coord = {{coord|69.1061|15.8038}}
|zoom = 9
|width = 380
|height = 480
|float = right
|scalemark=50
 
|mini-locator=Oslo in Norway 2024.svg, top left,136px150px, 50%,17%
 
|label1 = Andøya Space Centre
|mark-coord1 = {{coord|69.2944|16.0198}}
|mark-size1 = 7
|label-pos1=left
 
|label2 = Andenes
|mark-coord2 = {{coord|69.3159|16.1211}}
|shape2=squareD
|mark-size2=11
|shape-color2=dark grey
 
|label-pos3=left
|label3 = Bleik
|mark-coord3 = {{coord|69.2739|15.9621}}
|mark-title3 = [[Bleik]]
|shape3=square
|mark-size3=8
|shape-color3=dark grey
 
|label-pos4=left
|label4 = Andøya Spaceport ^Orbital Pads
|mark-coord4 = {{coord|69.1087|15.5887}}
 
| label5 = '''ANDØYA'''
|label-spacing5 = 12.2
| label-pos5 = centre
| label-color5 = dark grey,60
| label-size5 = 14
| label-angle5 = -55
| mark-size5 = 0
| mark-coord5 = {{coord|69.076|15.822}}
 
|label-pos6=right
|label6 = Risøyhamn
|mark-coord6 = {{coord|68.9718|15.6384}}
|mark-title6 = [[Risøyhamn]]
|shape6=square
|mark-size6=8
|shape-color6=dark grey
 
| label7 = Skogvoll ^Nature ^Reserve
| label-height7 = 85
| label-pos7 = centre
| label-color7 = dark leaf,80
| mark-size7 = 0
| mark-coord7 = {{coord|69.1620|15.8917}}
 
| label8 = HINNØYA
|label-spacing8 = 3.2
| label-pos8 = centre
| label-color8 = grey,80
| mark-size8 = 0
| mark-coord8 = {{coord|68.9260|15.7462}}
| mark-title8 = [[Hinnøya]]
 
| label9 = Kvasstinden ^(705m)
| shape9=itriangle
|shape-color9=soft green
| label-pos9 = top
| label-color9 = dark leaf,80
| mark-size9 = 12
| mark-coord9 = {{coord|68.9302|15.4827}}
| mark-title9 = [[Kvasstinden]]
 
| label10 = Norwegian ^Sea
|label-spacing10 = 2.2
| label-pos10 = centre
| label-color10 = blue
| mark-size10 = 0
| mark-coord10 = {{coord|69.167|15.5991}}
| mark-title10 = none
 
| arcA = Andfjorden,68.9347,16.0236,12px, blue, -80deg, 2.5, 0.62
| arcB = Gavlfjorden,68.9225,15.3644,12px, blue, -95deg, 1.5, 0.62
| arcC = Risøysundet, 68.8890,15.554,11px, blue, 121deg, -1.5, 0.52
}}
 
{{clear}}
 
== Preparing to go live with replacement for the wiki-template version ==
Line 764 ⟶ 853:
:::::::The map-raw= feature is now live and will hopefully show all your fabulous geology stuff. I was trying to find a way to include caption text on the fullscreen page, but it has defeated me. My method for providing the fullscreen link rules it out as they use the same 'text' parameter. All the other functionality, including multiple geojson templates should work. The square brackets issue is just because they are already included, to encompass other geoJson bits and pieces. I look forward to seeing some results. (Do you have a 'category' entry to show pages that are using the map data?) [[User:RobinLeicester|RobinLeicester]] ([[User talk:RobinLeicester|talk]]) 21:43, 24 June 2025 (UTC)
::::::::It might be worth dropping a note about all the recent changes on one of the village pumps, done some awesome stuff here and deserves to get used :D '''[[User:Seddon|Seddon]]''' <sup>[[User talk:Seddon|talk]]</sup> 21:59, 24 June 2025 (UTC)
::::::::I understand the feature with the automatic inclusion of inline square brackets before passed to the json parser. I do suggest you create a hidden category <code>OSM Location Map using raw Geojson</code> as this feature is not implemented in other module/template processing of Geojson in Wikipedia. [[User:ChaseKiwi|ChaseKiwi]] ([[User talk:ChaseKiwi|talk]]) 16:49, 5 July 2025 (UTC)
 
== Bug: incorrect marker position ==
 
Markers that are not exactly in the map center are offset from the correct position, and in some cases, the offset can be quite large. In the two examples below, a marker with exactly the same coordinate parameter value is displayed more than 10 km from the correct position. The direction of the offset depends on the marker's position relative to the map center. In both cases, when opening the map in full screen, the marker is displayed at the correct position.
 
{{OSM Location map
|coord = {{coord|-52.8|-71.3}}
|zoom = 7
|width = 800
|height = 800
|float = centre
|label = Ushuaia
|mark-coord = {{coord|-54.801944|-68.303056}}
|mark-title = Ushuaia
|mark-size = 5
}}
{{clear}}
{{OSM Location map
|coord = {{coord|-56.8|-65.3}}
|zoom = 7
|width = 800
|height = 800
|float = centre
|label = Ushuaia
|mark-coord = {{coord|-54.801944|-68.303056}}
|mark-title = Ushuaia
|mark-size = 5
}}
{{clear}} [[User:Ftrebien|Fernando Trebien]] ([[User talk:Ftrebien|talk]]) 04:27, 6 August 2025 (UTC)
: Great troubleshooting, and it turns out there is an embarrassing solution. I solved this issue in the first rewrite ... but didn't notice my 'correction factor' had assumed a positive latitude value - disgraceful case of northernism which you (and {{U|ChaseKiwi}}) will be right to condemn! At present the solution (math.abs) is only on the sandbox. I will have a look around for any potential unwanted outcomes, but am hopeful it should only improve rather than break things, so expect to implement in due course.
 
: Only dots on the edges of the map, at close-to-polar latitudes will show much difference. As to why it needs a correction, I don't know. The values used were derived by trial and error, and your examples show that there is still scope for a slight improvement, which I will take the opportunity to have a look at. [[User:RobinLeicester|RobinLeicester]] ([[User talk:RobinLeicester|talk]]) 22:33, 6 August 2025 (UTC)
::{{reply to|RobinLeicester}} {{Thank}} a lot for fixing it so quickly! --[[User:Ftrebien|Fernando Trebien]] ([[User talk:Ftrebien|talk]]) 22:55, 9 August 2025 (UTC)
:::{{tick}} I was unable to find any unwanted outcomes, so have gone live with the correction. Thanks for reporting. [[User:RobinLeicester|RobinLeicester]] ([[User talk:RobinLeicester|talk]]) 15:51, 11 August 2025 (UTC)
::::Yes appreciated. At 45 degrees south which is southern NZ it was only a couple of pixels out so minor repositioning of some Arc labels will be done for ideal map clarity. [[User:ChaseKiwi|ChaseKiwi]] ([[User talk:ChaseKiwi|talk]]) 08:50, 12 August 2025 (UTC)
 
== Map mismatch at mobile APP view ==
 
I have noticed that the mobile app view has a fixed width, so the labels, points or whatever there is in the map is not shown in the correct position, but relative to the position it should have if the map had the original width. [[User:Theklan|Theklan]] ([[User talk:Theklan|talk]]) 07:25, 25 August 2025 (UTC)
 
: This is confusing. On my phone it was breaking above 330px when viewed as the first item in my own Sandbox, but trying it just now, it works correctly when shown within the sub-section below.
:Two examples, the same map at 320px and 380px wide. [[User:RobinLeicester|RobinLeicester]] ([[User talk:RobinLeicester|talk]]) 21:48, 29 August 2025 (UTC)
 
:: Wierdly, I am not able to replicate the problem at all on this page now. The map behaves correctly. But the same 380px map is still showing wrongly at [[User:RobinLeicester/sandbox|my sandbox]]. I am at a loss on this. [[User:RobinLeicester|RobinLeicester]] ([[User talk:RobinLeicester|talk]]) 22:18, 29 August 2025 (UTC)
{{OSM Location map
|coord = {{coord|69.1061|15.8038}}
|zoom = 9
|width = 330
|height = 480
|float = right
|scalemark=50
 
|mini-locator=Oslo in Norway 2024.svg, top left,136px150px, 50%,17%
 
|label1 = Andøya Space Centre
|mark-coord1 = {{coord|69.2944|16.0198}}
|mark-size1 = 7
|label-pos1=left
 
|label2 = Andenes
|mark-coord2 = {{coord|69.3159|16.1211}}
|shape2=squareD
|mark-size2=11
|shape-color2=dark grey
 
|label-pos3=left
|label3 = Bleik
|mark-coord3 = {{coord|69.2739|15.9621}}
|mark-title3 = [[Bleik]]
|shape3=square
|mark-size3=8
|shape-color3=dark grey
 
|label-pos4=left
|label4 = Andøya Spaceport ^Orbital Pads
|mark-coord4 = {{coord|69.1087|15.5887}}
 
| label5 = '''ANDØYA'''
|label-spacing5 = 12.2
| label-pos5 = centre
| label-color5 = dark grey,60
| label-size5 = 14
| label-angle5 = -55
| mark-size5 = 0
| mark-coord5 = {{coord|69.076|15.822}}
 
|label-pos6=right
|label6 = Risøyhamn
|mark-coord6 = {{coord|68.9718|15.6384}}
|mark-title6 = [[Risøyhamn]]
|shape6=square
|mark-size6=8
|shape-color6=dark grey
 
| label7 = Skogvoll ^Nature ^Reserve
| label-height7 = 85
| label-pos7 = centre
| label-color7 = dark leaf,80
| mark-size7 = 0
| mark-coord7 = {{coord|69.1620|15.8917}}
 
| label8 = HINNØYA
|label-spacing8 = 3.2
| label-pos8 = centre
| label-color8 = grey,80
| mark-size8 = 0
| mark-coord8 = {{coord|68.9260|15.7462}}
| mark-title8 = [[Hinnøya]]
 
| label9 = Kvasstinden ^(705m)
| shape9=itriangle
|shape-color9=soft green
| label-pos9 = top
| label-color9 = dark leaf,80
| mark-size9 = 12
| mark-coord9 = {{coord|68.9302|15.4827}}
| mark-title9 = [[Kvasstinden]]
 
| label10 = Norwegian ^Sea
|label-spacing10 = 2.2
| label-pos10 = centre
| label-color10 = blue
| mark-size10 = 0
| mark-coord10 = {{coord|69.167|15.5991}}
| mark-title10 = none
 
| arcA = Andfjorden,68.9347,16.0236,12px, blue, -80deg, 2.5, 0.62
| arcB = Gavlfjorden,68.9225,15.3644,12px, blue, -95deg, 1.5, 0.62
| arcC = Risøysundet, 68.8890,15.554,11px, blue, 121deg, -1.5, 0.52
}}
 
{{clear}}
{{OSM Location map
|coord = {{coord|69.1061|15.8038}}
|zoom = 9
|width = 380
|height = 480
|float = right
|scalemark=50
 
|mini-locator=Oslo in Norway 2024.svg, top left,136px150px, 50%,17%
 
|label1 = Andøya Space Centre
|mark-coord1 = {{coord|69.2944|16.0198}}
|mark-size1 = 7
|label-pos1=left
 
|label2 = Andenes
|mark-coord2 = {{coord|69.3159|16.1211}}
|shape2=squareD
|mark-size2=11
|shape-color2=dark grey
 
|label-pos3=left
|label3 = Bleik
|mark-coord3 = {{coord|69.2739|15.9621}}
|mark-title3 = [[Bleik]]
|shape3=square
|mark-size3=8
|shape-color3=dark grey
 
|label-pos4=left
|label4 = Andøya Spaceport ^Orbital Pads
|mark-coord4 = {{coord|69.1087|15.5887}}
 
| label5 = '''ANDØYA'''
|label-spacing5 = 12.2
| label-pos5 = centre
| label-color5 = dark grey,60
| label-size5 = 14
| label-angle5 = -55
| mark-size5 = 0
| mark-coord5 = {{coord|69.076|15.822}}
 
|label-pos6=right
|label6 = Risøyhamn
|mark-coord6 = {{coord|68.9718|15.6384}}
|mark-title6 = [[Risøyhamn]]
|shape6=square
|mark-size6=8
|shape-color6=dark grey
 
| label7 = Skogvoll ^Nature ^Reserve
| label-height7 = 85
| label-pos7 = centre
| label-color7 = dark leaf,80
| mark-size7 = 0
| mark-coord7 = {{coord|69.1620|15.8917}}
 
| label8 = HINNØYA
|label-spacing8 = 3.2
| label-pos8 = centre
| label-color8 = grey,80
| mark-size8 = 0
| mark-coord8 = {{coord|68.9260|15.7462}}
| mark-title8 = [[Hinnøya]]
 
| label9 = Kvasstinden ^(705m)
| shape9=itriangle
|shape-color9=soft green
| label-pos9 = top
| label-color9 = dark leaf,80
| mark-size9 = 12
| mark-coord9 = {{coord|68.9302|15.4827}}
| mark-title9 = [[Kvasstinden]]
 
| label10 = Norwegian ^Sea
|label-spacing10 = 2.2
| label-pos10 = centre
| label-color10 = blue
| mark-size10 = 0
| mark-coord10 = {{coord|69.167|15.5991}}
| mark-title10 = none
 
| arcA = Andfjorden,68.9347,16.0236,12px, blue, -80deg, 2.5, 0.62
| arcB = Gavlfjorden,68.9225,15.3644,12px, blue, -95deg, 1.5, 0.62
| arcC = Risøysundet, 68.8890,15.554,11px, blue, 121deg, -1.5, 0.52
}}
 
{{clear}}