Editing
Template:Location map/Creating a new map definition
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Map definition data == {{expand section|date=August 2011}} The templates utilize any one of a set of map definitions. These are not forks but rather auxiliary pages and must have names following the pattern "Module:Location map/data/''location''" or "Template:Location map ''location''", where ''location'' is the name of the area covered by the map. The template space is supported only for backward compatibility; all new map definitions should be created as modules. '''Important:''' If a new map has the same projection and boundaries as the old map (such as [[:File:Iraq location map.svg]] and [[:File:Iraq location map2.svg]]), a new definition should '''not''' be created; instead, the old definition should be used with the AlternativeMap parameter. To create a simple map definition module using an image of a map with an [[equirectangular projection]] having the equator as its standard parallel (aka plate carrée, “unprojected”, lat/lon projection): # Create a new map image and upload it to [[commons:Main Page|Wikimedia commons]] or find an existing map on the same site. # Create a module named Module:Location map/data/''location'', copy the content below into it and substitute the appropriate values. # Create a page named Module:Location map/data/''location''/doc and follow the instructions under [[#Documentation]]. As an example of a map that uses an equirectangular projection, we use [[Module:Location map/data/Belgium]]. Please do not experiment using active templates. <syntaxhighlight lang="lua">return { name = 'Belgium', top = 51.8, bottom = 49.2, left = 2.2, right = 6.9, image = 'Belgium location map.svg', image1 = 'Belgium relief location map.jpg' }</syntaxhighlight> {| class="wikitable" style="width: 50%;" ! Parameter ! Description |- | <code>name</code> | The name of the area covered |- | <code>top</code> | The latitude of the top edge of the image using [[decimal degrees]] |- | <code>bottom</code> | The latitude of the bottom edge of the image |- | <code>left</code> | longitude of the left edges of the image |- | <code>right</code> | longitude of the right edges of the image |- | <code>image</code> | The name of the image file on Commons |- | <code>image1</code> | The name of an alternate image, usually a relief map, which can be accessed using the <code>relief</code> parameter. |} Maps of this type will work for small to mid sized areas. [[Module:Location map/data/USA Alabama]] is another example of a map description that uses an equirectangular projection. Notice that the image of the country is not what most would expect. === Advanced projections === Maps that use other projections, such as [[Module:Location map/data/USA]], which uses an equidistant [[conic projection]]. require formulas which are used to calculate the <code>x</code> and <code>y</code> coordinates for the location mark. Understanding these formulas requires a familiarity with the subject, so you are more than welcome to skip this section. The input $1 is the latitude and $2 is the longitude, both in decimal form. The expression follows the syntax of [[mw:Help:Extension:ParserFunctions##expr|ParserFunction "#expr"]]. The two output coordinates are defined such that the formula for <code>x</code> evaluates to 0 for the left edge of the image and 100 for the right edge; the formula for <code>y</code> evaluates to 0 for the top edge and 100 for the bottom edge.
Summary:
Please note that all contributions to IDU Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
IDU Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
To edit this page, please answer the question that appears below (
more info
):
Who is the wiki admin
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Template
Discussion
English
Views
Read
Edit source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information