Changeset 18578 for extensions/rv_gmaps/trunk/include/cluster_maker.php
- Timestamp:
- Oct 9, 2012, 9:33:42 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/rv_gmaps/trunk/include/cluster_maker.php
r12719 r18578 30 30 function make_clusters($images, $maxLatPrecision, $maxLonPrecision, $maxNbMarkers) 31 31 { 32 $this->bounds = array(); 33 foreach($images as &$img) 34 { 35 $img['lat'] = floatval($img['lat']); 36 $img['lon'] = floatval($img['lon']); 37 $this->bounds = bounds_add($this->bounds, $img['lat'], $img['lon'] ); 38 } 39 unset($img); 40 32 41 $this->_image_map = $images; 33 42 $this->_image_ranks = array(); … … 37 46 $total_iterations = 0; 38 47 $total_generations = 0; 39 40 $this->bounds = array();41 foreach($images as $img)42 $this->bounds = bounds_add($this->bounds, $img['lat'], $img['lon'] );43 48 44 49 $pending_split = array( new Cluster($this->bounds, array_keys($this->_image_map) ) ); … … 68 73 } 69 74 else 70 array_push( $result, $current );75 $result[] = $current; 71 76 } 72 77 $pending_split = $next_level_to_split; … … 93 98 $rlat = abs($ci['lat']-$cj['lat']) / $maxLatPrecision; 94 99 $rlon = abs($ci['lon']-$cj['lon']) / $maxLonPrecision; 95 if ( $rlat<1 && $rlon<1 100 if ( $rlat<1 && $rlon<1 96 101 && $rlat+$rlon<1.1) 97 102 { … … 183 188 $clusters[$idx] = new Cluster(); 184 189 } 185 array_push( $clusters[$idx]->items, $id );190 $clusters[$idx]->items[] = $id; 186 191 $clusters[$idx]->bounds = bounds_add( $clusters[$idx]->bounds , $lat, $lon ); 187 192 }
Note: See TracChangeset
for help on using the changeset viewer.