Module talk:Mapframe

Latest comment: 14 days ago by The Equalizer in topic Inserting textual markers

Copying template to another language wiki edit

Hi, I would like to request that this template, together with its dependencies be copied over to the Bulgarian wiki. There are a lot of pages that would benefit from it and there is currently no alternative template to use. The parameters can be left as is, but if needed I can translate them over.

Request to fix JFK Expressway map edit

The red line of the route for JFK Expressway in the Queens is way too long, it should run from the center of JFK Airport to Exit 20 on the Belt Parkway; right now it runs all the way to central Queens, which it certainly shouldn’t. Thank you. :) Jason Ingtonn (talk) 00:35, 6 August 2023 (UTC)Reply

Corrected. Regs, The Equalizer (talk) 21:37, 13 December 2023 (UTC)Reply

Maplink view defaults to 0 0 coordinates edit

Hi there, for some reason when I add a maplink to an infobox tunnel or infobox mountain pass, the maplink doesn't show the specified object; the view is of the 0 0 coordinates. Please see Daspoort Tunnel and Orange–Fish River Tunnel. I also added it to Chapman's Peak but it resolved after a few days. Adding a maplink to infobox river doesn't have that problem; see Berg River. Thanks, Maqdisi (talk) 08:30, 26 October 2023 (UTC)Reply

Use {{infobox mapframe}} instead, have updated Daspoort. Regs, The Equalizer (talk) 01:43, 14 December 2023 (UTC)Reply

Nested relations edit

