To get rid of this ad please Sign up/Login.
Difference between revisions of "Template:Creature Spawns Map/EntropiaPlanets Forums"
m |
m |
||
Line 1: | Line 1: | ||
<div style="position:absolute; left:{{#expr: ({{{?Longitude|}}} - 8200)/30 -14}}px; bottom:{{#expr: ({{{?Latitude|}}} -8200)/30}}px; width:200px; vertical-align:middle; border:1px solid green;"> | <div style="position:absolute; left:{{#expr: ({{{?Longitude|}}} - 8200)/30 -14}}px; bottom:{{#expr: ({{{?Latitude|}}} -8200)/30 -20}}px; width:200px; vertical-align:middle; border:1px solid green;"> | ||
<table> | <table> | ||
<tr> | <tr> | ||
Line 14: | Line 14: | ||
</div> | </div> | ||
<!-- This is a comment explaining a few numbers | <!-- This is a comment explaining a few numbers | ||
left:{{#expr: ({{{?Longitude|}}} - 8200)/30 -6}}px; is defining the start of the div from the left border of the map. 8200 is the about the offset of the map, meaning the left border of the map represent 8200 longitude. {{{?Longitude|}}} - 8200) is divided by 30 because the map image has width:800px and is showing 3 server areas of 8000m each respectively 24000m total, so factor 30 consists of 2 subfactors: factor 10 representing the relation of a server area width (8000) to the with of the map image (800); and factor 3 which is the number of server areas on the map image (in horizontal of course). Latitude is working accordingly. Using left: and bottom: results in the bottom left corner of the div is actually representing the location. Therefore Longitude has another offset of 14px (half width of the marker image) and to align | left:{{#expr: ({{{?Longitude|}}} - 8200)/30 -6}}px; is defining the start of the div from the left border of the map. 8200 is the about the offset of the map, meaning the left border of the map represent 8200 longitude. {{{?Longitude|}}} - 8200) is divided by 30 because the map image has width:800px and is showing 3 server areas of 8000m each respectively 24000m total, so factor 30 consists of 2 subfactors: factor 10 representing the relation of a server area width (8000) to the with of the map image (800); and factor 3 which is the number of server areas on the map image (in horizontal of course). Latitude is working accordingly. Using left: and bottom: results in the bottom left corner of the div is actually representing the location. Therefore Longitude has another offset of -14px (half width of the marker image) and Latitude another offset of -20px (approxiamtely half the total height of the div) to align the center of the map marker to the actual location. --> |