Changeset 12701 for extensions/rv_gmaps
- Timestamp:
- Dec 7, 2011, 10:48:16 PM (12 years ago)
- Location:
- extensions/rv_gmaps/trunk
- Files:
-
- 1 added
- 4 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/rv_gmaps/trunk/admin/admin_config.php
r12700 r12701 1 1 <?php 2 if (!defined('PHPWG_ROOT_PATH'))die('Hacking attempt!');2 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 3 3 4 4 include_once( dirname(__FILE__).'/../include/functions_map.php' ); -
extensions/rv_gmaps/trunk/admin/admin_sync.php
r8367 r12701 1 1 <?php 2 2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 3 4 function parse_fract( $f )5 {6 $nd = explode( '/', $f );7 return $nd[0]/$nd[1];8 }9 10 function parse_lat_lon( $arr )11 {12 $v=0;13 $v += parse_fract( $arr[0] );14 $v += parse_fract( $arr[1] )/60;15 $v += parse_fract( $arr[2] )/3600;16 return $v;17 }18 3 19 4 if ( isset($_POST['submit']) ) … … 36 21 { 37 22 include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php'); 38 23 include_once( dirname(__FILE__).'/../include/functions_metadata.php' ); 39 24 $where_clauses = array(); 40 25 if ( $sync_options['cat_id']!=0 ) … … 73 58 if ( empty($exif) ) 74 59 continue; 75 $exif = array_intersect_key( $exif, array_flip( array('GPSLatitudeRef', 'GPSLatitude', 'GPSLongitudeRef', 'GPSLongitude') ) ); 76 if ( count($exif)!=4 ) 77 continue; 78 if ( !in_array($exif['GPSLatitudeRef'], array('S', 'N') ) ) 60 $ll = exif_to_lat_lon($exif); 61 if (!is_array($ll)) 79 62 { 80 $errors[] = $filename. ': GPSLatitudeRef not S or N'; 63 if (!empty($ll)) 64 $errors[] = $filename. ': '.$ll; 81 65 continue; 82 66 } 83 if ( !in_array($exif['GPSLongitudeRef'], array('W', 'E') ) ) 84 { 85 $errors[] = $filename. ': GPSLongitudeRef not W or E'; 86 continue; 87 } 88 if (!is_array($exif['GPSLatitude']) or !is_array($exif['GPSLongitude']) ) 89 { 90 $errors[] = $filename. ': GPSLatitude and GPSLongitude are not arrays'; 91 continue; 92 } 93 $lat = parse_lat_lon( $exif['GPSLatitude'] ); 94 if ( $exif['GPSLatitudeRef']=='S' ) 95 $lat = -$lat; 96 $lon = parse_lat_lon( $exif['GPSLongitude'] ); 97 if ( $exif['GPSLongitudeRef']=='W' ) 98 $lon = -$lon; 67 99 68 $datas[] = array ( 100 69 'id' => $image['id'], 101 'lat' => $l at,102 'lon' => $l on,70 'lat' => $ll[0], 71 'lon' => $ll[1], 103 72 ); 104 73 } -
extensions/rv_gmaps/trunk/main.inc.php
r12700 r12701 1 1 <?php /* 2 2 Plugin Name: RV Maps&Earth 3 Version: 2.3. a3 Version: 2.3.b-alpha 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. a');10 if (!defined('PHPWG_ROOT_PATH'))die('Hacking attempt!');9 define( 'RVM_PLUGIN_VERSION', '2.3.b-alpha'); 10 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 11 11 12 12 add_event_handler('loc_end_index', 'rvm_end_index' ); … … 20 20 $rvm_dir = basename( dirname(__FILE__) ); 21 21 22 global $conf; 23 if (@$conf['gmaps_auto_sync']) 24 { 25 $conf['use_exif_mapping']['lat'] = 'lat'; 26 $conf['use_exif_mapping']['lon'] = 'lon'; 27 add_event_handler('format_exif_data', 'rvm_format_exif', EVENT_HANDLER_PRIORITY_NEUTRAL, 3); 28 } 22 29 23 30 function rvm_index_cat_thumbs_displayed() … … 132 139 } 133 140 141 function rvm_format_exif($exif, $file, $map) 142 { 143 if (isset($map['lat'])) 144 { 145 include_once( dirname(__FILE__) .'/include/functions_metadata.php'); 146 $ll = exif_to_lat_lon($exif); 147 if (is_array($ll)) 148 { 149 $exif[$map['lat']] = $ll[0]; 150 $exif[$map['lon']] = $ll[1]; 151 } 152 } 153 return $exif; 154 } 134 155 ?> -
extensions/rv_gmaps/trunk/maintain.inc.php
r3447 r12701 66 66 67 67 $q = ' 68 DELETE FROM '.CONFIG_TABLE.' WHERE param ="gmaps_api_key" LIMIT 1';68 DELETE FROM '.CONFIG_TABLE.' WHERE param IN("gmaps_api_key","gmaps_auto_sync")'; 69 69 pwg_query( $q ); 70 70 -
extensions/rv_gmaps/trunk/template/data_handler.js
r12700 r12701 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);14 //google.maps.event.bind( this._infoWindow, "domready", this, this._onInfoWindowDomReady); 15 15 } 16 16 … … 161 161 google.maps.event.removeListener(h); 162 162 163 google.maps.event.addListenerOnce( this._infoWindow, "domready", pwgBind(this, this._onInfoWindowDomReady) ); 163 164 this._infoWindow.setContent( content ); 164 165 this._infoWindow.setPosition( marker.getPosition() ); -
extensions/rv_gmaps/trunk/template/data_loader.js
r12700 r12701 5 5 { 6 6 reload_data_timeout: 200, 7 rectangle_of_confusion: new google.maps.Size( 32,16)7 rectangle_of_confusion: new google.maps.Size(16,32) 8 8 } 9 9 , opts || {} ); … … 75 75 _loadData: function() 76 76 { 77 var bounds = this._map.getBounds(); 78 77 var bounds = new google.maps.LatLngBounds( this._map.getBounds().getSouthWest(), this._map.getBounds().getNorthEast() ); 78 79 //bug as of v 3.7 - 80 var isOver = false; 81 if (bounds.getSouthWest().lng() < bounds.getNorthEast().lng()) 82 { 83 if ( this._map.getCenter().lng()<bounds.getSouthWest().lng() || this._map.getCenter().lng()>bounds.getNorthEast().lng() ) 84 { 85 isOver = true; 86 } 87 } 88 else if ( this._map.getCenter().lng()>bounds.getNorthEast().lng() && this._map.getCenter().lng()<bounds.getSouthWest().lng() ) 89 { 90 isOver = true; 91 } 92 93 if (isOver) 94 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 //end bug 96 97 79 98 var latRange = bounds.toSpan().lat(); 80 99 var latPrec = latRange * this.options.rectangle_of_confusion.height / this._map.getDiv().offsetHeight; -
extensions/rv_gmaps/trunk/template/map.tpl
r12700 r12701 51 51 if (console) 52 52 { 53 console. debug(msg + " b="+map.getBounds().toUrlValue() + " c="+map.getCenter().toUrlValue() + " z="+map.getZoom() );53 console.log(msg + " b="+map.getBounds().toUrlValue() + " c="+map.getCenter().toUrlValue() + " z="+map.getZoom() ); 54 54 } 55 55 } … … 163 163 if (lang_str == undefined) 164 164 { 165 if (document.is_debug) g oogle.maps.Log.write("Language string undefined '"+ str+"'");165 if (document.is_debug) glog("Language string undefined '"+ str+"'"); 166 166 return str; 167 167 }
Note: See TracChangeset
for help on using the changeset viewer.