You are here

function _gmap_polyutil_get_zoom_level in GMap Module 5

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

Place points in levels based on their "weight" -- a value derived from distance calculations in the simplification algorithm, gmap_polyutil_dp_encode().

1 call to _gmap_polyutil_get_zoom_level()
gmap_polyutil_polyline in ./gmap_polyutil.inc
Simplify a set of points and generate an "Encoded Polyline" for Google Maps.

File

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

Code

function _gmap_polyutil_get_zoom_level($weight) {
  $levels = _gmap_polyutil_zoom_levels();
  $i = 0;
  while ($levels[$i] > $weight) {
    $i++;
  }
  return GMAP_ZOOM_LEVELS - $i - 1;
}