You are here

function _gmap_polyutil_zoom_levels in GMap Module 7

Same name and namespace in other branches
  1. 5 gmap_polyutil.inc \_gmap_polyutil_zoom_levels()
  2. 6.2 gmap_polyutil.inc \_gmap_polyutil_zoom_levels()
  3. 6 gmap_polyutil.inc \_gmap_polyutil_zoom_levels()
  4. 7.2 gmap_polyutil.inc \_gmap_polyutil_zoom_levels()

Build a logarithmic scale of zoom levels.

2 calls to _gmap_polyutil_zoom_levels()
gmap_polyutil_dp_encode in ./gmap_polyutil.inc
Implementation of the Douglas-Peucker polyline simplification algorithm. See: http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/algorithm.html
_gmap_polyutil_get_zoom_level in ./gmap_polyutil.inc
Place points in levels based on their "weight" -- a value derived from distance calculations in the simplification algorithm, gmap_polyutil_dp_encode().

File

./gmap_polyutil.inc, line 184
Encoded polyline utilities.

Code

function _gmap_polyutil_zoom_levels() {
  static $levels;
  if (!isset($levels)) {
    for ($i = 0; $i < GMAP_ZOOM_LEVELS; $i++) {
      $levels[$i] = GMAP_DP_EPSILON * pow(GMAP_ZOOM_FACTOR, GMAP_ZOOM_LEVELS - $i - 1);
    }
  }
  return $levels;
}