public int ZoomForPixelSize ( int pixelSize ) { for ( int i = 0 ; i < 30 ; i ++ ) { if ( pixelSize > Resolution ( i ) ) { if ( i != 0 ) { return i - 1 ; } else { return 0 ; // We don't want to scale up } } } return 0 ; }
Maximal scaledown zoom of the pyramid closest to the pixelSize