Ignore:
Timestamp:
Oct 9, 2012, 9:33:42 PM (12 years ago)
Author:
rvelices
Message:

rv_gmaps:

  • removed earth icon from index pages
  • map icon text localized (for themes without icons)
  • minor javascript changes for maps api v3.9
  • code optimization
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/rv_gmaps/trunk/include/cluster_maker.php

    r12719 r18578  
    3030        function make_clusters($images, $maxLatPrecision, $maxLonPrecision, $maxNbMarkers)
    3131        {
     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
    3241                $this->_image_map = $images;
    3342                $this->_image_ranks = array();
     
    3746                $total_iterations = 0;
    3847                $total_generations = 0;
    39 
    40                 $this->bounds = array();
    41                 foreach($images as $img)
    42                         $this->bounds = bounds_add($this->bounds, $img['lat'], $img['lon'] );
    4348
    4449                $pending_split = array( new Cluster($this->bounds, array_keys($this->_image_map) ) );
     
    6873                                }
    6974                                else
    70                                         array_push( $result, $current );
     75                                        $result[] = $current;
    7176                        }
    7277                        $pending_split = $next_level_to_split;
     
    9398                                $rlat = abs($ci['lat']-$cj['lat']) / $maxLatPrecision;
    9499                                $rlon = abs($ci['lon']-$cj['lon']) / $maxLonPrecision;
    95                                 if ( $rlat<1 && $rlon<1 
     100                                if ( $rlat<1 && $rlon<1
    96101                                                && $rlat+$rlon<1.1)
    97102                                {
     
    183188                                $clusters[$idx] = new Cluster();
    184189                        }
    185                         array_push( $clusters[$idx]->items, $id );
     190                        $clusters[$idx]->items[] = $id;
    186191                        $clusters[$idx]->bounds = bounds_add( $clusters[$idx]->bounds , $lat, $lon );
    187192                }
Note: See TracChangeset for help on using the changeset viewer.