Topic on Help talk:Extension:Kartographer

Pass template parameters to maplink and mapframe?

5
Geraki (talkcontribs)

It seems that<mapframe width="300" height="300" zoom="12" latitude="{{{lat|0}}}" longitude="{{{long|0}}}" text="{{{text|}}}" /> is not possible.

Allowing template parameters in maplink and mapframe parameters and json content will make it easier for editors to include them in templates.

Using Module:Mapframe is creating complexity with many nested templates, not really liked in many small projects as it reduces the bus factor.

Atsirlin (talkcontribs)

Use {{#tag:maplink and a list of parameters, each preceded by | (and without quotation marks). Example here. --Atsirlin (talk) 07:20, 7 May 2018 (UTC)

Geraki (talkcontribs)

Thanks

Matroc (talkcontribs)

This method above does work well. To go another step further I use the {{#tag:mapframe or {{#tag:maplink in a single template that calls a Module with list of parameters - the template applies default values for this Module and the Module provides some checking and other defaults returning code needed for a Mapframe or Maplink. This particular module can also draw different shapes (such as circles, pointers, arrows, triangles, stars etc.) and place them on a map. The parameters allow for the user to be able to provide many of the arguments such as line thickness - color - maki icon names for points etc. for Kartographer. One can find a Wikidata ID and an article exists in the wiki you are working on that has the inormation you are looking for - that particular ID can be looked up and used as well. Best wishes...

Geraki (talkcontribs)

OK, I tried but I failed: how do I pass json data to the tag?

User:Geraki/Sandbox

I think I did what I saw in the modules.

Reply to "Pass template parameters to maplink and mapframe?"