ਫਰਮਾ:Location map/Creating a new map definition
This guides explains how to create map definitions for the {{Location map}} family of templates. Map definition data
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):
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. 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'
}
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 projectionsMaps 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 The input $1 is the latitude and $2 is the longitude, both in decimal form. The expression follows the syntax of ParserFunction "#expr". The two output coordinates are defined such that the formula for DocumentationIt is easiest to use the de facto template at Module:Location map/data/doc to generate the documentation page. Here is another example of what the documentation might look like: <!-- Categories and interwikis go at the bottom of this page. --> {{Module:Location map/data/doc|image=[[File:Belgium-CIA WFB Map.png|thumb|250px|Map of Belgium]] |examples= === Location map, using default map (image) === {{Location map | Belgium | width = 200 | lat_deg = 50.85 | lon_deg = 4.35 | label = Brussels }} <pre style="width:30em"> {{Location map | Belgium | width = 200 | lat_deg = 50.85 | lon_deg = 4.35 | label = Brussels }} </pre> {{clear}} === Location map many, using relief map (image1) === {{Location map many | Belgium | relief = yes | width = 200 | caption = Two locations in Belgium | lat1_deg = 50.85 | lon1_deg = 4.35 | label1 = Brussels | lat2_deg = 51.22 | lon2_deg = 4.40 | label2 = Antwerp }} <pre style="width:30em"> {{Location map many | Belgium | relief = yes | width = 200 | caption = Two locations in Belgium | lat1_deg = 50.85 | lon1_deg = 4.35 | label1 = Brussels | lat2_deg = 51.22 | lon2_deg = 4.40 | label2 = Antwerp }} </pre> {{clear}} === Location map+, using AlternativeMap === {{Location map+ | Belgium | AlternativeMap = Belgium relief location map.jpg | width = 200 | caption = Two locations in Belgium | places = {{Location map~ | Belgium | lat_deg = 50.85 | lon_deg = 4.35 | label = Brussels }} {{Location map~ | Belgium | lat_deg = 51.22 | lon_deg = 4.40 | label = Antwerp }} }} <pre style="width:35em"> {{Location map+ | Belgium | AlternativeMap = Belgium relief location map.jpg | width = 200 | caption = Two locations in Belgium | places = {{Location map~ | Belgium | lat_deg = 50.85 | lon_deg = 4.35 | label = Brussels }} {{Location map~ | Belgium | lat_deg = 51.22 | lon_deg = 4.40 | label = Antwerp }} }} </pre> }} <includeonly> <!-- Categories go here, and interwikis go on Wikidata: --> [[Category:Belgium location map templates|Belgium location map templates]] </includeonly> The following parameters are taken by Module:Location map/data/doc:
All information about the map will be automatically taken from the map's definition itself. |
Portal di Ensiklopedia Dunia