User Tools

Site Tools


projects:voyc:zoom_level

This is an old revision of the document!


Table of Contents

Projects:voyc

Zoom Level

level pow2 scale
0 1
1 2

number of tiles

Scale

Scale is a ratio of distances on the map to distances on the earth's surface.

  • A scale of 1:100 means 1 cm on the map represents 1 meter on the earth.
  • A scale of 1:100,000 means 1 cm on the map represents 1 km on the earth
  • A scale of 1:80,000,000 allows us to display the earth as a 10 cm globe on screen.

k

The radius of the earth in pixels.

Zoom Level

At level 0, the entire earth is displayed in one tile. At level 1, the width and height are both doubled, meaning 4 tiles are required. At level 2, width and height are both doubled again, requiring 16 tiles.

k

At zoom level 0, if the browser window is 900 pixels square, and k is 450, the globe will exactly fit in the window.

The mercator projection is how much larger than the orthographic?

Orthographic Diameter of the globe is 500 pixels. Radius = k = 250

Mercator radius = k * PI/2 = 392.5 width = height = 845 pixels

Resize

on window resize

Google keep center and scale constant field of view falls where it may

Voyc keep center and field of view constant scale slides along with halfwid

We start with the window size. Do we really?

What does the user expect when he changes the size of his window?

User can change the size of his window. Do we change our scale map so that

Ways of representing scale scale k zoom level

ratio 1/cm on the map : how many cm on the earth's surface

k - number of pixels to display the radius of the globe

w - width h - height at zoom level 0

      // scale = number of pixels to display the radius of the globe
      var halfwid = Math.round(Math.min(w, h) / 2)
      this.scale = {}
      this.scale.min = halfwid * voyc.defaultScale.minScaleFactor   // small number, zoomed out
      var maxscale = voyc.geosketch.options.maxscale || voyc.defaultScale.maxScaleFactor
      this.scale.max = halfwid * maxscale                           // large number, zoomed in
      this.scale.factor = scalefactor
      this.scale.now = Math.round(halfwid * scalefactor)

halfwid - the smaller of width or height, divided by 2

scale

min = halfwid * minfactor
max = halfwid * maxfactor
now = halfwid * scalefactor        

factor

min
max
factor
      

voyc.defaultScale = {

      minScaleFactor: .5,  // small number, zoomed out
      maxScaleFactor: 6,   // large number, zoomed in
      scaleStepPct: .14,
      spinStep: 6,

}

level pow2 scale
0 1
1 2

6371 km earth radius 12742 km earth diameter 1274200000 cm earth diameter 1:591657528 2.15 earth diameter displayed in 2.15 cm

projects/voyc/zoom_level.1676305744.txt.gz · Last modified: 2023/02/13 11:29 by jhagstrand

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki