eckhchri / pcars-ds-liveview

Provides a html page for project cars dedicated server and display a map of the current race.
14 stars 1 forks source link

Adapt google map zoom level to display resolution #31

Open viper4gh opened 9 years ago

viper4gh commented 9 years ago

First step is to determine the base zoom level of all tracks for one resolution, for example 1920x1080. Then you can adapt the zoom level to a differing resolution.

I think there is a mapping between different resolutions and zoom levels necessary.

The resolutions can determined with the following function.

http://wiki.selfhtml.org/wiki/JavaScript/Objekte/window/innerWidth

function Auswerten() { var w1 = window.innerWidth; var h1 = window.innerHeight; document.getElementById("innerX").innerHTML = w1; document.getElementById("innerY").innerHTML = h1;

var w2 = window.outerWidth;
var h2 = window.outerHeight;
document.getElementById("outerX").innerHTML = w2;
document.getElementById("outerY").innerHTML = h2;

}