Ignore:
Timestamp:
12/07/11 22:48:16 (8 years ago)
Author:
rvelices
Message:

rv_gmaps auto sync gps with exif + towards full maps api v3 migration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/rv_gmaps/trunk/main.inc.php

    r12700 r12701  
    11<?php /* 
    22Plugin Name: RV Maps&Earth 
    3 Version: 2.3.a 
     3Version: 2.3.b-alpha 
    44Description: Extend your gallery with Google Maps and Google Earth ... 
    55Plugin URI: http://piwigo.org/ext/extension_view.php?eid=122 
     
    77Author URI: http://www.modusoptimus.com/ 
    88*/ 
    9 define( 'RVM_PLUGIN_VERSION', '2.3.a'); 
    10 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 
     9define( 'RVM_PLUGIN_VERSION', '2.3.b-alpha'); 
     10defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 
    1111 
    1212add_event_handler('loc_end_index', 'rvm_end_index' ); 
     
    2020$rvm_dir = basename( dirname(__FILE__) ); 
    2121 
     22global $conf; 
     23if (@$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} 
    2229 
    2330function rvm_index_cat_thumbs_displayed() 
     
    132139} 
    133140 
     141function 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} 
    134155?> 
Note: See TracChangeset for help on using the changeset viewer.