Template:Location map/Creating a new map definition
Understanding map definitions
![]() | This section needs expansion. You can help by adding to it. (August 2011) |
The {{Location map}} family of templates utilize map definitions from two sources. The primary source is Module:Location map/data and new maps should be added here. In addition, map definition templates may be used. These are not forks but rather auxiliary templates and must have names such as "Location map location", where location is the name of the area covered by the map. To create a simple map definition using an image of a map with an equirectangular Mercator projection:
- Create a new map image and upload it to Wikimedia commons or find an existing map on the same site.
- Edit Module:Location map/data, copy the content below into the appropriate point of it and substitute the appropriate values.
As an example of a map that uses an equirectangular projection, we use Belgium. Please do not experiment using active definitions.
['Belgium'] = { 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' },
Parameter | Description |
---|---|
name
|
The name of the area covered |
top
|
The latitude of the top edge of the image using decimal degrees |
bottom
|
The latitude of the bottom edge of the image |
left
|
longitude of the left edges of the image |
right
|
longitude of the right edges of the image |
image
|
The name of the image file on Commons |
image1
|
The name of an alternate image, usually a relief map, which can be accessed using the relief parameter.
|
Maps of this type work will for small to mid sized areas. {{Location map USA Alabama}} is another example of a map description template that uses an equirectangular projection. Notice that the image of the country is not what most would expect.
Maps that use other projections, such as USA, which uses an equidistant conic projection. require formulas which are used to calculate the x
and y
coordinates for the location mark. Understanding these formulas requires a familiarity with the subject and is currently beyond the scope of this discussion. Note that the formula for x
evaluates to 0 for the left edge of the image and 100 for the right edge. Likewise, the formula for y
evaluates to 0 for the top edge and 100 for the bottom edge.