Is there a way to get nested relations, such as that for the Oak Leaf Trail (https://www.openstreetmap.org/relation/16054036), to display using this template? The best I've been able to get working is the default fully zoomed-out view of the globe. huntertur (talk) 02:45, 14 November 2023 (UTC)Reply

The zoomed out view means it is not working. Looking at OSM Analyser, it thinks the master relation is empty, so there is no shape to render. I think all the ways would need to be added in which is effort, or the individual trails given their own Wikidatas. The Equalizer (talk) 22:22, 18 November 2023 (UTC)Reply
I have a similar issue with the fr:Ligne d'Avallon à Nuits-sous-Ravières, https://www.openstreetmap.org/relation/6442408 where only the ways included in the parent relation are shown, and not the child relations. There are quite a few instances of this behavior. If I understand you correctly, the only way to address this would be to export all the ways of the nested relations and feed them into the master relation? Could this be done with some export-update and re-import of the XML of that relation? Milliped (talk) 12:41, 13 December 2023 (UTC)Reply

Highway system OSM map raw query edit

I was wondering if someone could help explain the raw query used in {{Highway system OSM map}}. We recently had a problem with it described at Wikipedia talk:WikiProject Highways#Problem with Croatian highway infobox maps so it would be nice if this was better understood, to be more maintainable. --Joy (talk) 16:54, 1 December 2023 (UTC)Reply

Map displays fine in preview but flat grey when live. What gives? edit

Syntax is «infobox mapframe|stroke-width=1|zoom=12|width=240 |geomask=Q19858129 |point=none » (substituting guillemets for braces to display). Problem arises at Middleton, Milton Keynes. I have left it overnight in the hope that it would clear but no joy. Advice? 𝕁𝕄𝔽 (talk) 12:34, 12 December 2023 (UTC)Reply

@MRSC:, any suggestions? --𝕁𝕄𝔽 (talk) 12:40, 12 December 2023 (UTC)Reply
Whenever I've run into this sort of thing before it has been something to do with the Wikipedia/Wikidata/OpenStreetMap link up. I've had a quick look but can't see anything obvious. MRSC (talk) 13:00, 12 December 2023 (UTC)Reply
I'll have to suspend the mapping in the three cases I've had to use geomask= , I can't leave it like that. --𝕁𝕄𝔽 (talk) 13:04, 12 December 2023 (UTC)Reply
Geomask maps haven't been working for a while, seems to be reported @ phab:T305121.
Use instead the standard one:
{{Infobox mapframe|stroke-width=1|zoom=12|width=240 |id=Q19858129}} 
Regs, The Equalizer (talk) 20:34, 12 December 2023 (UTC)Reply

Add "Show" to L10n edit

"Show" as at line 1080 should be added to L10n. --Nk (talk) 13:04, 15 December 2023 (UTC)Reply

If you view the source for the Mapframe module, there is an edit request button with instructions on how to notify admins. Regs, The Equalizer (talk) 17:43, 15 December 2023 (UTC)Reply


Scale indicator of maps is not shown at published phase edit

Hi, does exist anyway to show scale of maps? For example, only in preview time, there exists a 20km indicator on the bottom left of this map:

 

For viewing of this scale, we should do a preview action. But at the time of publishing, such indicator is not shown. If we show, then the scale of map of Shiraz city becomes clearer to the viewer of Wikipedia. Thanks, Hooman Mallahzadeh (talk) 12:12, 22 December 2023 (UTC)Reply

broken map link edit

Is it just me or does infobox mapframe not work at Sokolac Fortress (Bihać)? I don't see why, it links to https://www.wikidata.org/wiki/Q25555219 which in turn links to https://www.openstreetmap.org/relation/14304925 so it all seems fine...? --Joy (talk) 09:57, 23 February 2024 (UTC)Reply

Have fixed. Regards, The Equalizer (talk) 03:51, 24 February 2024 (UTC)Reply
@The Equalizer you fixed it? Thanks, but what was the trick, for future reference? --Joy (talk) 19:52, 24 February 2024 (UTC)Reply
Because {{Infobox mapframe}} was used standalone in the {{Infobox military installation}} template of the page, and the Wikidata entry had both the P625 point and P402 shape attributes (which reserves a space on the Wiki Map servers to save a map), it defaults to only trying to show the shape unless extra parameters are specified such as |point=on or |coord=<coords...> to show a marker. However, the map was centring on 0,0 coordinates in the Atlantic Ocean.
That's because there was no actual shape stored on the Wiki map servers that mirror OpenStMap, as the type parameter for the shape on OSM needs to be one of four (mw:Help:Extension:Kartographer/OSM#How to get a single object from multiple lines) that causes the shape to be migrated across and so be available. I figured it is nicer to have that available than a simple marker, and set type as boundary. Regards, The Equalizer (talk) 21:37, 24 February 2024 (UTC)Reply
Ohh, so the previous OSM type of "building" was the bad part... Would it make sense to add hints to this effect somewhere in Template:Infobox mapframe/doc or Template:Maplink/doc? We seem to document a lot of the other aspects of the Kartographer extension but not this. --Joy (talk) 16:03, 25 February 2024 (UTC)Reply
The OSM Media Wiki page I referenced above was in Template:Maplink/doc and in #4 of Module talk:mapframe/FAQ (which is at the top of Template talk:Infobox mapframe). Trouble is, they are all sprawling documents and it's hard to pick out the specifics at times. I've added the FAQ link to them all and updated it with the fourth type parameter. Regards, The Equalizer (talk) 22:59, 25 February 2024 (UTC)Reply
Oh yeah, I would not really expect anyone to look for template documentation at template talk. This FAQ should be transcluded into the standard template/module/whatever documentation element, putting it on Talk is tantamount to hiding it, which seems counterproductive :D Done that now. --Joy (talk) 09:19, 26 February 2024 (UTC)Reply

question about switching between maps edit

I'd like to switch between several different .map files depicting the same region in different times. I tested the template:switcher and the switch function described in the template:mapframe docs. Neither of them worked. The template:switcher just resulted in 3 identical maps (the first of the three maps). The template:mapframe switch function resulted in a map without the associated shapes on top. But it's possible I did it wrong. Here's the code segment for that attempt:

{{maplink|frame=yes|plain=yes|from=SWITCH:Wisconsin's 1st Assembly district (2024–2031).map,Wisconsin's 1st Assembly district (2022–2023).map, Wisconsin's 1st Assembly district (2011–2021).map|frame-height=300|frame-width=400|frame-latitude=44.8|frame-longitude=-88|zoom=7|overlay-horizontal-alignment=right|overlay-vertical-alignment=bottom|overlay=[[File:2024 WI Asm 01.svg|100px]]|switch=From 2024 to 2031, From 2022 to 2023, From 2012 to 2021 }}

I also tried adding overlapping shapes in the same map file and trying to switch by ID. That threw errors. Anyone done or seen something like this before? If I can see a working version I can probably reconstruct it. -- Asdasdasdff (talk) 22:37, 1 March 2024 (UTC)Reply

Use {{Switcher}} instead to allow an overlay:
(Remove any colons seen) 
:{{switcher|
:{{maplink|frame=yes|plain=yes|from=Wisconsin's 1st Assembly district (2024–2031).map|frame-height=300|frame-width=400|frame-coord={{coord|44.8|-88}}|frame-longitude=-77.2|zoom=7|overlay-horizontal-alignment=right|overlay-vertical-alignment=bottom|overlay=[[File:2024 WI Asm 01.svg|100px]]
:}}
:|A - From 2024 to 2031 
:|{{maplink|frame=yes|plain=yes|from=Wisconsin's 1st Assembly district (2022–2023).map|frame-height=300|frame-width=400|frame-coord={{coord|44.8|-88}}|frame-longitude=-77.2|zoom=7|overlay-horizontal-alignment=right|overlay-vertical-alignment=bottom|overlay=[[File:2024 WI Asm 01.svg|100px]]
:}}
:|B - From 2022 to 2023
:|{{maplink|frame=yes|plain=yes|from=Wisconsin's 1st Assembly district (2011–2021).map|frame-height=300|frame-width=400|frame-coord={{coord|44.8|-88}}|frame-longitude=-77.2|zoom=7|overlay-horizontal-alignment=right|overlay-vertical-alignment=bottom|overlay=[[File:2024 WI Asm 01.svg|100px]]}}
:|C - From 2011 to 2021
:}}
Also you report having three identical maps. You should look at the map files on Commons.
commons:Data:Wisconsin's 1st Assembly district (2024–2031).map
and
commons:Data:Wisconsin's 1st Assembly district (2022–2023).map
I've compared the coordinate data and they both exactly the same.

commons:Data:Wisconsin's 1st Assembly district (2011–2021).map is subtly different, a small change at the bottom right of the shape.
The Equalizer (talk) 17:39, 2 March 2024 (UTC)Reply
Thank you, I will try that out! And yeah, the 2024 map is actually identical to the 2022 map. But I guess I thought it was necessary to indicate that even though the map was unchanged, it was under a new legal authority with the 2024 law vs the 2022 court decision (district 1 is the only district that was left unchanged). Thanks again. -- Asdasdasdff (talk) 23:04, 3 March 2024 (UTC)Reply
Hey, looks like it worked! Thanks again! -- Asdasdasdff (talk) 23:09, 3 March 2024 (UTC)Reply

Geojson map styling ignored when displaying map on the page, when the data file is in sub directory edit

geojson color styling rendered for data file in root directory edit

 

geojson color styling ignored for data file in subdirectory edit

  While the preview works for both static rendered images behave differently.

I have raised a bug(T359705). This comment is to demonstrate the issue. Arjunaraoc (talk) 05:40, 9 March 2024 (UTC)Reply

Today I find that the color styling is updated to correct color for the data file in sub directory. The issue may need investigation for delay in updation. Arjunaraoc (talk) 03:56, 10 March 2024 (UTC)Reply

Another example with feature colleciton edit

Styling rendered with file in root directory edit

 
Veligonda project components overlaid on map

styling rendered for file in sub directory edit

 
Veligonda project components overlaid on map

Surprisingly, the static image for data in sub directory was not updated even after two days, when I tested in actual article page.

I think there is a caching delay of some sort. I tried updating a file I was working with in a sandbox (so in a subdirectory too) and although it shows ok on Commons it also wouldn't seemingly show the new attributes when used in an article. Even purging hasn't helped. A workaround is to update and then move the file to a new page. The Equalizer (talk) 05:27, 15 March 2024 (UTC)Reply

Inserting textual markers edit

Hi, is there any way to place textual markers? For example to show different faculties of Sharif university we need textual markers, i.e., for:  

  • a textual marker for Electrical faculty, another for Computer faculty etc. is needed. How can I mark them with pointers? Thanks,

Hooman Mallahzadeh (talk) 07:23, 12 April 2024 (UTC)Reply

You can't have points that show text on top of the thumbnail map on {{infobox mapframe}} or {{mapframe}} Kartographer based maps, only when they are clicked on in full screen. If you want multiple points, have to use {{mapframe}} only. So:
 
{{mapframe
|frame=yes
|plain=yes
|width=250|height=200
|type=shape-inverse
|id=Q2096604
|title=Shape
|description=Desc of shape
|frame-coord={{coord|35.703|51.351|display=i}}
|zoom=14
|stroke-width=1
|type2=point|coord2={{coord|35.7062|51.3495}}|title2=Point A|description2=Description of point A|marker2=college
|type3=point|coord3={{coord|35.7061|51.3510}}|title3=Point B|description3=Description of point B
|type4=point|coord4={{coord|35.7020|51.3519}}|title4=Point C|description4=Description of point C|marker4=college
}}
Regards, The Equalizer (talk) 22:36, 12 April 2024 (UTC)Reply
@The Equalizer I really propose to implement textual markers. And I don't think its implementation would be hard. Such textual markers are really helpful. Do you agree? Hooman Mallahzadeh (talk) 05:38, 13 April 2024 (UTC)Reply
Alternatively you can use the older map tools at Wikipedia:Maps for Wikipedia. If to be proposed, search Phab first as I am certain this will have been asked before, there likely may even be an open request for it. I am unsure why the powers that be chose to go with the icons only, maybe as going forward it was to be implemented as an update. The Equalizer (talk) 08:13, 13 April 2024 (UTC)Reply