Module talk:Mapframe

(Redirected from Template talk:Maplink)
Latest comment: 25 days ago by McBayne in topic default caption (text=map)

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.

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
@The Equalizer The Template:OSM Location map exactly implements the same idea. Thanks, Hooman Mallahzadeh (talk) 08:53, 29 July 2024 (UTC)Reply

2016 Irkutsk mass methanol poisoning

edit

Is there a way to avoid {{maplink}} appearing as a "frame within a frame" in the infobox? (This seems to be a desktop-specific issue.) Ed [talk] [OMT] 18:54, 22 August 2024 (UTC)Reply

Is the affected user using a different skin or have bespoke Wikipedia:Common.js and common.css scripts. Regards, The Equalizer (talk) 09:13, 23 August 2024 (UTC)Reply
With thanks to RoySmith, the map was fixed probably before you saw it, The Equalizer. Looks like it needed |display=inline and |plain=yes parameters to look better. :-) Ed [talk] [OMT] 18:09, 23 August 2024 (UTC)Reply
As a follow-on to that, is there any way to get maplink to use something other than a mercator projection for the base map? Because north of the arctic circle. RoySmith (talk) 15:35, 3 September 2024 (UTC)Reply
I doubt it as Mapframe uses the mw:Extension:Kartographer module and only accesses Wikimedia maps which are based on OSM as you're all too well aware I am sure, see https://wiki.openstreetmap.org/wiki/Mercator. Using Mercator has known shortcomings, and that very scenario is acknowledged at Conversation about interactive map use#Pros and Cons of interactive maps. Regs, The Equalizer (talk) 18:59, 3 September 2024 (UTC)Reply

"The JSON content is not valid GeoJSON+simplestyle." error message

edit

A new error message has been appearing where mapframe maps used to appear. The error message is "The JSON content is not valid GeoJSON+simplestyle." See this version of the Norfolk Southern–Gregson Street Overpass article, where I believe that a mapframe map used to appear. I wonder if something changed on the MediaWiki end of things, and how it might be addressed. I don't know if this is the talk page where I can find an answer, but I thought I would start here. Anyone? – Jonesey95 (talk) 12:34, 13 September 2024 (UTC)Reply

Hi there, am a bit late to the party. Looks like you've worked it out and fixed it with the revert. The error usually occurs when the |map_type parameter is removed from the infobox code, which is what happened on one of the prior edits during a cleanup. Regs, --The Equalizer (talk) 23:09, 13 September 2024 (UTC)Reply
Thanks for fixing my signature. I thought I had canceled this post entirely. Hmm, it was strange. I don't think my revert at the infobox template did anything to |map_type=. A bit of a mystery. – Jonesey95 (talk) 01:27, 14 September 2024 (UTC)Reply

JSON problem

edit

Hi. I'm trying to use "mapbox|from=Muro_da_Mauá.map" (with the surrounding double curly braces) at en:Mauá_Wall#External_links, but nothing shows up. commons:Data:Muro_da_Mauá.map seems fine (except for the zoom view, which I plan to fix later, adding bboxes). Any ideas, please? (I've exported the JSON becase relation:site is not supported yet.) Thanks! fgnievinski (talk) 02:11, 20 September 2024 (UTC)Reply

Fixed if you want to check. Regs, The Equalizer (talk) 21:30, 20 September 2024 (UTC)Reply
Many thanks! What was wrong? I tried to follow mw:Help:Extension:Kartographer/OSM#How_to_get_a_single_object_from_multiple_lines. fgnievinski (talk) 06:40, 21 September 2024 (UTC)Reply
The json had errors so needed to be rebuilt. The Commons preview tolerates them but Wikipedia doesn't. Regs, The Equalizer (talk) 16:01, 21 September 2024 (UTC)Reply
edit

Is it possible for {{mapframe}} to include a link to the OSM relation, please? Currently I use {{OSM relation}} separately. Thanks. fgnievinski (talk) 06:55, 21 September 2024 (UTC)Reply

Use the instructions on Kartographer in your earlier question, and change the type parameter for the shape on OSM to one of the four accepted, boundary is best. After some hours the Wiki maps server will copy the shape over and then you can call it using Mapframe and the Wikidata Q-number. Regs, The Equalizer (talk) 16:07, 21 September 2024 (UTC)Reply
I meant to ask in the more specific case of using a GEOJSON. The reason is I'm mapping an OSM relation of type "site", which is not currently supported by Wikimedia importer. fgnievinski (talk) 05:33, 23 September 2024 (UTC)Reply
Such as {{mapframe|frame=yes|from=Muro_da_Mauá.map}} ?
 
Map
Regs, The Equalizer (talk) 08:15, 23 September 2024 (UTC)Reply
Yes, but the external link to OSM could point to the relation https://www.openstreetmap.org/relation/17981605#map=14/-30.02738/-51.22937&layers=N instead of just the center coordinates https://www.openstreetmap.org/#map=14/-30.02738/-51.22937 fgnievinski (talk) 23:56, 23 September 2024 (UTC)Reply
The Wikidata page is the central go-to point for all related features of an article. It already has a link to the relation on OSM, which usually gets cross-linked after adding the Q number to the relation on OSM. The Commons data page should also be added there. Regs, The Equalizer (talk) 09:47, 24 September 2024 (UTC)Reply
I've now linked the geoshape in Commons to Q9046732. But when I include the parameter "id=Q9046732", mapframe complains "The JSON content is not valid GeoJSON+simplestyle." But let's consider a simpler case: a Q-item whose OSM relation is well supported at Wikipedia, such as "maplink|frame=yes|type=line|id=Q1094308". Even in that case, there's no backlink to the relation at OSM, only to the center coordinates. fgnievinski (talk) 21:37, 24 September 2024 (UTC)Reply
From External links, you can't get to the OSM relation. I think the relations are meant to be accessible but not easily, and doing so only from the Wikidata page or by performing a find for local features in OSM itself is a good compromise. But, you could request it as a new feature in Phabricator. Using the Q number will only work if |type= is one of the four supported, as the parameter is still 'site', the wall shape is therefore not available on Wiki's maps. The Commons map file is not fetched with the Q number, it's only linked. Regs, The Equalizer (talk) 01:08, 25 September 2024 (UTC)Reply

Feature label

edit

The hovering label shown when clicking on the map is taken from the current page's title. It'd be nice to be able to set it manually, especially when invoking maplink multiple times in the same page. For example:

 
Map

. Thanks! fgnievinski (talk) 21:46, 24 September 2024 (UTC)Reply

Add |title=
{{maplink|frame=yes|type=line|title=Budapest|id=Q1094308}}
 
Map
Regs, The Equalizer (talk) 01:21, 25 September 2024 (UTC)Reply
Thank you! Not sure how I missed that information already in the documentation. fgnievinski (talk) 05:35, 25 September 2024 (UTC)Reply

Can't disable map in infobox

edit

I would like to disable the map in the infobox but 'mapframe=no' does not work. The article is Leys Institute. It might just be a Wikidata thing. Traumnovelle (talk) 19:09, 30 September 2024 (UTC)Reply

Please do not ask the same question in multiple places, per WP:TALKFORK. I already explained in detail how to do this, but I understand that technical syntax is not everyone's cup of tea. I have disabled the map for you, even though I disagree with hiding the useful map in that article. – Jonesey95 (talk) 18:10, 1 October 2024 (UTC)Reply

default caption (text=map)

edit

Hello, I propose to change the default text of the caption to be empty. In my opinion "map" doesn't really say anything meaningful. It is also a hurdle for other languages using the module.--McBayne (talk) 23:51, 25 October 2024 (UTC)Reply