Changeset 12706 for extensions/rv_gmaps
- Timestamp:
- Dec 8, 2011, 10:36:35 PM (13 years ago)
- Location:
- extensions/rv_gmaps/trunk
- Files:
-
- 8 added
- 3 deleted
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/rv_gmaps/trunk/admin/admin_config.php
r12701 r12706 63 63 ); 64 64 65 $files = array(); 65 66 $path=PHPWG_PLUGINS_PATH.$rvm_dir.'/template/markers/'; 66 67 $dir_contents = opendir($path); … … 69 70 if (!is_file($path.'/'.$filename) or get_extension($filename)!='tpl') 70 71 continue; 71 $filename = get_filename_wo_extension( $filename ); 72 $template->append('marker_icons', 72 $files[] = get_filename_wo_extension($filename); 73 } 74 closedir($dir_contents); 75 76 sort($files); 77 foreach($files as $file) 78 { 79 $template->append('marker_icons', 73 80 array( 74 $file name => str_replace( '_', ' ', $filename),81 $file => str_replace( '_', ' ', $file), 75 82 ), 76 83 true … … 79 86 $template->assign('selected_marker_icon', rvm_get_config_var('marker_icon', '') ); 80 87 81 closedir($dir_contents); 88 82 89 ?> -
extensions/rv_gmaps/trunk/changelog.txt
r12367 r12706 1 2.3.b 2 - search for places / location uses now google auto complete 3 - fix some bad markers not showing (google removed some images from their servers) 4 - added some new marker icons 5 - full migration to maps api v3 6 1 7 2.3.a 2 8 - fix jquery version -
extensions/rv_gmaps/trunk/language/ar_SA/lang.php
r8691 r12706 13 13 $lang['Show all']='اظهار الكل'; 14 14 $lang['show all pictures around this location']='اظهر كل الصور المحيطة بهذه'; 15 $lang['Search a location...']='البحث عن منطقة...';16 15 17 16 $lang['Loading']='تحميل'; -
extensions/rv_gmaps/trunk/language/cs_CZ/lang.php
r8724 r12706 13 13 $lang['Show all']='Zobrazit vše'; 14 14 $lang['show all photos around this location']='zobrazit fotografie v okolí'; 15 $lang['Search a location...']='Najít polohu...';16 15 17 16 $lang['Loading']='Nahrávání'; -
extensions/rv_gmaps/trunk/language/de_DE/lang.php
r8724 r12706 13 13 $lang['Show all']='Zeigt Alle'; 14 14 $lang['show all photos around this location']='zeigt alle Bilder rund um dieser Position'; 15 $lang['Search a location...']='Suche eine Position...';16 15 17 16 $lang['Loading']='lädt'; -
extensions/rv_gmaps/trunk/language/en_UK/lang.php
r8724 r12706 13 13 $lang['Show all']='Show all'; 14 14 $lang['show all photos around this location']='show all photos around this location'; 15 $lang['Search a location...']='Search a location...';16 15 17 16 $lang['Loading']='Loading'; -
extensions/rv_gmaps/trunk/language/es_ES/lang.php
r8724 r12706 13 13 $lang['Show all']='Presenta todo'; 14 14 $lang['show all photos around this location']='Presenta todas las imágenes cerca de estas coordenadas'; 15 $lang['Search a location...']='Buscar un lugar...';16 15 17 16 $lang['Loading']='Carga'; -
extensions/rv_gmaps/trunk/language/fr_FR/lang.php
r8724 r12706 13 13 $lang['Show all']='Présente tout'; 14 14 $lang['show all photos around this location']='Présente toutes les images à proximité de ces coordonnées'; 15 $lang['Search a location...']='Rechercher un lieu...';16 15 17 16 $lang['Loading']='Chargement'; -
extensions/rv_gmaps/trunk/language/hu_HU/lang.php
r8724 r12706 13 13 $lang['Show all']='Összes megjelenítése'; 14 14 $lang['show all photos around this location']='Összes kép mellé ezeket a koordinátákat'; 15 $lang['Search a location...']='Hely keresése...';16 15 17 16 $lang['Loading']='Töltés'; -
extensions/rv_gmaps/trunk/language/it_IT/lang.php
r8724 r12706 13 13 $lang['Show all']='Presenta tutto'; 14 14 $lang['show all photos around this location']='Presenta tutte le immagini in prossimità di queste coordinate'; 15 $lang['Search a location...']='Cecare un luogo...';16 15 17 16 $lang['Loading']='Caricamento'; -
extensions/rv_gmaps/trunk/language/lv_LV/lang.php
r8724 r12706 13 13 $lang['Show all']='Rādīt visu'; 14 14 $lang['show all photos around this location']='rādīt visus attēlus ap šo (vietu) lokāciju'; 15 $lang['Search a location...']='Meklēt lokāciju...';16 15 17 16 $lang['Loading']='Lādēšana'; -
extensions/rv_gmaps/trunk/language/nl_NL/lang.php
r11406 r12706 13 13 $lang['Show all']='Toon alles'; 14 14 $lang['show all photos around this location']='toon alle afbeeldingen in de buurt van deze locatie'; 15 $lang['Search a location...']='Zoek een locatie...';16 15 17 16 $lang['Loading']='Laden'; -
extensions/rv_gmaps/trunk/language/no_NO/lang.php
r9006 r12706 13 13 $lang['Show all']='Vis alle'; 14 14 $lang['show all photos around this location']='vis alle bilder rundt denne lokalisasjonen'; 15 $lang['Search a location...']='Søk på en lokalisasjon...';16 15 17 16 $lang['Loading']='Laster'; -
extensions/rv_gmaps/trunk/language/pl_PL/lang.php
r8724 r12706 14 14 $lang['Show all']='Pokaż wszystko'; 15 15 $lang['show all photos around this location']='pokaż wszystkie obrazy w pobliżu tej lokalizacji'; 16 $lang['Search a location...']='Szukaj lokalizacji...';17 16 18 17 $lang['Loading']='Wczytywanie'; -
extensions/rv_gmaps/trunk/language/ru_RU/lang.php
r9083 r12706 13 13 $lang['Show all']='Показать все'; 14 14 $lang['show all photos around this location']='Показать все фотографии вблизи от этой точки'; 15 $lang['Search a location...']='Поиск места...';16 15 17 16 $lang['Loading']='Загрузка'; -
extensions/rv_gmaps/trunk/language/sk_SK/lang.php
r9480 r12706 13 13 $lang['Show all']='Zobraziť všetko'; 14 14 $lang['show all pictures around this location']='zobraziť fotografie v okolí'; 15 $lang['Search a location...']='Nájsť polohu...';16 15 17 16 $lang['Loading']='Nahrávanie'; -
extensions/rv_gmaps/trunk/main.inc.php
r12701 r12706 1 1 <?php /* 2 2 Plugin Name: RV Maps&Earth 3 Version: 2.3.b -alpha3 Version: 2.3.b 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.3.b -alpha');9 define( 'RVM_PLUGIN_VERSION', '2.3.b'); 10 10 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 11 11 -
extensions/rv_gmaps/trunk/map_data.php
r12698 r12706 132 132 rvo( ",\n" ); 133 133 134 rvo( 'kml_url: "'.rvm_duplicate_kml_index_url(array('box'=>$c['bounds'], 'flat'=>1), array('start') ). '"' );135 rvo( ",\n" );136 137 134 $max_per_cluster = rvm_get_config_var('nb_images_per_marker',20); 138 135 if ( count($c['items']) > $max_per_cluster ) … … 160 157 rvo( "{" ); 161 158 rvo( "tn: ".jsgm_str( get_thumbnail_url( $img ) ) ); 162 rvo( "," ); 163 rvo( "name: ".jsgm_str( trigger_event('render_element_description', $title) ) ); 164 rvo( "," ); 165 rvo( "comment: ".jsgm_str( trigger_event('render_element_description', $img['comment']) ) ); 166 rvo( "," ); 167 rvo( "page_url: ".jsgm_str( $page_url ) ); 159 rvo( ",name: ".jsgm_str( trigger_event('render_element_description', $title) ) ); 160 rvo( ",comment: ".jsgm_str( trigger_event('render_element_description', $img['comment']) ) ); 161 rvo( ",page_url: ".jsgm_str( $page_url ) ); 168 162 rvo( "}" ); 169 163 } -
extensions/rv_gmaps/trunk/template/data_handler.js
r12701 r12706 12 12 13 13 google.maps.event.bind( this._map, "click", this, this._onMapClick); 14 //google.maps.event.bind( this._infoWindow, "domready", this, this._onInfoWindowDomReady);15 14 } 16 15 … … 23 22 _navHtmlIds: ["gotoPrevImage", "gotoNextImage"], 24 23 _navHtmlHandles: [], 25 _recursionProtect: 0,26 24 _prevResult: { nb_items:0 }, 27 25 … … 70 68 if (changed) 71 69 { 72 var newMarkers = []; 70 // BEGIN NEW **************** 71 var markersToRemove=[], clustersToAdd=[], newMarkers=[]; 72 data.image_clusters.sort( function(a,b) { return PwgDataHandler.cmpll( a.position, b.position); } ); 73 for (i=0; i<data.image_clusters.length; i++) 74 { 75 var cluster = data.image_clusters[i]; 76 while(this._markers.length) 77 { 78 var marker = this._markers[0]; 79 if (PwgDataHandler.cmpll(cluster.position, marker.getPosition()) == 0) 80 { 81 marker.pwg = { 82 nb_items: cluster.nb_items, 83 images: cluster.items, 84 bounds: cluster.bounds, 85 blowup_url: cluster.blowup_url 86 }; 87 newMarkers.push(marker); 88 this._markers.shift(); 89 cluster = null; 90 break; 91 } 92 else if (PwgDataHandler.cmpll(cluster.position, marker.getPosition()) < 0) 93 { 94 break; 95 } 96 else 97 { 98 markersToRemove.push(marker); 99 this._markers.shift(); 100 } 101 } 102 103 if (cluster) 104 clustersToAdd.push(cluster); 105 } 106 107 if (document.is_debug) glog('reused ' + newMarkers.length + ' exact markers'); 108 markersToRemove = markersToRemove.concat( this._markers ); 109 110 var infoWindowMarker = this._infoWindow.getAnchor(); 111 for (i=0; i<clustersToAdd.length; i++) 112 { 113 var cluster = clustersToAdd[i]; 114 var theTitle = ""; 115 if (cluster.nb_items>1) 116 theTitle = Localization.fmt1("%d photos", cluster.nb_items); 117 else 118 theTitle = cluster.items[0].name; 119 120 var marker = markersToRemove.pop(); 121 if (marker && marker==infoWindowMarker) 122 { 123 marker.setMap(null); 124 google.maps.event.clearInstanceListeners(marker); 125 if (document.is_debug) glog('removed marker with infoWindow'); 126 marker = this._markers.pop(); 127 } 128 129 if (!marker) 130 { 131 marker = new google.maps.Marker(this.options.markerOptions); 132 marker.setPosition(cluster.position); 133 marker.setTitle(theTitle); 134 google.maps.event.addListener( marker, "click", pwgBind(this, this._onMarkerClick, marker) ); 135 google.maps.event.addListener( marker, "dblclick", pwgBind(this, this._onMarkerDblClick, marker) ); 136 marker.setMap(this._map); 137 } 138 else 139 { 140 marker.currentImageIndex=0; 141 marker.setPosition( cluster.position ); 142 marker.setTitle(theTitle); 143 } 144 145 newMarkers.push(marker); 146 147 marker.pwg = { 148 nb_items: cluster.nb_items, 149 images: cluster.items, 150 bounds: cluster.bounds, 151 blowup_url: cluster.blowup_url 152 }; 153 } 154 155 for (i=0; i<markersToRemove.length; i++) 156 { 157 markersToRemove[i].setMap(null); 158 google.maps.event.clearInstanceListeners(markersToRemove[i]); 159 } 160 161 this._markers = newMarkers; 162 this._markers.sort( function(a,b) { return PwgDataHandler.cmpll( a.getPosition(), b.getPosition()); } ); 163 // END new 164 165 /* var newMarkers = []; 73 166 var infoWindowMarker = this._infoWindow.getAnchor(); 74 167 … … 123 216 google.maps.event.clearInstanceListeners(this._markers[i]); 124 217 } 125 218 */ 126 219 this._markers = newMarkers; 127 220 this._prevResult.nb_items=data.nb_items; … … 207 300 _onInfoWindowDomReady: function() 208 301 { 209 if (this._recursionProtect)210 return;211 302 if (!this._infoWindow.getAnchor() || this._infoWindow.getAnchor().pwg.images.length<2) 212 303 return; 213 try { 214 this._recursionProtect = 1; 215 for (var i=0; i< this._navHtmlIds.length; i++) 216 { 217 var elt = document.getElementById( this._navHtmlIds[i] ); 218 if (elt) 219 this._navHtmlHandles.push( google.maps.event.addDomListener(elt, "click", pwgBind(this, this._onPictureNavigate, this._infoWindow.getAnchor(), i) ) ); 220 } 221 } 222 finally { 223 this._recursionProtect = 0; 304 for (var i=0; i< this._navHtmlIds.length; i++) 305 { 306 var elt = document.getElementById( this._navHtmlIds[i] ); 307 if (elt) 308 this._navHtmlHandles.push( google.maps.event.addDomListener(elt, "click", pwgBind(this, this._onPictureNavigate, this._infoWindow.getAnchor(), i) ) ); 224 309 } 225 310 }, … … 267 352 } 268 353 354 PwgDataHandler.cmpll = function(a,b) { 355 var d= a.lng() - b.lng(); 356 if (d < -.5e-6) 357 return -1; 358 else if (d > .5e-6) 359 return 1; 360 d= a.lat() - b.lat(); 361 if (d < -.5e-6) 362 return -1; 363 else if (d > .5e-6) 364 return 1; 365 return 0; 366 } 269 367 270 368 String.prototype.urlNoHtm = function() -
extensions/rv_gmaps/trunk/template/data_loader.js
r12701 r12706 77 77 var bounds = new google.maps.LatLngBounds( this._map.getBounds().getSouthWest(), this._map.getBounds().getNorthEast() ); 78 78 79 // bug as of v 3.7 -79 //BEGIN BUG in maps api as of v3.7 - when map wraps horizontally more than 360 deg - the getBounds is wrong 80 80 var isOver = false; 81 81 if (bounds.getSouthWest().lng() < bounds.getNorthEast().lng()) … … 90 90 isOver = true; 91 91 } 92 if (!isOver) 93 {//very emprical tests 94 if (this._map.getDiv().offsetWidth / this._map.getDiv().offsetHeight > 1.3 95 && this._map.getZoom()<3 96 && bounds.getSouthWest().lat() < -50 97 && bounds.getNorthEast().lat() > 50) 98 { 99 isOver = true; 100 } 101 } 92 102 93 103 if (isOver) 94 104 bounds = new google.maps.LatLngBounds( new google.maps.LatLng(this._map.getBounds().getSouthWest().lat(),-179.9), new google.maps.LatLng(this._map.getBounds().getNorthEast().lat(), 179.9) ); 95 // endbug105 //END bug 96 106 97 107 … … 117 127 /*if ( !bounds.isFullLat() )*/ 118 128 { 119 nd = latRange* 12/100;120 sd = latRange* 4/100;129 nd = latRange*0.12; 130 sd = latRange*0.04; 121 131 } 122 132 /*if ( !bounds.isFullLng() )*/ 123 133 { 124 ed = lonRange* 9/100;125 wd = lonRange* 7/100;134 ed = lonRange*0.09; 135 wd = lonRange*0.07; 126 136 } 127 137 var digits = Math.max( getLatLonDigits(latRange,4,2), getLatLonDigits(lonRange,4,2) ); -
extensions/rv_gmaps/trunk/template/map.tpl
r12701 r12706 7 7 <title>{$GALLERY_TITLE}</title> 8 8 9 <script src="http://maps.googleapis.com/maps/api/js?sensor=false&language={$lang_info.code} " type="text/javascript"></script>9 <script src="http://maps.googleapis.com/maps/api/js?sensor=false&language={$lang_info.code}&libraries=places" type="text/javascript"></script> 10 10 11 11 {combine_script id='jquery' load='header' path='http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js'} … … 51 51 if (console) 52 52 { 53 console.log(msg + " b="+map.getBounds().toUrlValue() + " c="+map.getCenter().toUrlValue() + " z="+map.getZoom() ); 53 var b = map.getBounds(); 54 if (b) 55 console.log(msg + " b="+b.toUrlValue() + " c="+map.getCenter().toUrlValue() + " z="+map.getZoom() ); 56 else 57 console.log(msg); 54 58 } 55 59 } … … 111 115 112 116 map.pwgDataLoader.start( "{/literal}{$U_MAP_DATA}{literal}" ); 117 118 var ac = new google.maps.places.Autocomplete( document.getElementById('q') ); 119 ac.bindTo('bounds', map); 120 google.maps.event.addListener(ac, 'place_changed', function() { 121 var place = ac.getPlace(); 122 if (place.geometry.viewport) { 123 map.fitBounds(place.geometry.viewport); 124 } else { 125 map.setCenter(place.geometry.location); 126 map.setZoom(17); // Why 17? Because it looks good. 127 } 128 } ); 113 129 } 114 130 … … 198 214 </a> 199 215 <span class="gmnoprint"> 200 <form action="#" onsubmit="if (this.q.value!='' && this.q.value!='{'Search a location...'|@translate|@escape:javascript}') searchLocation(this.q.value);return false;"> 201 <input type="text" size="32" name="q" 202 value="{'Search a location...'|@translate}" 203 onfocus="if (value=='{'Search a location...'|@translate|@escape:javascript}') value='';" 204 onblur="if (value=='') value='{'Search a location...'|@translate|@escape:javascript}'" /> 205 <input type="submit" value="{'Search'|@translate}"/> 206 </form> 216 <input type="text" size="48" id="q" /> 207 217 </span> 208 218 </div> -
extensions/rv_gmaps/trunk/template/picture_map_content.tpl
r10082 r12706 1 1 2 2 {html_head} 3 <script src="http://maps.google .com/maps/api/js?sensor=false&hl={$lang_info.code}" type="text/javascript"></script>3 <script src="http://maps.google<script src="http://maps.googleapis.com/maps/api/js?sensor=false&language={$lang_info.code}" type="text/javascript"></script> 4 4 {combine_script id='jquery' load='header' path='themes/default/js/jquery.min.js'} 5 5 {combine_script id='jquery.nyroModal' load='async' path="`$PLUGIN_LOCATION`/template/nyroModal/jquery.nyroModal-1.6.2.js" version='1.6.2'} -
extensions/rv_gmaps/trunk/template/style.css
r3447 r12706 49 49 } 50 50 51 #titlebar FORM { 52 display:inline; 53 margin:0; 54 } 55 56 #titlebar FORM INPUT { 51 #titlebar INPUT { 57 52 border: 1px solid gray; 58 53 font-size:80%; 59 }60 61 #titlebar FORM INPUT {62 54 color: #404040; 63 55 background-color: #dddddd; 64 56 } 65 57 66 #titlebar FORM INPUT:focus { 58 59 #titlebar INPUT:focus { 67 60 color: black; 68 61 background-color: #ffffff;
Note: See TracChangeset
for help on using the changeset viewer.