Changeset 7128
- Timestamp:
- Oct 8, 2010, 3:02:29 AM (14 years ago)
- Location:
- extensions/GMaps
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/GMaps/gmaps.css
r7125 r7128 51 51 } 52 52 53 53 #iDialogGMapNfo { 54 height:18px; 55 margin:5px 5px 0 60px; 56 text-align:left; 57 } 58 #iDialogGMapNfo span { 59 position:relative; 60 top:-3px; 61 margin-left:3px; 62 } 63 #iDialogGMapWaiting { 64 position:absolute; 65 z-index:1500; 66 background:#000000; 67 opacity:0.55; 68 filter:alpha(opacity:55); 69 } -
extensions/GMaps/gmaps2.css
r7125 r7128 118 118 } 119 119 120 #gmapsNbPhotos { 121 font-size:80%; 122 font-weight:normal; 123 margin-left:3px; 124 position:relative; 125 top:-3px; 126 } 127 #gmapsLoading { 128 background:none repeat scroll 0 0 #FFFFFF; 129 position:absolute; 130 top:0; 131 width:90%; 132 } 133 #gmapsLoading span { 134 margin-left:3px; 135 position:relative; 136 top:-3px; 137 } 120 138 139 #iDialogGMapWaiting { 140 position:absolute; 141 z-index:1500; 142 background:#000000; 143 opacity:0.55; 144 filter:alpha(opacity:55); 145 } -
extensions/GMaps/gmaps_aip.class.inc.php
r7125 r7128 53 53 $this->tabsheet->add('kml_files', 54 54 l10n('gmaps_kml_files_management'), 55 $this->getAdminLink()."&fGMaps_tabsheet=kml_files"); 55 $this->getAdminLink()."&fGMaps_tabsheet=kml_files"); */ 56 56 $this->tabsheet->add('search', 57 57 l10n('gmaps_search'), 58 58 $this->getAdminLink()."&fGMaps_tabsheet=search"); 59 $this->tabsheet->add('help',59 /* $this->tabsheet->add('help', 60 60 l10n('gmaps_help'), 61 61 $this->getAdminLink()."&fGMaps_tabsheet=help"); … … 74 74 public function initEvents() 75 75 { 76 parent::initEvents(); 77 78 if($_REQUEST['fGMaps_tabsheet']=='search') 79 { 80 // load request builder JS only on the search page 81 GPCRequestBuilder::loadJSandCSS(); 82 } 76 83 add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS')); 77 84 GPCCss::applyGpcCss(); 78 79 parent::initEvents();80 85 } 81 86 … … 254 259 global $template; 255 260 256 /*$template->set_filename('body_page', 257 dirname($this->getFileLocation()).'/admin/plugin_admin_maps.tpl'); 258 259 260 $template->assign_var_from_handle('GMAPS_BODY_PAGE', 'body_page');*/ 261 $template->set_filename('body_page', 262 dirname($this->getFileLocation()).'/admin/gmaps_search.tpl'); 263 264 $template->assign('gmaps_search_page', GPCRequestBuilder::displaySearchPage($this->getPluginName())); 265 266 $template->assign_var_from_handle('GMAPS_BODY_PAGE', 'body_page'); 261 267 } 262 268 -
extensions/GMaps/gmaps_ajax.php
r7125 r7128 72 72 73 73 $_REQUEST['ajaxfct']=='public.maps.init' or 74 $_REQUEST['ajaxfct']=='public.maps.getMarkers' or75 $_REQUEST['ajaxfct']=='public.maps.getMarkerInfos'74 $_REQUEST['ajaxfct']=='public.maps.getMarkers' //or 75 //$_REQUEST['ajaxfct']=='public.maps.getMarkerInfos' 76 76 )) $_REQUEST['ajaxfct']=''; 77 77 … … 234 234 $_REQUEST['ajaxfct']=''; 235 235 } 236 else 237 { 238 if(!isset($_REQUEST['datas']['levelInfo'])) $_REQUEST['datas']['levelInfo']=1; 239 240 if(!($_REQUEST['datas']['levelInfo']==0 or 241 $_REQUEST['datas']['levelInfo']==1)) $_REQUEST['datas']['levelInfo']=1; 242 } 236 243 } 237 244 } … … 246 253 $_REQUEST['ajaxfct']=''; 247 254 } 255 256 248 257 } 249 258 … … 787 796 * 'width' : width of maps in pixels 788 797 * 'height' : height of maps in pixels 798 * 'levelInfo' : 0 = don't return pictures info (name, url, ...) 799 * 1 = return pictures informations 789 800 * @return Array|String : a JSON string of an array of points (nbPictures, lat, lng) 790 801 */ … … 793 804 global $user, $page; 794 805 795 $returned=array(); 806 $returned=array( 807 'markers' => array(), 808 'datas' => array( 809 'nbPhotos' => 0 810 ) 811 ); 796 812 797 813 /* … … 907 923 { 908 924 $coords=array( 909 'nbIm agesTxt' => '',925 'nbImgTxt' => '', 910 926 'nbImages' => 0, 911 'lat itude' => 0,912 'l ongitude' => 0,913 'im agesTnFile' => array(),914 'im agesCatsNames' => array(),915 'im agesName' => array(),916 'im agesCatsUrl' => array(),927 'lat' => 0, // 'lat' rather than 'latitude' 928 'lng' => 0, // 'lng' rather than 'longitude' 929 'imgTn' => array(), 930 'imgCatsNames' => array(), 931 'imgName' => array(), 932 'imgCatsUrl' => array(), 917 933 ); 918 934 … … 938 954 } 939 955 956 if(count($tmpCatsId)<=1) $tmpCatsNames=''; 957 940 958 $coords['nbImages']++; 941 $coords['latitude']+=$point['latitude']; 942 $coords['longitude']+=$point['longitude']; 943 $coords['imagesTnFile'][]=$point['imageTnFile']; 944 $coords['imagesCatsNames'][]=$tmpCatsNames; 945 $coords['imagesName'][]=$point['imageName']; 946 $coords['imagesCatsUrl'][]=$tmpCatsUrl; 947 } 948 $coords['latitude']=$coords['latitude']/count($group); 949 $coords['longitude']=$coords['longitude']/count($group); 950 $coords['uniqueId']=md5($coords['latitude'].$coords['latitude']); 959 960 $coords['lat']+=$point['latitude']; 961 $coords['lng']+=$point['longitude']; 962 963 if($datas['levelInfo']==1) 964 { 965 $coords['imgTn'][]=substr($point['imageTnFile'],12); 966 $coords['imgCatsNames'][]=$tmpCatsNames; 967 $coords['imgName'][]=$point['imageName']; 968 $coords['imgCatsUrl'][]=$tmpCatsUrl; 969 } 970 } 971 $coords['lat']=$coords['lat']/count($group); 972 $coords['lng']=$coords['lng']/count($group); 973 $coords['uniqueId']=md5($coords['lat'].$coords['lng']); 951 974 952 975 if($coords['nbImages']==1) 953 976 { 954 $coords['nbIm agesTxt']=l10n('gmaps_1_picture');977 $coords['nbImgTxt']=l10n('gmaps_1_picture'); 955 978 } 956 979 else 957 980 { 958 $coords['nbImagesTxt']=sprintf(l10n('gmaps_nb_pictures'), $coords['nbImages']); 959 } 960 961 $returned[]=$coords; 962 } 981 $coords['nbImgTxt']=sprintf(l10n('gmaps_nb_pictures'), $coords['nbImages']); 982 } 983 984 985 986 $returned['markers'][]=$coords; 987 $returned['datas']['nbPhotos']+=$coords['nbImages']; 988 } 989 } 990 991 if($returned['datas']['nbPhotos']>1) 992 { 993 $returned['datas']['nbPhotos']=sprintf(l10n('gmaps_nb_pictures'), $returned['datas']['nbPhotos']); 994 } 995 else 996 { 997 $returned['datas']['nbPhotos']=l10n('gmaps_1_picture'); 963 998 } 964 999 -
extensions/GMaps/gmaps_install.class.inc.php
r7125 r7128 130 130 131 131 GPCCore::register($this->getPluginName(), GMAPS_VERSION, GMAPS_GPC_NEEDED); 132 GPCRequestBuilder::register($this->getPluginName(), dirname($this->getFileLocation()).'/gmaps_rb_callback.class.inc.php'); 132 133 return(''); 133 134 } -
extensions/GMaps/gmaps_pip.class.inc.php
r7125 r7128 209 209 lang:{ 210 210 boundmap:'".l10n('gmaps_i_boundmap')."', 211 boundkml:'".l10n('gmaps_i_boundkml')."' 211 boundkml:'".l10n('gmaps_i_boundkml')."', 212 loading:'".l10n('gmaps_loading')."' 212 213 }, 213 214 requestId:'', … … 246 247 if($this->picture['geolocated']==false) return(false); 247 248 248 if( count($this->picture['content']['MP'])>0)249 if(isset($this->picture['content']['MP']) and count($this->picture['content']['MP'])>0) 249 250 { 250 251 // there is maps in meta display mode … … 270 271 } 271 272 272 if( count($this->picture['content']['IP'])>0)273 if(isset($this->picture['content']['IP']) and count($this->picture['content']['IP'])>0) 273 274 { 274 275 // there is maps in icon display mode … … 361 362 'height' => $map['height'], 362 363 'style' => $map['style'], 363 ' mode' => $map['displayType']364 'displayType' => $map['displayType'] 364 365 ); 365 366 -
extensions/GMaps/gmaps_root.class.inc.php
r7125 r7128 276 276 } //class 277 277 278 279 280 class GMaps_functions 281 { 282 static private $tables = Array(); 283 static private $config = Array(); 284 285 /** 286 * initialise the class 287 * 288 * @param String $prefixeTable : the piwigo prefixe used on tables name 289 * @param String $pluginNameFile : the plugin name used for tables name 290 */ 291 static public function init($prefixeTable) 292 { 293 GPCCore::loadConfig(GMaps_root::$pluginNameFile, self::$config); 294 $list=GMaps_root::$pluginTables; 295 296 for($i=0;$i<count($list);$i++) 297 { 298 self::$tables[$list[$i]]=$prefixeTable.GMaps_root::$pluginNameFile.'_'.$list[$i]; 299 } 300 } 301 302 303 /** 304 * return all HTML&JS code necessary to display a dialogbox to choose 305 * geographic area 306 */ 307 static public function dialogBoxGMaps() 308 { 309 global $template; 310 311 $template->set_filename('gmaps_choose', 312 dirname(__FILE__).'/templates/gmaps_dialog_area_choose.tpl'); 313 314 $datas=Array(); 315 316 $template->assign('datas', $datas); 317 318 return($template->parse('gmaps_choose', true)); 319 } 320 321 /** 322 * convert a decimal degree to D°M'S' 323 * 324 * @param Float $value : the value to convert 325 * @return String : value converted in DMS 326 */ 327 static public function DDtoDMS($value) 328 { 329 $degrees=(int)$value; 330 $value=($value-$degrees)*60; 331 $minutes=(int)$value; 332 $seconds=($value-$minutes)*60; 333 334 return(sprintf('%d° %d\' %.2f"', $degrees, $minutes, $seconds)); 335 } 336 337 } //GMaps_functions 338 339 340 278 341 ?> -
extensions/GMaps/js/gmapsCategory.js
r7125 r7128 65 65 width:$(map.getDiv()).width(), 66 66 height:$(map.getDiv()).height(), 67 distanceTreshold:2 567 distanceTreshold:20 68 68 } 69 69 70 70 currentMapLoad=map; 71 72 $('#gmapsLoading').css('display', 'inline-block'); 73 $('#gmapsNbPhotos').html(''); 74 $('#iDialogGMapWaiting').css( 75 { 76 width:$('#iGMapsIcon').width()+'px', 77 height:$('#iGMapsIcon').height()+'px', 78 top:$('#iGMapsIcon').position().top+'px', 79 left:$('#iGMapsIcon').position().left+'px', 80 display:'block' 81 } 82 ); 71 83 72 84 $.ajax( … … 80 92 { 81 93 tmp=$.parseJSON(msg); 82 tmp.sort(compareMarkers); 83 applyMarkers(currentMapLoad, tmp); 94 tmp.markers.sort(compareMarkers); 95 applyMarkers(currentMapLoad, tmp.markers); 96 $('#gmapsLoading').css('display', 'none'); 97 $('#gmapsNbPhotos').html('['+tmp.datas.nbPhotos+']'); 98 $('#iDialogGMapWaiting').css('display', 'none'); 84 99 } 85 100 } … … 128 143 var marker = new google.maps.Marker( 129 144 { 130 position:new google.maps.LatLng(markers[i].lat itude, markers[i].longitude),145 position:new google.maps.LatLng(markers[i].lat, markers[i].lng), 131 146 map: currentMapLoad, 132 title:markers[i].nbIm agesTxt147 title:markers[i].nbImgTxt 133 148 } 134 149 ); … … 204 219 { 205 220 gmaps.currentInfo.displayed=index; 206 if(gmaps.currentInfo.im agesName[index]=='')221 if(gmaps.currentInfo.imgName[index]=='') 207 222 { 208 223 $('#ciGMIWC_title').html(' '); … … 210 225 else 211 226 { 212 $('#ciGMIWC_title').html(gmaps.currentInfo.im agesName[index]);213 } 214 $('#ciGMIWC_img').attr('src', gmaps.currentInfo.imagesTnFile[index]);227 $('#ciGMIWC_title').html(gmaps.currentInfo.imgName[index]); 228 } 229 $('#ciGMIWC_img').attr('src', './galleries/'+gmaps.currentInfo.imgTn[index]); 215 230 216 231 $('#ciGMIWC_img').unbind(); 217 if(gmaps.currentInfo.im agesCatsUrl[index].length==1)232 if(gmaps.currentInfo.imgCatsUrl[index].length==1) 218 233 { 219 234 $('#ciGMIWC_img').bind('click', 220 235 function () 221 236 { 222 window.location=gmaps.currentInfo.im agesCatsUrl[gmaps.currentInfo.displayed][0];237 window.location=gmaps.currentInfo.imgCatsUrl[gmaps.currentInfo.displayed][0]; 223 238 } 224 239 ); … … 227 242 { 228 243 $('#ciGMIWC_showcatList').html(''); 229 for(var i=0;i<gmaps.currentInfo.im agesCatsUrl[index].length;i++)244 for(var i=0;i<gmaps.currentInfo.imgCatsUrl[index].length;i++) 230 245 { 231 246 $('#ciGMIWC_showcatList') 232 .append('<li><a href="'+gmaps.currentInfo.im agesCatsUrl[index][i]+'">'+gmaps.currentInfo.imagesCatsNames[index][i]+'</a></li>');247 .append('<li><a href="'+gmaps.currentInfo.imgCatsUrl[index][i]+'">'+gmaps.currentInfo.imgCatsNames[index][i]+'</a></li>'); 233 248 } 234 249 $('#ciGMIWC_img, #ciGMIWC_showcat') … … 239 254 if(gmaps.currentInfo.nbImages>1) 240 255 { 241 $('#ciGMIWC_picnum').html((index+1)+'/'+gmaps.currentInfo.nbIm agesTxt);256 $('#ciGMIWC_picnum').html((index+1)+'/'+gmaps.currentInfo.nbImgTxt); 242 257 $('#ciWALeft, #ciWARight').css('display', 'inline-block'); 243 258 } 244 259 else 245 260 { 246 $('#ciGMIWC_picnum').html(gmaps.currentInfo.nbIm agesTxt);261 $('#ciGMIWC_picnum').html(gmaps.currentInfo.nbImgTxt); 247 262 $('#ciWALeft, #ciWARight').css('display', 'none'); 248 263 } … … 416 431 } 417 432 433 $('div.gmapsPopup div.ui-dialog-titlebar') 434 .append('<span id="gmapsLoading" style="display:none;"><img src="./plugins/GrumPluginClasses/icons/processing.gif"><span>'+gmaps.lang.loading+'</span></span>'); 435 436 $('#ui-dialog-title-iGMapsIconContent') 437 .append('<span id="gmapsNbPhotos"></span>'); 438 418 439 419 440 } -
extensions/GMaps/language/fr_FR/plugin.lang.php
r7125 r7128 121 121 $lang['gmaps_i_show_this_picture_in']="Voir cette photo dans la catégorie :"; 122 122 123 $lang['gmaps_north']="Nord"; 124 $lang['gmaps_south']="Sud"; 125 $lang['gmaps_east']="Est"; 126 $lang['gmaps_west']="Ouest"; 127 $lang['gmaps_add_geographic_area']="Ajouter une zone géographique"; 128 $lang['gmaps_choose_geographic_area']="Sélectionner la zone géographique"; 129 $lang['gmaps_search_by_geographic_area']="Effectuer une recherche par zone géographique"; 130 $lang['gmaps_geographic_coords_between']="Les coordonnées géographiques sont situées entre :"; 131 $lang['gmaps_of_lat']="de latitude"; 132 $lang['gmaps_of_lng']="de longitude"; 133 $lang['gmaps_and']="et"; 134 135 123 136 ?> -
extensions/GMaps/templates/gmaps_category.tpl
r7125 r7128 8 8 <div id='iGMapsIconContent' style='display:none;'> 9 9 <div id='iGMapsIcon' style='width:{$map.width}px;height:{$map.height}px;{$map.style}'></div> 10 <div id='iDialogGMapWaiting' style="display:none;"></div> 10 11 </div> 11 12 {/foreach} -
extensions/GMaps/templates/gmaps_picture_icon.tpl
r7125 r7128 7 7 <div id='iGMapsIconContent' style='display:none;'> 8 8 <div id='iGMapsIcon' style='width:{$map.width}px;height:{$map.height}px;{$map.style}'></div> 9 <div id='iDialogGMapWaiting' style="display:none;"></div> 9 10 </div>
Note: See TracChangeset
for help on using the changeset viewer.