[Linpha-cvs] SF.net SVN: linpha: [4767] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <bz...@us...> - 2007-08-23 19:14:20
|
Revision: 4767 http://linpha.svn.sourceforge.net/linpha/?rev=4767&view=rev Author: bzrudi Date: 2007-08-23 12:14:12 -0700 (Thu, 23 Aug 2007) Log Message: ----------- "Make Exiftool work with GPS EXIF data" Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/admin/metadata_define.php trunk/linpha2/lib/classes/linpha.exiftool.class.php trunk/linpha2/lib/include/metadata_info_show.php trunk/linpha2/lib/plugins/maps/gpx.php trunk/linpha2/lib/plugins/maps/module.exampleMap.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2007-08-20 22:19:07 UTC (rev 4766) +++ trunk/linpha2/ChangeLog 2007-08-23 19:14:12 UTC (rev 4767) @@ -1,3 +1,6 @@ +2007-08-23 bzrudi + * Make Exiftool work with GPS EXIF data + 2007-08-20 flo * google maps - added some basic marker/geocode functions Modified: trunk/linpha2/admin/metadata_define.php =================================================================== --- trunk/linpha2/admin/metadata_define.php 2007-08-20 22:19:07 UTC (rev 4766) +++ trunk/linpha2/admin/metadata_define.php 2007-08-23 19:14:12 UTC (rev 4767) @@ -83,7 +83,7 @@ show_metadata(); break; case 'iptc': - if($GLOBALS['linpha']->sql->config->value['sys_import_use_exiftool']) + if($GLOBALS['linpha']->sql->config->value['sys_import_exiftool_avail']) { echo i18n("IPTC/XMP data is usually not available by default."); echo i18n("It needs to be filled up either with LinPHA, or with any " . Modified: trunk/linpha2/lib/classes/linpha.exiftool.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.exiftool.class.php 2007-08-20 22:19:07 UTC (rev 4766) +++ trunk/linpha2/lib/classes/linpha.exiftool.class.php 2007-08-23 19:14:12 UTC (rev 4767) @@ -111,8 +111,8 @@ { $meta =""; $return = array(); - $parameters = "-g ". - "-h "; + $parameters = "-g ". //Group by Tags + "-h "; //Enable HTML output LinFilesys::linExec($this->exiftool.' '.$parameters.' "'.$filename.'"', $return); @@ -141,11 +141,13 @@ "-s " . // Print tag names instead of descr. "-t " . // Use tab \t as delimiter "-fast " . // Do not read to EOF - //"-n " . // Read numbers instead of words + "-a " . // Allow duplicates + "-c %.10f " . // GPS formatting to float instead of words "-m "; // Ignore minor errors LinFilesys::linExec($this->exiftool.' '.$parameters.' "'.$filename.'"', $meta, $return); + /* echo $this->exiftool.' '.$parameters.' "'.$filename.'"'; echo '<pre>', print_r($meta), '</pre>'; @@ -176,7 +178,7 @@ $dataArray = LinExifTool::readMetaDataFromFile($tag, $filename); -// echo '<pre>', print_r($dataArray), '</pre>'; + //echo '<pre>', print_r($dataArray), '</pre>'; $str_columns = "md5sum, "; $str_values = "'" . $md5sum . "', "; @@ -220,7 +222,7 @@ * * @param string $dirname, $filename * @return array $time_exif (unix timestamp) - * $rotate (degrees to rotate) + * $rotate (degrees to rotate) otherMarker * @author bzrudi,flo **/ public function getBasicMeta($dirname, $filename) @@ -498,15 +500,44 @@ 'saturation' => 'Saturation', 'sharpness' => 'Sharpness', 'subjectdistancerange' => 'Subject Distance Range', - 'gamma' => 'Gamma' + 'gamma' => 'Gamma', + + //GPS + 'gpsversionid' => 'GPS Version ID', + 'gpslatituderef' => 'GPS Latitude Ref', + 'gpslatitude' => 'GPS Latitude', + 'gpslongituderef' => 'GPS Longitude Ref', + 'gpslongitude' => 'GPS Longitude', + 'gpsaltituderef' => 'GPS Altitude Ref', + 'gpsaltitude' => 'GPS Altitude', + 'gpstimestamp' => 'GPS Time Stamp', + 'gpssatellites' => 'GPS Satellites', + 'gpsstatus' => 'GPS Status', + 'gpsmeasuremode' => 'GPS Measure Mode', + 'gpsdop' => 'GPS DOP', + 'gpsspeedref' => 'GPS Speed Ref', + 'gpsspeed' => 'GPS Speed', + 'gpstrackref' => 'GPS Track', + 'gpstrack' => 'GPS Track', + 'gpsimgdirectionref' => 'GPS Img Direction Ref', + 'gpsimgdirection' => 'GPS Img Direction', + 'gpsmapdatum' => 'GPS Map Datum', + 'gpsdestlatituderef' => 'GPS Dest Latitude Ref', + 'gpsdestlatitude' => 'GPS Dest Latitude', + 'gpsdestlongituderef' => 'GPS Dest Longitude Ref', + 'gpsdestlongitude' => 'GPS Dest Longitude', + 'gpsdestbearingref' => 'GPS Dest Bearing Ref', + 'gpsdestbearing' => 'GPS Dest Bearing', + 'gpsdestdistanceref' => 'GPS Dest Distance Ref', + 'gpsdestdistance' => 'GPS Dest Distance', + 'gpsprocessingmethod' => 'GPS Processing Method', + 'gpsareainformation' => 'GPS Area Information', + 'gpsdatestamp' => 'GPS Date Stamp', + 'gpsdatetime' => 'GPS Date Time', + 'gpsposition' => 'GPS Position' //not definied in exiftool!? ) ); } -//$test = new LinExifTool(); -//$test->readMetaDataFromFile('xmp'); - - - /* vi: set ts=4 sw=4 sts=4 */ ?> Modified: trunk/linpha2/lib/include/metadata_info_show.php =================================================================== --- trunk/linpha2/lib/include/metadata_info_show.php 2007-08-20 22:19:07 UTC (rev 4766) +++ trunk/linpha2/lib/include/metadata_info_show.php 2007-08-23 19:14:12 UTC (rev 4767) @@ -44,7 +44,7 @@ } /** - * only images, but only if we stuck with pjmt exiftool does it :-) + * only images, but only if we stuck with pjmt, exiftool does it :-) */ if(!$GLOBALS['linpha']->sql->config->value['sys_import_exiftool_avail']) { @@ -57,7 +57,7 @@ $filename = LinSql::getFullImagePath( $GLOBALS['linpha']->template->idCurrent ); $filenameShow = implode( '/', LinSql::getFullFilenameFromId( $GLOBALS['linpha']->template->idCurrent ) ); - + /** * If exiftool avail, make use of it! */ @@ -97,7 +97,7 @@ * Author: Evan Hunter * * Date: 30/7/2004 -* +*file:////opt/ZendStudio-5.5.0/docs/PHPmanual/ * Project: PHP JPEG Metadata Toolkit * * Revision: 1.11 Modified: trunk/linpha2/lib/plugins/maps/gpx.php =================================================================== --- trunk/linpha2/lib/plugins/maps/gpx.php 2007-08-20 22:19:07 UTC (rev 4766) +++ trunk/linpha2/lib/plugins/maps/gpx.php 2007-08-23 19:14:12 UTC (rev 4767) @@ -1,4 +1,4 @@ - +<?php /** * This method parses an XML file (currently in Garmin GPX format) and saves * all available information in the DB Modified: trunk/linpha2/lib/plugins/maps/module.exampleMap.php =================================================================== --- trunk/linpha2/lib/plugins/maps/module.exampleMap.php 2007-08-20 22:19:07 UTC (rev 4766) +++ trunk/linpha2/lib/plugins/maps/module.exampleMap.php 2007-08-23 19:14:12 UTC (rev 4767) @@ -1,319 +1,348 @@ -<?php -/* - * Copyright (c) 2005 Heiko Rutenbeck <bz...@tu...> - * Florian Angehrn - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/** - * Google Maps - * @package Plugins - */ -if(!defined('LINPHA_DIR')) { exit(1); } - - -require_once(LINPHA_DIR."/lib/plugins/maps/gmapper1/class.gmapper.php"); - -if(isset($_GET['xml'])) -{ - header('Content-type: text/xml'); - echo '<?xml version="1.0" ?>'."\n"; - echo '<root>'."\n"; - - if(isset($_POST['cmd'])) - { - switch($_POST['cmd']) - { - case 'loadMarker': - break; - - case 'saveMarker': - - if( !isset($_POST['linInputMarkerName']) OR empty($_POST['linInputMarkerName'])) - { - echo '<responseCode>failed</responseCode>'."\n"; - echo '<responseMsg>'.i18n("Error: no title specified").'</responseMsg>'."\n"; - } - elseif( !isset($_POST['linInputLat']) OR empty($_POST['linInputLat']) - OR !isset($_POST['linInputLon']) OR empty($_POST['linInputLon'])) - { - echo '<responseCode>failed</responseCode>'."\n"; - echo '<responseMsg>'.i18n("Error: Missing Lat/Lon values").'</responseMsg>'."\n"; - } - else - { - /** - * @todo save marker in db - */ - /* - $_POST['linInputMarkerName'] - floatval($_POST['linInputLat']) - floatval($_POST['linInputLon']) - */ - - echo '<responseCode>success</responseCode>'."\n"; - } - - break; - } - } - - echo '</root>'."\n"; - exit(); -} - -if(isset($_GET['albId'])) { - $albId = intval($_GET['albId']); -} - -$query = $GLOBALS['linpha']->db->Execute("SELECT P.id, P.parent_id, P.name, gpslatituderef,gpslatitude,gpslongituderef,gpslongitude " . - "FROM ".LIN_PREFIX."meta_exif E INNER JOIN ".LIN_PREFIX."photos P on E.md5sum = P.md5sum " . - "WHERE gpslatituderef IS NOT NULL " . - "AND gpslatitude IS NOT NULL " . - "AND gpslongituderef IS NOT NULL " . - "AND gpslongitude IS NOT NULL "); -while($data = $query->FetchRow()) -{ - $arrImg[] = $data; - $parentIds[ $data['parent_id'] ] = true; -} - -$key = "ABQIAAAAAXCMfho4_sqSSh0VqMB80xT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSfO_6bbb_ScfT_zPgcnJMKyGltOg"; // key for http://localhost -$GLOBALS['linpha']->template->output['googleMap'] = new gmap($key); - - -/** - * here starts the output - */ -ob_start(); - -?> - <div id="linDivMapTop"></div> - - <div id="linDivMapMain" style="height: 475px;"> - <div id="linDivMapNav" style="width: 155px; height: 475px; float: right; overflow: auto; padding-left: 2px; padding-right: 1px;"> - Nav - <br /><br /><br /><br /><br /><br /><br /><br /><br />tset - <br /><br /><br /><br /><br /><br /><br /><br /><br />tset - <br /><br /><br /><br /><br /><br /><br /><br /><br />tset - <br /><br /><br /><br /><br /><br /><br /><br /><br />tset - <br /><br /><br /><br /><br /><br /><br /><br /><br />tset - </div> - <div style="width: 5px; height: 100%; float: right; cursor: e-resize; background-color: grey; border: 1px solid black;" ondblClick="linToggleNav();"></div> - <div id="gmapper_map" style="height: 100%; margin-right: 165px; "></div> - </div> - - <div id="linDivMapBottom"> - - <input type="text" id="linInputAddress" size="30"> - <input type="button" onclick="myLinMaps.geocodeAddress( $('linInputAddress').value )" value="<?php echo i18n("Geocode"); ?>"> - <br /><br /> - - <div id="linDivEditMarker" style="border: 1px solid black; width: 550px; padding: 3px;"> - <form action="" method="POST" onsubmit="myLinGlobal.AjaxPost(Form.serialize(this),myLinMaps.saveMarker); return false;"> - <label for="linInputMarkerName" style="display: block; float: left; width: 150px;">Marker Name: - </label><input type="text" id="linInputMarkerName" name="linInputMarkerName" size="30" /><br /> - <label for="linInputLat" style="display: block; float: left; width: 150px;">Lat - </label><input type="text" id="linInputLat" name="linInputLat" size="10" /><br /> - <label for="linInputLon" style="display: block; float: left; width: 150px;">Lon: - </label><input type="text" id="linInputLon" name="linInputLon" size="10" /><br /> - <input type="submit" value="<?php echo i18n("Save"); ?>" /> - <input type="hidden" name="cmd" value="saveMarker" /> - </form> - </div> - - - - <br /><br /><br /> - - - <?php - /* - <input type="text" id="adresse" size="30"> - <input type="button" onclick="<?php $GLOBALS['linpha']->template->output['googleMap']->geocode( - "getAdress()", "otherMarker", array(LINPHA_CLIENT."/lib/plugins/maps/gmapper1/dash.png",32,32)); ?>" value="Geocode"> <br> - <br /><br /> - <a href="javascript:void(0)" onclick="<?php $GLOBALS['linpha']->template->output['googleMap']->geocode( - "Berlin", "otherMarker", array(LINPHA_CLIENT."/lib/plugins/maps/gmapper1/143.png",20,34)); ?>">Berlin</a><br /> - <a href="javascript:void(0)" onclick="<?php $GLOBALS['linpha']->template->output['googleMap']->geocode( - "Muenchen", "otherMarker", array(LINPHA_CLIENT."/lib/plugins/maps/gmapper1/rot.png",20,34), 10); ?>">München</a><br /> - <a href="javascript:void(0)" onclick="<?php $GLOBALS['linpha']->template->output['googleMap']->geocode( - "Koelner Dom", "otherMarker", array(LINPHA_CLIENT."/lib/plugins/maps/gmapper1/gruen.png",20,34), 17); ?>">Kölner Dom</a> - - */ - - - - - - echo i18n("Please select the album to show in Google Maps:"); - echo '<br /><br /><a href="'.LINPHA_LINK.'&linCat=map&albId=0">'.i18n("All albums").'</a><br />'; - - foreach($parentIds as $id=>$value) - { - echo '<a href="'.LINPHA_LINK.'&linCat=map&albId='.$id.'">'; - echo implode( '/', LinSql::getFullFilenameFromId($id) ); - echo '</a><br />'; - } - ?> - <br /> - - <div> - Legend:<br /> - (red) current marker<br /> - (yellow) location marker<br /> - (blue) location marker with assigned albums<br /> - (green) location marker with assigned images (GPS)<br /> - (pink) images<br /> - </div> - - <div> - Create marker:<br /> - 1. Enter address or just press "Geocode"<br /> - 2. Drag the marker to fine adjust<br /> - 3. Check marker name<br /> - 4. Press "Save"<br /> - <br /> - Assign albums:<br /> - 1. Click on a marker<br /> - 2. Press "Assign album"<br /> - 3. Choose album and press "Save"<br /> - 4. Repeat for multiple albums<br /> - <br /> - Assign images to an album marker:<br /> - This is done automatically. But it's required that your images have the - GPS information stored inside. You will need a GPS Data Logger to do this - automatically. It is also possible do it manually. Robogeo is a tool, but - it is not free. - </div> - - - </div> - - -<?php - $GLOBALS['linpha']->template->output['googleMap']->map( - $zoom = 4, - $lat = '49.9801', - $lng = '10.8731', - $type = "hybrid", - $min_zoom = 1, - $max_zoom = 23, - $navcontrol = "large", - $overview = 1, - $mousezoom = 1, - $tilecheck = 0 - ); -if(isset($albId)) -{ - $GLOBALS['linpha']->template->output['googleMap']->markstart(); - $GLOBALS['linpha']->template->output['googleMap']->bounds(); - //$GLOBALS['linpha']->template->output['googleMap']->lockMap(); not needed - - foreach($arrImg as $data) - { - if($albId == 0 OR $albId == $data['parent_id']) - { - $latlon = parsePJMTLatLon($data); - $GLOBALS['linpha']->template->output['googleMap']->otherMarker( - $latlon['gpslatitude'], - $latlon['gpslongitude'] , - '<img src="'.LINPHA_CLIENT.'/get_thumb.php?linId='.$data['id'].'" width="'. - $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_max'].'" height="'. - $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_max'].'" /><br />'.$data['name'], - array(LINPHA_CLIENT."/lib/plugins/maps/gmapper1/gelb.png",20,34) - ); - $GLOBALS['linpha']->template->output['googleMap']->boundsExtend(); - } - } - - $GLOBALS['linpha']->template->output['googleMap']->zoomToBounds(); - $GLOBALS['linpha']->template->output['googleMap']->markend(); - - /*$gpoint = $GLOBALS['linpha']->template->output['googleMap']->getGeoPoint("Saarbr\xFCcken Saarland Deutschland"); - // Wir f\xFCgen einige Marker hinzu - $GLOBALS['linpha']->template->output['googleMap']->markstart(); - $GLOBALS['linpha']->template->output['googleMap']->marker($gpoint[0], $gpoint[1], "dash.png"); - $GLOBALS['linpha']->template->output['googleMap']->mapMarker('52.5', '13', "dash.png"); - $GLOBALS['linpha']->template->output['googleMap']->mapMarker('48', '11', "gruen.png"); - $GLOBALS['linpha']->template->output['googleMap']->marker('47.5', '13', "gelb.png"); - // Marker mit Infoblase - $GLOBALS['linpha']->template->output['googleMap']->otherMarker('51.5', '12' , 'Text hier', "gelb.png"); - $GLOBALS['linpha']->template->output['googleMap']->otherMarker('51', '10' , 'Hallo Welt!'); - $tabs = array( - array('Tab 1', 'Content1'), - array('Tab 2', 'Lorem Ipsum Dolor sit amet Lorem Ipsum <br>Lorem Ispum'), - array('Tab 3', 'Lorem Ipsum Dolor sit amet Lorem Ipsum ') - ); - $GLOBALS['linpha']->template->output['googleMap']->tabMarker('52.6', '11.9' , $tabs, "gruen.png"); - $GLOBALS['linpha']->template->output['googleMap']->linkMarker('51.0', '6.5' , "http://www.gothic-singles.de", "rot.png"); - // Array mit Punkten zwischen denen eine Linie gezeichnet wird. - $punkte = array( - array('53.5', '12.7'), - array('52.5', '13'), - array('51.5', '12'), - array('51', '10'), - array('48', '11'), - array('47.5', '13') - ); - // Linie erzeugen - $GLOBALS['linpha']->template->output['googleMap']->polyline($punkte, '#FF00FF', 4, 1, "", 1); - $dist = $GLOBALS['linpha']->template->output['googleMap']->getDistance($punkte); - $GLOBALS['linpha']->template->output['googleMap']->markend(); - echo "L\xE4nge der Linie: $dist Meter"; - */ -} - - - - - -$linpha->template->output['default'] = ob_get_clean(); - -$linpha->template->setModuleName('default'); -$linpha->template->overrideModule('head','map'); -$linpha->template->URL_full = LINPHA_LINK.'&linCat=map'; -$linpha->template->URL_base = LINPHA_LINK.'&linCat=map'; -$linpha->template->output['title'] = i18n("Google Maps"); -include_once(LINPHA_DIR.'/templates/'.$linpha->template->template_name.'/global.html.php'); - -function parsePJMTLatLon(&$LatLon) -{ - /*Array - ( - [md5sum] => 084a9633ae7544e35ff1faad6cb05564 - [gpslatituderef] => N - [gpslatitude] => 469762048/16777216 (28),285212672/16777216 (17),820803480/16777216 (48.9236998558) (Degrees Minutes Seconds North or South) - [gpslongituderef] => W - [gpslongitude] => 1879048192/134217728 (14),1207959552/134217728 (9),472055494/16777216 (28.1367000341) (Degrees Minutes Seconds East or West) - )*/ - - foreach(array('gpslatitude','gpslongitude') as $value) - { - $arrHits = array(); - - // use '?' to be \x84non-greedy\x93 (http://de.wikipedia.org/wiki/Regul%C3%A4rer_Ausdruck#Gieriges_Verhalten) - preg_match_all('/\((.*?)\)/', $LatLon[ $value ], $arrHits); - - $return[ $value ] = $arrHits[1][0] + ($arrHits[1][1] * 1/60) + ($arrHits[1][2] * 1/60 * 1/60); - if( $LatLon[ $value.'ref'] == 'S' OR $LatLon[ $value.'ref'] == 'W' ) - { - $return[ $value ] *= -1; - } - } - return $return; -} -?> \ No newline at end of file +<?php +/* + * Copyright (c) 2005 Heiko Rutenbeck <bz...@tu...> + * Florian Angehrn + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/** + * Google Maps + * @package Plugins + */ +if(!defined('LINPHA_DIR')) { exit(1); } + +error_reporting(E_ALL); +require_once(LINPHA_DIR."/lib/plugins/maps/gmapper1/class.gmapper.php"); + +if(isset($_GET['xml'])) +{ + header('Content-type: text/xml'); + echo '<?xml version="1.0" ?>'."\n"; + echo '<root>'."\n"; + + if(isset($_POST['cmd'])) + { + switch($_POST['cmd']) + { + case 'loadMarker': + break; + + case 'saveMarker': + + if( !isset($_POST['linInputMarkerName']) OR empty($_POST['linInputMarkerName'])) + { + echo '<responseCode>failed</responseCode>'."\n"; + echo '<responseMsg>'.i18n("Error: no title specified").'</responseMsg>'."\n"; + } + elseif( !isset($_POST['linInputLat']) OR empty($_POST['linInputLat']) + OR !isset($_POST['linInputLon']) OR empty($_POST['linInputLon'])) + { + echo '<responseCode>failed</responseCode>'."\n"; + echo '<responseMsg>'.i18n("Error: Missing Lat/Lon values").'</responseMsg>'."\n"; + } + else + { + /** + * @todo save marker in db + */ + /* + $_POST['linInputMarkerName'] + floatval($_POST['linInputLat']) + floatval($_POST['linInputLon']) + */ + + echo '<responseCode>success</responseCode>'."\n"; + } + + break; + } + } + + echo '</root>'."\n"; + exit(); +} + +if(isset($_GET['albId'])) { + $albId = intval($_GET['albId']); +} + +$query = $GLOBALS['linpha']->db->Execute("SELECT P.id, P.parent_id, P.name, gpslatituderef,gpslatitude,gpslongituderef,gpslongitude " . + "FROM ".LIN_PREFIX."meta_exif E INNER JOIN ".LIN_PREFIX."photos P on E.md5sum = P.md5sum " . + "WHERE gpslatituderef IS NOT NULL " . + "AND gpslatitude IS NOT NULL " . + "AND gpslongituderef IS NOT NULL " . + "AND gpslongitude IS NOT NULL "); +while($data = $query->FetchRow()) +{ + $arrImg[] = $data; + $parentIds[ $data['parent_id'] ] = true; +} + +$key = "ABQIAAAAAXCMfho4_sqSSh0VqMB80xT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSfO_6bbb_ScfT_zPgcnJMKyGltOg"; // key for http://localhost +$GLOBALS['linpha']->template->output['googleMap'] = new gmap($key); + + +/** + * here starts the output + */ +ob_start(); + +?> + <div id="linDivMapTop"></div> + + <div id="linDivMapMain" style="height: 475px;"> + <div id="linDivMapNav" style="width: 155px; height: 475px; float: right; overflow: auto; padding-left: 2px; padding-right: 1px;"> + Nav + <br /><br /><br /><br /><br /><br /><br /><br /><br />tset + <br /><br /><br /><br /><br /><br /><br /><br /><br />tset + <br /><br /><br /><br /><br /><br /><br /><br /><br />tset + <br /><br /><br /><br /><br /><br /><br /><br /><br />tset + <br /><br /><br /><br /><br /><br /><br /><br /><br />tset + </div> + <div style="width: 5px; height: 100%; float: right; cursor: e-resize; background-color: grey; border: 1px solid black;" ondblClick="linToggleNav();"></div> + <div id="gmapper_map" style="height: 100%; margin-right: 165px; "></div> + </div> + + <div id="linDivMapBottom"> + + <input type="text" id="linInputAddress" size="30"> + <input type="button" onclick="myLinMaps.geocodeAddress( $('linInputAddress').value )" value="<?php echo i18n("Geocode"); ?>"> + <br /><br /> + + <div id="linDivEditMarker" style="border: 1px solid black; width: 550px; padding: 3px;"> + <form action="" method="POST" onsubmit="myLinGlobal.AjaxPost(Form.serialize(this),myLinMaps.saveMarker); return false;"> + <label for="linInputMarkerName" style="display: block; float: left; width: 150px;">Marker Name: + </label><input type="text" id="linInputMarkerName" name="linInputMarkerName" size="30" /><br /> + <label for="linInputLat" style="display: block; float: left; width: 150px;">Lat + </label><input type="text" id="linInputLat" name="linInputLat" size="10" /><br /> + <label for="linInputLon" style="display: block; float: left; width: 150px;">Lon: + </label><input type="text" id="linInputLon" name="linInputLon" size="10" /><br /> + <input type="submit" value="<?php echo i18n("Save"); ?>" /> + <input type="hidden" name="cmd" value="saveMarker" /> + </form> + </div> + + + + <br /><br /><br /> + + + <?php + /* + <input type="text" id="adresse" size="30"> + <input type="button" onclick="<?php $GLOBALS['linpha']->template->output['googleMap']->geocode( + "getAdress()", "otherMarker", array(LINPHA_CLIENT."/lib/plugins/maps/gmapper1/dash.png",32,32)); ?>" value="Geocode"> <br> + <br /><br /> + <a href="javascript:void(0)" onclick="<?php $GLOBALS['linpha']->template->output['googleMap']->geocode( + "Berlin", "otherMarker", array(LINPHA_CLIENT."/lib/plugins/maps/gmapper1/143.png",20,34)); ?>">Berlin</a><br /> + <a href="javascript:void(0)" onclick="<?php $GLOBALS['linpha']->template->output['googleMap']->geocode( + "Muenchen", "otherMarker", array(LINPHA_CLIENT."/lib/plugins/maps/gmapper1/rot.png",20,34), 10); ?>">München</a><br /> + <a href="javascript:void(0)" onclick="<?php $GLOBALS['linpha']->template->output['googleMap']->geocode( + "Koelner Dom", "otherMarker", array(LINPHA_CLIENT."/lib/plugins/maps/gmapper1/gruen.png",20,34), 17); ?>">Kölner Dom</a> + + */ + + + + + + echo i18n("Please select the album to show in Google Maps:"); + echo '<br /><br /><a href="'.LINPHA_LINK.'&linCat=map&albId=0">'.i18n("All albums").'</a><br />'; + + foreach($parentIds as $id=>$value) + { + echo '<a href="'.LINPHA_LINK.'&linCat=map&albId='.$id.'">'; + echo implode( '/', LinSql::getFullFilenameFromId($id) ); + echo '</a><br />'; + } + ?> + <br /> + + <div> + Legend:<br /> + (red) current marker<br /> + (yellow) location marker<br /> + (blue) location marker with assigned albums<br /> + (green) location marker with assigned images (GPS)<br /> + (pink) images<br /> + </div> + + <div> + Create marker:<br /> + 1. Enter address or just press "Geocode"<br /> + 2. Drag the marker to fine adjust<br /> + 3. Check marker name<br /> + 4. Press "Save"<br /> + <br /> + Assign albums:<br /> + 1. Click on a marker<br /> + 2. Press "Assign album"<br /> + 3. Choose album and press "Save"<br /> + 4. Repeat for multiple albums<br /> + <br /> + Assign images to an album marker:<br /> + This is done automatically. But it's required that your images have the + GPS information stored inside. You will need a GPS Data Logger to do this + automatically. It is also possible do it manually. Robogeo is a tool, but + it is not free. + </div> + + + </div> + + +<?php + $GLOBALS['linpha']->template->output['googleMap']->map( + $zoom = 4, + $lat = '49.9801', + $lng = '10.8731', + $type = "hybrid", + $min_zoom = 1, + $max_zoom = 23, + $navcontrol = "large", + $overview = 1, + $mousezoom = 1, + $tilecheck = 0 + ); +if(isset($albId)) +{ + $GLOBALS['linpha']->template->output['googleMap']->markstart(); + $GLOBALS['linpha']->template->output['googleMap']->bounds(); + //$GLOBALS['linpha']->template->output['googleMap']->lockMap(); not needed + + foreach($arrImg as $data) + { + if($albId == 0 OR $albId == $data['parent_id']) + { + $latlon = getExifLatLon($data); + $GLOBALS['linpha']->template->output['googleMap']->otherMarker( + $latlon['gpslatitude'], + $latlon['gpslongitude'] , + '<img src="'.LINPHA_CLIENT.'/get_thumb.php?linId='.$data['id'].'" width="'. + $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_max'].'" height="'. + $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_max'].'" /><br />'.$data['name'], + array(LINPHA_CLIENT."/lib/plugins/maps/gmapper1/gelb.png",20,34) + ); + $GLOBALS['linpha']->template->output['googleMap']->boundsExtend(); + } + } + + $GLOBALS['linpha']->template->output['googleMap']->zoomToBounds(); + $GLOBALS['linpha']->template->output['googleMap']->markend(); + + /*$gpoint = $GLOBALS['linpha']->template->output['googleMap']->getGeoPoint("Saarbr�cken Saarland Deutschland"); + // Wir f�gen einige Marker hinzu + $GLOBALS['linpha']->template->output['googleMap']->markstart(); + $GLOBALS['linpha']->template->output['googleMap']->marker($gpoint[0], $gpoint[1], "dash.png"); + $GLOBALS['linpha']->template->output['googleMap']->mapMarker('52.5', '13', "dash.png"); + $GLOBALS['linpha']->template->output['googleMap']->mapMarker('48', '11', "gruen.png"); + $GLOBALS['linpha']->template->output['googleMap']->marker('47.5', '13', "gelb.png"); + // Marker mit Infoblase + $GLOBALS['linpha']->template->output['googleMap']->otherMarker('51.5', '12' , 'Text hier', "gelb.png"); + $GLOBALS['linpha']->template->output['googleMap']->otherMarker('51', '10' , 'Hallo Welt!'); + $tabs = array( + array('Tab 1', 'Content1'), + array('Tab 2', 'Lorem Ipsum Dolor sit amet Lorem Ipsum <br>Lorem Ispum'), + array('Tab 3', 'Lorem Ipsum Dolor sit amet Lorem Ipsum ') + ); + $GLOBALS['linpha']->template->output['googleMap']->tabMarker('52.6', '11.9' , $tabs, "gruen.png"); + $GLOBALS['linpha']->template->output['googleMap']->linkMarker('51.0', '6.5' , "http://www.gothic-singles.de", "rot.png"); + // Array mit Punkten zwischen denen eine Linie gezeichnet wird. + $punkte = array( + array('53.5', '12.7'), + array('52.5', '13'), + array('51.5', '12'), + array('51', '10'), + array('48', '11'), + array('47.5', '13') + ); + // Linie erzeugen + $GLOBALS['linpha']->template->output['googleMap']->polyline($punkte, '#FF00FF', 4, 1, "", 1); + $dist = $GLOBALS['linpha']->template->output['googleMap']->getDistance($punkte); + $GLOBALS['linpha']->template->output['googleMap']->markend(); + echo "L�nge der Linie: $dist Meter"; + */ +} + + + + + +$linpha->template->output['default'] = ob_get_clean(); + +$linpha->template->setModuleName('default'); +$linpha->template->overrideModule('head','map'); +$linpha->template->URL_full = LINPHA_LINK.'&linCat=map'; +$linpha->template->URL_base = LINPHA_LINK.'&linCat=map'; +$linpha->template->output['title'] = i18n("Google Maps"); +include_once(LINPHA_DIR.'/templates/'.$linpha->template->template_name.'/global.html.php'); + +function getExifLatLon(&$LatLon) +{ + /*Array PJMT + ( + [md5sum] => 084a9633ae7544e35ff1faad6cb05564 + [gpslatituderef] => N + [gpslatitude] => 469762048/16777216 (28),285212672/16777216 (17),820803480/16777216 (48.9236998558) (Degrees Minutes Seconds North or South) + [gpslongituderef] => W + [gpslongitude] => 1879048192/134217728 (14),1207959552/134217728 (9),472055494/16777216 (28.1367000341) (Degrees Minutes Seconds East or West) + ) + /*Array Exiftool + ( + [md5sum] => 084a9633ae7544e35ff1faad6cb05564 + [gpslatituderef] => North + [gpslatitude] => 46.9762048 + [gpslongituderef] => West + [gpslongitude] => 18.79048192 + )*/ + + /** + * Exiftool saves lat and lon as float + */ + if($GLOBALS['linpha']->sql->config->value['sys_import_use_exiftool'] + && $GLOBALS['linpha']->sql->config->value['sys_import_exiftool_avail']) + { + foreach(array('gpslatitude','gpslongitude') as $value) + { + if( $LatLon[$value.'ref'] == 'South' OR $LatLon[$value.'ref'] == 'West' ) + { + $return[ $value ] = $LatLon[$value]*-1; + } + else + { + $return[$value] = $LatLon[$value]; + } + } + } + else + { + foreach(array('gpslatitude','gpslongitude') as $value) + { + $arrHits = array(); + + // use '?' to be �non-greedy� (http://de.wikipedia.org/wiki/Regul%C3%A4rer_Ausdruck#Gieriges_Verhalten) + preg_match_all('/\((.*?)\)/', $LatLon[ $value ], $arrHits); + + $return[ $value ] = $arrHits[1][0] + ($arrHits[1][1] * 1/60) + ($arrHits[1][2] * 1/60 * 1/60); + if( $LatLon[ $value.'ref'] == 'S' OR $LatLon[ $value.'ref'] == 'W' ) + { + $return[ $value ] *= -1; + } + } + } +return $return; +} +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |