Changeset 18578 for extensions
- Timestamp:
- Oct 9, 2012, 9:33:42 PM (12 years ago)
- Location:
- extensions/rv_gmaps/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/rv_gmaps/trunk/changelog.txt
r18208 r18578 1 2.4.e 2 - removed earth icon from index pages 3 - map icon text localized (for themes without icons) 4 - minor javascript changes for maps api v3.9 5 - code optimization 6 1 7 2.4.d 2 8 - edit position in batch manager unit -
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 } -
extensions/rv_gmaps/trunk/main.inc.php
r18208 r18578 1 1 <?php /* 2 2 Plugin Name: RV Maps&Earth 3 Version: 2.4. d3 Version: 2.4.e 4 4 Description: Extend your gallery with Google Maps and Google Earth ... 5 5 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=122 … … 7 7 Author URI: http://www.modusoptimus.com/ 8 8 */ 9 define( 'RVM_PLUGIN_VERSION', '2.4. d');9 define( 'RVM_PLUGIN_VERSION', '2.4.e'); 10 10 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 11 11 … … 81 81 82 82 $map_url = rvm_duplicate_map_index_url( array(), array('start') ); 83 if ( !empty($map_url) ) 84 { 85 $link_title = sprintf( l10n('displays %s on a map'), strip_tags($page['title']) ); 86 $template->concat( 'PLUGIN_INDEX_ACTIONS' , "\n<li>".sprintf(RVM_ACTION_MODEL, 87 $map_url, $link_title, '', 'map', 'map' 88 ).'</li>'); 89 } 90 91 { 92 $kml_url = rvm_duplicate_kml_index_url( array(), array('start') ); 93 $link_title = sprintf( l10n('opens %s in Google Earth'), strip_tags($page['title']) ); 94 $template->concat( 'PLUGIN_INDEX_ACTIONS' , "\n<li>".sprintf(RVM_ACTION_MODEL, 95 $kml_url, $link_title, ' type="application/vnd.google-earth.kml+xml"', 'globe', 'earth' 96 ).'</li>'); 97 } 83 $link_title = sprintf( l10n('displays %s on a map'), strip_tags($page['title']) ); 84 $template->concat( 'PLUGIN_INDEX_ACTIONS' , "\n<li>".sprintf(RVM_ACTION_MODEL, 85 $map_url, $link_title, '', 'map', l10n('Map') 86 ).'</li>'); 98 87 } 99 88 … … 114 103 $link_title = sprintf( l10n('displays %s on a map'), strip_tags($pictures['current']['name']) ); 115 104 $template->concat( 'PLUGIN_PICTURE_ACTIONS' , sprintf(RVM_ACTION_MODEL, 116 $map_url, $link_title, ' target="_top"', 'map', 'map'105 $map_url, $link_title, ' target="_top"', 'map', l10n('Map') 117 106 )); 118 107 } -
extensions/rv_gmaps/trunk/map_data.php
r17468 r18578 31 31 $where_sql = rvm_bounds_to_sql( $page['box'] ); 32 32 33 $img_fields = ' i.id,i.representative_ext,i.name,i.comment,i. path,i.lat,i.lon';33 $img_fields = ' i.id,i.representative_ext,i.name,i.comment,i.file,i.path,i.lat,i.lon'; 34 34 35 35 $was_flat = @$page['flat']; … … 79 79 $out=''; 80 80 function rvo($s) { 81 global $out; $out.=$s; 81 //global $out; $out.=$s; 82 echo $s; 82 83 } 83 84 84 85 function rvf() { 85 global $out; echo $out; $out=''; 86 ob_flush(); 86 //global $out; echo $out; $out=''; ob_flush(); 87 87 } 88 88 89 89 $start_output = get_moment(); 90 90 91 rvo( '{' );92 91 93 rvo( "\ntitle:".jsgm_str( strip_tags(trigger_event('render_element_description', $page['title']) ) ) ); 94 rvo( ",\n" ); 92 rvo( "{\ntitle:".jsgm_str( strip_tags(trigger_event('render_element_description', $page['title']) ) ) ); 95 93 96 rvo( "page_url:".jsgm_str( duplicate_index_url( array('start'=>0) ) ) ); 97 rvo( ",\n" ); 94 rvo( ",\npage_url:".jsgm_str( duplicate_index_url( array('start'=>0) ) ) ); 98 95 99 rvo( "blowup_url:".jsgm_str( rvm_duplicate_blowup_url( array('start'=>0) ) ) ); 100 rvo( ",\n" ); 96 rvo( ",\nblowup_url:".jsgm_str( rvm_duplicate_blowup_url( array('start'=>0) ) ) ); 101 97 102 rvo( "kml_url:".jsgm_str( rvm_duplicate_kml_index_url( array('start'=>0, 'flat'=>1) ) ) ); 103 rvo( ",\n" ); 98 rvo( ",\nkml_url:".jsgm_str( rvm_duplicate_kml_index_url( array('start'=>0, 'flat'=>1) ) ) ); 104 99 105 rvo( "nb_items:".count($page['items']) ); 106 rvo( ",\n" ); 100 rvo( ",\nnb_items:".count($page['items']) ); 107 101 108 rvo( " bounds:" );102 rvo( ",\nbounds:" ); 109 103 if ( isset($cm) ) 110 104 rvo( jsgm_bounds( $cm->bounds ) ); 111 105 else 112 106 rvo( "null" ); 113 rvo( ",\n" );114 107 108 rvo( ",\n\nnb_clusters:".count($clusters) ); 115 109 116 rvo( "\nnb_clusters:".count($clusters) ); 117 rvo( "," ); 118 119 rvo( "\nimage_clusters:[\n" ); 110 rvo( ",\nimage_clusters:[\n" ); 120 111 $i=0; 121 112 $thumb_params = ImageStdParams::get_by_type(IMG_THUMB); 113 $page_url_model = duplicate_picture_url( 114 array( 115 'image_id' => 123456789, 116 'image_file' => 'dummy_file.txt', 117 'flat' => 1, 118 ), 119 array('start') 120 ); 121 122 122 foreach( $clusters as $c ) 123 123 { 124 124 if ($i) rvo( ",\n\n" ); 125 rvo( "{" ); 126 rvo( 'position:'. jsgm_position( bounds_center($c->bounds) ) ); 127 rvo( ",\n" ); 128 rvo( 'bounds:'. jsgm_bounds( $c->bounds ) ); 129 rvo( ",\n" ); 130 rvo( 'nb_items:'.count($c->items) ); 125 rvo( '{position:'. jsgm_position( bounds_center($c->bounds) ) ); 126 rvo( ",\nbounds:". jsgm_bounds( $c->bounds ) ); 127 rvo( ",\nnb_items:".count($c->items) ); 131 128 rvo( ",\n" ); 132 129 133 130 rvo( 'blowup_url:"'.rvm_duplicate_blowup_url(array('box'=>$c->bounds), array('start') ). '"' ); 134 rvo( ",\n" );135 131 136 132 $max_per_cluster = rvm_get_config_var('nb_images_per_marker',20); … … 139 135 $c->items = array_slice($c->items, 0, $max_per_cluster); 140 136 } 141 rvo( 'items:[');137 rvo( ",\nitems:[" ); 142 138 for ($j=0; $j<count($c->items); $j++) 143 139 { 144 140 $img = $page['items'] [ $c->items[$j] ]; 145 $img['file'] = basename( $img['path'] );146 141 147 $params = array( 148 'image_id' => $img['id'], 149 'image_file' => $img['file'], 150 'flat' => 1, 151 ); 152 $page_url = duplicate_picture_url($params, array('start') ); 142 $page_url = str_replace(array('123456789','dummy_file'), array($img['id'], get_filename_wo_extension($img['file'])), $page_url_model); 153 143 154 144 if ($j) rvo( "," ); 155 rvo( "{" ); 156 rvo( "tn:".jsgm_str( DerivativeImage::url( $thumb_params,$img ) ) ); 145 rvo( "{tn:".jsgm_str( DerivativeImage::url( $thumb_params,$img ) ) ); 157 146 rvo( ",name:".jsgm_str( render_element_name($img) ) ); 158 147 rvo( ",comment:".jsgm_str( render_element_description($img) ) ); … … 160 149 rvo( "}" ); 161 150 } 162 rvo( ']' ); 163 rvo( "\n" ); 164 rvo( "}" ); 151 rvo( "]\n}" ); 165 152 rvf(); 166 153 $i++; -
extensions/rv_gmaps/trunk/mapl.php
r16993 r18578 33 33 } 34 34 } 35 $page['meta_robots']['noindex']=1; 35 36 36 37 // deleting first "/" if displayed -
extensions/rv_gmaps/trunk/template/data_loader.js
r12719 r18578 78 78 79 79 //BEGIN BUG in maps api as of v3.7 - when map wraps horizontally more than 360 deg - the getBounds is wrong 80 var isOver = false;80 /*var isOver = false; 81 81 if (bounds.getSouthWest().lng() < bounds.getNorthEast().lng()) 82 82 { … … 102 102 103 103 if (isOver) 104 bounds = new google.maps.LatLngBounds( new google.maps.LatLng(this._map.getBounds().getSouthWest().lat(),-180), new google.maps.LatLng(this._map.getBounds().getNorthEast().lat(), 179.99) ); 104 bounds = new google.maps.LatLngBounds( new google.maps.LatLng(this._map.getBounds().getSouthWest().lat(),-180), new google.maps.LatLng(this._map.getBounds().getNorthEast().lat(), 179.99) );*/ 105 105 //END bug 106 106
Note: See TracChangeset
for help on using the changeset viewer.