Difference between revisions of "Template:Mapbox"
(One intermediate revision by the same user not shown) | |||
Line 2: | Line 2: | ||
<div style="clear:both;"> | <div style="clear:both;"> | ||
− | == Location == | + | {{#if: {{{noheader|}}} | | == Location == }} |
<div style="position:relative; width: 400px; height: 300px; overflow: hidden; background-color:#181818;"> | <div style="position:relative; width: 400px; height: 300px; overflow: hidden; background-color:#181818;"> | ||
− | <div style="border:1px solid black; background: rgb({{{color}}}); width:8px; height:8px; margin: -5px 0px 0px -5px; border-radius:10px; position:absolute; left:200px; top: 150px;"></div> | + | {{#if: {{{icon|}}} | <div style="width:20px; height:20px; margin: -10px 0px 0px -10px; position:absolute; left:200px; top: 150px;">[[File:{{{icon}}}|20px]]</div> | <div style="border:1px solid black; background: rgb({{{color}}}); width:8px; height:8px; margin: -5px 0px 0px -5px; border-radius:10px; position:absolute; left:200px; top: 150px;"></div> }} |
<div style="margin: {{#if: {{{gamey|}}} | {{#expr: ({{{gamey}}} + 4866) / 13.905 - 850 }} | {{{y}}} }}px 0px 0px {{#if: {{{gamex|}}} | {{#expr: ({{{gamex}}} + 6646) / -13.905 + 200 }} | {{{x}}} }}px; width:1000px; height:1000px;"> | <div style="margin: {{#if: {{{gamey|}}} | {{#expr: ({{{gamey}}} + 4866) / 13.905 - 850 }} | {{{y}}} }}px 0px 0px {{#if: {{{gamex|}}} | {{#expr: ({{{gamex}}} + 6646) / -13.905 + 200 }} | {{{x}}} }}px; width:1000px; height:1000px;"> | ||
[[File:Map-dark.jpg|none|1000x1000px|]] | [[File:Map-dark.jpg|none|1000x1000px|]] |
Latest revision as of 21:15, 5 June 2022
Template documentation
|
---|
Note: portions of the template sample may not be visible without values provided. |
View or edit this documentation. (About template documentation) |
Editors can experiment in this template's sandbox and test case pages. |
This template (created by Bouncer#1861) creates a location header with a map and dot or icon to indicate the location.
First we need the coordinates from the game. With some luck, the location might be in the transformer dump (provided by glitchdetector#0621): dump discord link Otherwise, use ttmap.eu
- For the ttmap, zoom in all the way, right click on location and copy the coordinates link.
The game location must be converted to coordinates on the displayed map. You can either provide the original game coordinates, or apply the formula yourself and directly enter the computed coordinates.
Contents
Using original game location
{{mapbox | gamex = 5.1 | gamey = 225.9 | icon = Blip Trucking 2.png }}
Using converted map locations
Both x and y coordinates need to converted using different formulas:
x = (x + 6646) / -13.905 + 200 y = (y + 4866) / 13.905 - 850
(you can simply use this spreadsheet for calculating)
{{mapbox | x = -296.6199209 | y = -485.3254225 | icon = Blip Trucking 2.png }}
Icons
An image icon can be provided and will be displayed at fixed dimensions. Alternatively a color can be provided as rgb to show a colored blip, e.g. color=255,125,0.
Header
In case you want to leave out the Location header, you can do that by adding|noheader=true
Location
This mapbox example uses the following parameters:
{{mapbox|x=-296.6199209|y=-485.3254225 |icon = Blip Trucking 2.png|color=255,125,0}}
See Special:WhatLinksHere/Template:Mapbox for all pages using the Mapbox template.
End of documentation