Help:Using the MultiMaps extension: Difference between revisions

From OpenGeofiction
(Importing… part 2)
m (Importing… part 3)
Line 6: Line 6:
==Map basics==
==Map basics==
A basic map can be placed by including the initial code like a template, and 6 basic attributes. A sample code might look like this: <code><nowiki>{{#multimaps: | center = 45.0,28.8 | width = 450px | height = 575px | zoom = 7 | maxzoom = 19 | minzoom = 1 }}</nowiki></code>. The following table shows you how each of these properties of the code breaks down. The sample listed is shown in the table.
A basic map can be placed by including the initial code like a template, and 6 basic attributes. A sample code might look like this: <code><nowiki>{{#multimaps: | center = 45.0,28.8 | width = 450px | height = 575px | zoom = 7 | maxzoom = 19 | minzoom = 1 }}</nowiki></code>. The following table shows you how each of these properties of the code breaks down. The sample listed is shown in the table.
{| class="wikitable"
|-
! style="background: #ccccff; width:17%" | Property
! style="background: #ccccff; width:40%" | Explanation
! style="width:43%" | Example Map
|-
| <code><nowiki>{{#multimaps:</nowiki></code>
| Like starting a template, this is the "magic word" that starts the map generation process.
| style="background-color: #ffffff" style="text-align:center" rowspan="8" | {{#multimaps: | center = 45.0,28.8 | width = 450px | height = 575px | zoom = 7 | maxzoom = 19 | minzoom = 1 }}
|-
| <code><nowiki>| center = 45.0,28.8</nowiki></code>
| This sets the center location on a map. The first number is the latitude in degrees and the second number is the longitude. The numbers are separated by a comma, can be positive or negative, and can include decimals as needed.
|-
| <code><nowiki>| width = 450px</nowiki></code>
| rowspan="2" | The width and height properties set the size of the map on the wiki page. Both are numerical values in pixels (px). The map at right has a pixel width of 480px and a height of a slightly larger 550px. The size of the map you desire changes depending on where it fits on your page.
|-
| <code><nowiki>| height = 575px</nowiki></code>
|-
| <code><nowiki>| zoom = 7</nowiki></code>
| This sets the default zoom of the map. Be careful here! The zoom is equal to what is seen on the OGF map but only within the size you defined above. Compare the image of Roantra at right with [http://opengeofiction.net/#map=7/45.151/29.355 how it appears on the map]. The zoom level is the same, but your browser size may be larger or smaller than the map you have on the wiki page.
|-
| <code><nowiki>| maxzoom = 19</nowiki></code>
| rowspan="2" | The maxzoom and minzoom properties tell the wiki map how far in or out someone can zoom on that map. The maxzoom is the furthest in the map should be able to zoom. It must be number ≤19. Minzoom is the furthest out the map should be able to zoom and must be a number ≥1. These restrictions are useful depending on how you want the map to function.
|-
| <code><nowiki>| minzoom = 1</nowiki></code>
|-
| <code><nowiki>}}</nowiki></code>
| Like templates, the two braces are needed to close out the syntax. Without it, the MultiMap will not work properly.
|-
|}
You might have noticed that on the map, there are icons in the upper corners. The upper left icons (+ and -) allow the user to zoom. The icon in the upper right allows the user to switch the style layers. Here, you can toggle between the main OSM-style map, the topographic map, and the "Histor" version. Clicking on these, however, does not change them permanently. The map generates with the OSM style by default.
'''Shortcuts for finding coordinates of a location:''' You can easily find the exact location by right clicking on the OGF map and selecting "centre map here." This feature centers the map on your location and updates the coordinates in the status bar of your browser. Be sure, however, to replace the slash with a comma if copying the location and pasting it into the multimap markup. For users that prefer JOSM, you can find the exact coordinates of a node by simply selecting it. Its coordinates appear in the selection pane on the right side of the screen.
==Adding more elements to the map==
Once a basic map is placed, it is easy to add additional elements to mark or highlight different things. Every element can be customized to some degree. A basic blue marker is the easiest to place, but it may not meet the needs of what you want to show. Often times, a combination of elements can produce a very powerful map. Elements are highly customizable and share many of the same parameters. In adding any element, please make sure the parameter syntax is completely correct, or the map will not render properly.
To place an element on the map, add the appropriate code on a new line ''before'' the two closing braces (<code><nowiki>}}</nowiki></code>) listed above. To add multiple elements, see the section below.

Revision as of 02:06, 26 August 2021

The MultiMaps extension is a powerful tool that can be used on any wiki page to highlight locations on the OGF map, tell a story through maps, or to display collaborative efforts. This page will highlight some of the ways the MultiMaps extension can be used.

About Extension:MultiMaps

The MultiMaps extension for wiki markup allows displaying dynamic maps on pages within the OGF wiki. It is a simple code structure that allows the user to define the size of the map, its level of zoom, and place dynamic elements like lines and markers. The original wiki documentation can be found on MediaWiki.

Map basics

A basic map can be placed by including the initial code like a template, and 6 basic attributes. A sample code might look like this: {{#multimaps: | center = 45.0,28.8 | width = 450px | height = 575px | zoom = 7 | maxzoom = 19 | minzoom = 1 }}. The following table shows you how each of these properties of the code breaks down. The sample listed is shown in the table.

Property Explanation Example Map
{{#multimaps: Like starting a template, this is the "magic word" that starts the map generation process.

Loading map...

| center = 45.0,28.8 This sets the center location on a map. The first number is the latitude in degrees and the second number is the longitude. The numbers are separated by a comma, can be positive or negative, and can include decimals as needed.
| width = 450px The width and height properties set the size of the map on the wiki page. Both are numerical values in pixels (px). The map at right has a pixel width of 480px and a height of a slightly larger 550px. The size of the map you desire changes depending on where it fits on your page.
| height = 575px
| zoom = 7 This sets the default zoom of the map. Be careful here! The zoom is equal to what is seen on the OGF map but only within the size you defined above. Compare the image of Roantra at right with how it appears on the map. The zoom level is the same, but your browser size may be larger or smaller than the map you have on the wiki page.
| maxzoom = 19 The maxzoom and minzoom properties tell the wiki map how far in or out someone can zoom on that map. The maxzoom is the furthest in the map should be able to zoom. It must be number ≤19. Minzoom is the furthest out the map should be able to zoom and must be a number ≥1. These restrictions are useful depending on how you want the map to function.
| minzoom = 1
}} Like templates, the two braces are needed to close out the syntax. Without it, the MultiMap will not work properly.

You might have noticed that on the map, there are icons in the upper corners. The upper left icons (+ and -) allow the user to zoom. The icon in the upper right allows the user to switch the style layers. Here, you can toggle between the main OSM-style map, the topographic map, and the "Histor" version. Clicking on these, however, does not change them permanently. The map generates with the OSM style by default.

Shortcuts for finding coordinates of a location: You can easily find the exact location by right clicking on the OGF map and selecting "centre map here." This feature centers the map on your location and updates the coordinates in the status bar of your browser. Be sure, however, to replace the slash with a comma if copying the location and pasting it into the multimap markup. For users that prefer JOSM, you can find the exact coordinates of a node by simply selecting it. Its coordinates appear in the selection pane on the right side of the screen.

Adding more elements to the map

Once a basic map is placed, it is easy to add additional elements to mark or highlight different things. Every element can be customized to some degree. A basic blue marker is the easiest to place, but it may not meet the needs of what you want to show. Often times, a combination of elements can produce a very powerful map. Elements are highly customizable and share many of the same parameters. In adding any element, please make sure the parameter syntax is completely correct, or the map will not render properly.

To place an element on the map, add the appropriate code on a new line before the two closing braces (}}) listed above. To add multiple elements, see the section below.