private void DetermineZoomIndex() { zoomIndex = 0; foreach (float lvl in zoomLevels) { if (lvl == 16) break; if (zoomTo > lvl) zoomIndex++; } }