Template:Location map/Creating a new map definition
Creating new map definition templates
![]() | This section needs expansion. You can help by adding to it. (August 2011) |
- Create a new map image and upload it to Wikimedia commons or find an existing map on the same site.
- Create a template named Template:Location map location, copy the content of a similar map template into it, then enter the appropriate values.
Each of the map definition templates named as "Location map XX" (such as {{Location map Africa}}) contains the name of one or more map image files, the name of the area covered and other data depending on the type of image used.
Maps that use an equirectangular projection need only the latitude of the top and bottom edges of the image, and longitude of the right and left edges of the image. {{Location map USA}} is a good example. Notice that the image does not look like maps most would expect. This is less notifiable for smaller areas. See {{Location map France}}.
Maps that use other projections, such as {{Location map USA2}}, require formulas which are used to calculate the position 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.
Some map definition templates treat latitude/longitude as straight lines (Mercator projections), whereas other map definitions have skew factors for maps with curved lines. Hence, each of those templates is not a "fork" of {{Location map}} but instead, they are accessor functions which access the map-border coordinates or skew-factors as shared data, rather than being repeated data in each article using {{Location map Italy}}. If changing to a map-image of Italy with different border coordinates, then only that one map definition template need be changed, and only those Italy-related articles will be reformatted. The total of 190,000+ articles using {{Location map}} will NOT be reformatted when someone updates a particular "Location map XX" and so the impact on the Wikipedia servers is reduced.