linpha-cvs Mailing List for LinPHA PHP Photo Gallery (Page 9)
Status: Inactive
Brought to you by:
bzrudi
You can subscribe to this list here.
2006 |
Jan
|
Feb
(143) |
Mar
(104) |
Apr
(127) |
May
(20) |
Jun
(10) |
Jul
(28) |
Aug
(48) |
Sep
(55) |
Oct
(85) |
Nov
(57) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(16) |
Feb
(41) |
Mar
(56) |
Apr
(8) |
May
(1) |
Jun
(9) |
Jul
(54) |
Aug
(24) |
Sep
(2) |
Oct
(14) |
Nov
(30) |
Dec
(7) |
2008 |
Jan
(48) |
Feb
(52) |
Mar
(18) |
Apr
(30) |
May
(4) |
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: bzrudi <bz...@us...> - 2007-10-25 15:26:50
|
Update of /cvsroot/linpha/linpha/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv19583/include Modified Files: upgrade.php Log Message: change version to 1.3.3 Index: upgrade.php =================================================================== RCS file: /cvsroot/linpha/linpha/include/upgrade.php,v retrieving revision 1.162 retrieving revision 1.163 diff -C2 -d -r1.162 -r1.163 *** upgrade.php 10 Aug 2007 04:26:49 -0000 1.162 --- upgrade.php 25 Oct 2007 15:26:46 -0000 1.163 *************** *** 45,49 **** * check for new updates */ ! $version = "1.3.2"; /** --- 45,49 ---- * check for new updates */ ! $version = "1.3.3"; /** |
From: bzrudi <bz...@us...> - 2007-10-25 15:24:19
|
Update of /cvsroot/linpha/linpha/functions In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv18685/functions Modified Files: db_api.php Log Message: fix unreadable DHTML notice messages when using \"Shadow\" theme. Index: db_api.php =================================================================== RCS file: /cvsroot/linpha/linpha/functions/db_api.php,v retrieving revision 1.109 retrieving revision 1.110 diff -C2 -d -r1.109 -r1.110 *** db_api.php 13 Aug 2007 10:31:23 -0000 1.109 --- db_api.php 25 Oct 2007 15:24:10 -0000 1.110 *************** *** 1246,1250 **** $part2 = substr($DHTML_txt_warning, strpos($DHTML_txt_warning, '<!-- notice end -->')); ! $DHTML_txt_warning = $part1.'<tr><td width="20%">'.$omitting_why.'</td><td width="80%">'.$omitting_str.'</td></tr>'.$part2; echo '<SCRIPT>document.getElementById("notices").innerHTML='.$DHTML_txt_warning.'</SCRIPT>'; --- 1246,1250 ---- $part2 = substr($DHTML_txt_warning, strpos($DHTML_txt_warning, '<!-- notice end -->')); ! $DHTML_txt_warning = $part1.'<tr><td class="admintable" width="20%">'.$omitting_why.'</td><td class="admintable" width="80%">'.$omitting_str.'</td></tr>'.$part2; echo '<SCRIPT>document.getElementById("notices").innerHTML='.$DHTML_txt_warning.'</SCRIPT>'; *************** *** 1281,1285 **** $part2 = substr($DHTML_txt_warning, strpos($DHTML_txt_warning, '<!-- notice end -->')); ! $DHTML_txt_warning = $part1.'<tr><td width="20%">'.$omitting_why.'</td><td width="80%">'.$omitting_str.'</td></tr>'.$part2; echo '<SCRIPT>document.getElementById("notices").innerHTML='.$DHTML_txt_warning.'</SCRIPT>'; --- 1281,1285 ---- $part2 = substr($DHTML_txt_warning, strpos($DHTML_txt_warning, '<!-- notice end -->')); ! $DHTML_txt_warning = $part1.'<tr><td class="admintable" width="20%">'.$omitting_why.'</td><td class="admintable" width="80%">'.$omitting_str.'</td></tr>'.$part2; echo '<SCRIPT>document.getElementById("notices").innerHTML='.$DHTML_txt_warning.'</SCRIPT>'; *************** *** 1863,1867 **** $part2 = substr($DHTML_txt_warning, strpos($DHTML_txt_warning, '<!-- notice end -->')); ! $DHTML_txt_warning = $part1.'<tr><td width="20%">'.$omitting_why.'</td><td width="80%">'.$omitting_str.'</td></tr>'.$part2; echo '<SCRIPT>document.getElementById("notices").innerHTML='.$DHTML_txt_warning.'</SCRIPT>'; --- 1863,1867 ---- $part2 = substr($DHTML_txt_warning, strpos($DHTML_txt_warning, '<!-- notice end -->')); ! $DHTML_txt_warning = $part1.'<tr><td class="admintable" width="20%">'.$omitting_why.'</td><td class="admintable" width="80%">'.$omitting_str.'</td></tr>'.$part2; echo '<SCRIPT>document.getElementById("notices").innerHTML='.$DHTML_txt_warning.'</SCRIPT>'; |
From: <bz...@us...> - 2007-10-10 09:15:46
|
Revision: 4774 http://linpha.svn.sourceforge.net/linpha/?rev=4774&view=rev Author: bzrudi Date: 2007-10-10 02:15:41 -0700 (Wed, 10 Oct 2007) Log Message: ----------- "minor fix" Modified Paths: -------------- trunk/linpha2/install/lib.requirements.php trunk/linpha2/install/step11_finish.php Modified: trunk/linpha2/install/lib.requirements.php =================================================================== --- trunk/linpha2/install/lib.requirements.php 2007-10-09 16:34:51 UTC (rev 4773) +++ trunk/linpha2/install/lib.requirements.php 2007-10-10 09:15:41 UTC (rev 4774) @@ -115,10 +115,6 @@ if($pos === false) { - /** - * wrong convert found ?! - * @todo we should now set use_convert to '0' ?! - */ $version = ''; } else @@ -131,7 +127,7 @@ else { /** - * convert not found... + * perl not found... */ $array = array(0,'',''); } Modified: trunk/linpha2/install/step11_finish.php =================================================================== --- trunk/linpha2/install/step11_finish.php 2007-10-09 16:34:51 UTC (rev 4773) +++ trunk/linpha2/install/step11_finish.php 2007-10-10 09:15:41 UTC (rev 4774) @@ -88,8 +88,8 @@ { $result = $linpha->db->Execute("INSERT INTO ".LIN_PREFIX."config " . "(option_value, option_name) VALUES (" . - "'".LinSql::linAddslashes('sys_public_installation')."', " . - "'".LinSql::linAddslashes($_POST['sys_public_installation'])."')"); + "'".LinSql::linAddslashes($_POST['sys_public_installation'])."', " . + "'".LinSql::linAddslashes('sys_public_installation')."')"); if(!$result) { echo failed_msg(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bz...@us...> - 2007-10-09 16:34:53
|
Revision: 4773 http://linpha.svn.sourceforge.net/linpha/?rev=4773&view=rev Author: bzrudi Date: 2007-10-09 09:34:51 -0700 (Tue, 09 Oct 2007) Log Message: ----------- "mac exiftool fallback to unix default" Modified Paths: -------------- trunk/linpha2/lib/classes/linpha.exiftool.class.php Modified: trunk/linpha2/lib/classes/linpha.exiftool.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.exiftool.class.php 2007-10-09 16:24:23 UTC (rev 4772) +++ trunk/linpha2/lib/classes/linpha.exiftool.class.php 2007-10-09 16:34:51 UTC (rev 4773) @@ -50,7 +50,14 @@ else // Macintosh - Seems that exiftool will be installed into /usr/bin // by default when using the install package *.dmg { - $this->exiftool = '/usr/bin/exiftool'; + if(file_exists('/usr/bin/exiftool')) + { + $this->exiftool = '/usr/bin/exiftool'; + } + else // fallback to UNIX default - may work ! + { + $this->exiftool = LINPHA_DIR.'/lib/exiftool/exiftool'; + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bz...@us...> - 2007-10-09 16:24:25
|
Revision: 4772 http://linpha.svn.sourceforge.net/linpha/?rev=4772&view=rev Author: bzrudi Date: 2007-10-09 09:24:23 -0700 (Tue, 09 Oct 2007) Log Message: ----------- "cosmetics " Modified Paths: -------------- trunk/linpha2/install/step10_postsettings.php trunk/linpha2/install/step11_finish.php Modified: trunk/linpha2/install/step10_postsettings.php =================================================================== --- trunk/linpha2/install/step10_postsettings.php 2007-10-09 16:18:08 UTC (rev 4771) +++ trunk/linpha2/install/step10_postsettings.php 2007-10-09 16:24:23 UTC (rev 4772) @@ -80,7 +80,7 @@ <?php echo "<h2>".i18n_install("Please Choose LinPHA2 Install Location")."</h2><hr>"; -echo i18n_install("Internet - Public available over the Internet.")."<br />"; +echo i18n_install("Internet - Public Available Over The Internet.")."<br />"; echo i18n_install("Intranet - Running In A Secure Local Network")."<br /><br />"; ?> <div align="center"> Modified: trunk/linpha2/install/step11_finish.php =================================================================== --- trunk/linpha2/install/step11_finish.php 2007-10-09 16:18:08 UTC (rev 4771) +++ trunk/linpha2/install/step11_finish.php 2007-10-09 16:24:23 UTC (rev 4772) @@ -87,8 +87,8 @@ if( isset( $_POST['sys_public_installation'] ) ) { $result = $linpha->db->Execute("INSERT INTO ".LIN_PREFIX."config " . - "(option_value, option_name) VALUES " . - "('".LinSql::linAddslashes('sys_public_installation')."', " . + "(option_value, option_name) VALUES (" . + "'".LinSql::linAddslashes('sys_public_installation')."', " . "'".LinSql::linAddslashes($_POST['sys_public_installation'])."')"); if(!$result) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bz...@us...> - 2007-10-09 16:18:11
|
Revision: 4771 http://linpha.svn.sourceforge.net/linpha/?rev=4771&view=rev Author: bzrudi Date: 2007-10-09 09:18:08 -0700 (Tue, 09 Oct 2007) Log Message: ----------- "Add new Option to Installer 'Install Location'" Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/install/step10_postsettings.php trunk/linpha2/install/step11_finish.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2007-10-09 15:35:23 UTC (rev 4770) +++ trunk/linpha2/ChangeLog 2007-10-09 16:18:08 UTC (rev 4771) @@ -1,5 +1,11 @@ 2007-10-09 bzrudi * Make Exiftool work with MAC OS!? ;-) + * Add new Option to Installer 'Install Location' from where you choose + if LinPHA will be installad public (Internet), or just local (Intranet). + This helps us to decide which operations to allow later. Think of image + tagging, rotating, deleting and so on. IMHO all this should be disabled + on public servers by default. + Config entry for this 'sys_public_installation' isn't used anywhere for now 2007-09-01 flo * worked some more on the maps plugin Modified: trunk/linpha2/install/step10_postsettings.php =================================================================== --- trunk/linpha2/install/step10_postsettings.php 2007-10-09 15:35:23 UTC (rev 4770) +++ trunk/linpha2/install/step10_postsettings.php 2007-10-09 16:18:08 UTC (rev 4771) @@ -78,7 +78,22 @@ </div> <br /> +<?php +echo "<h2>".i18n_install("Please Choose LinPHA2 Install Location")."</h2><hr>"; +echo i18n_install("Internet - Public available over the Internet.")."<br />"; +echo i18n_install("Intranet - Running In A Secure Local Network")."<br /><br />"; +?> +<div align="center"> + <div class="box4"> + <input type='radio' name='sys_public_installation' value='1' checked=checked> + <?php echo i18n_install("Internet"); ?> + <input type='radio' name='sys_public_installation' value='0' > + <?php echo i18n_install("Intranet"); ?> + </div> +</div> +<br /> + <?php $query = $linpha->db->Execute("SELECT option_value FROM ".LIN_PREFIX."config " . "WHERE option_name='sys_im_use_imagemagick'"); Modified: trunk/linpha2/install/step11_finish.php =================================================================== --- trunk/linpha2/install/step11_finish.php 2007-10-09 15:35:23 UTC (rev 4770) +++ trunk/linpha2/install/step11_finish.php 2007-10-09 16:18:08 UTC (rev 4771) @@ -79,7 +79,34 @@ echo success_msg(); } + /** + * save installation type internet/intranet + */ +echo "<br />".i18n_install("Saving Install Type (Internet/Intranet) To Database...").' '; +if( isset( $_POST['sys_public_installation'] ) ) +{ + $result = $linpha->db->Execute("INSERT INTO ".LIN_PREFIX."config " . + "(option_value, option_name) VALUES " . + "('".LinSql::linAddslashes('sys_public_installation')."', " . + "'".LinSql::linAddslashes($_POST['sys_public_installation'])."')"); + if(!$result) + { + echo failed_msg(); + } + else + { + echo success_msg(); + } +} +else +{ + echo failed_msg(); + echo "<br />".i18n_install("Error - No Value Specified!"); + $error_nr = 1; +} + +/** * save thumbnails default size */ echo "<br />".i18n_install("Saving Thumbnail Size To Database...").' '; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bz...@us...> - 2007-10-09 15:35:28
|
Revision: 4770 http://linpha.svn.sourceforge.net/linpha/?rev=4770&view=rev Author: bzrudi Date: 2007-10-09 08:35:23 -0700 (Tue, 09 Oct 2007) Log Message: ----------- "exiftool mac support !? ;-)" Modified Paths: -------------- trunk/linpha2/lib/classes/linpha.exiftool.class.php Modified: trunk/linpha2/lib/classes/linpha.exiftool.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.exiftool.class.php 2007-10-09 15:35:10 UTC (rev 4769) +++ trunk/linpha2/lib/classes/linpha.exiftool.class.php 2007-10-09 15:35:23 UTC (rev 4770) @@ -47,10 +47,10 @@ { $this->exiftool = LINPHA_DIR.'\lib\exiftool\exiftool.exe'; // forward slashes will not work } - else // Macintosh + else // Macintosh - Seems that exiftool will be installed into /usr/bin + // by default when using the install package *.dmg { - $this->exiftool = LINPHA_DIR.'/lib/exiftool/exiftool.???'; - + $this->exiftool = '/usr/bin/exiftool'; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bz...@us...> - 2007-10-09 15:35:16
|
Revision: 4769 http://linpha.svn.sourceforge.net/linpha/?rev=4769&view=rev Author: bzrudi Date: 2007-10-09 08:35:10 -0700 (Tue, 09 Oct 2007) Log Message: ----------- "exiftool mac support !? ;-)" Modified Paths: -------------- trunk/linpha2/ChangeLog Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2007-09-01 22:55:23 UTC (rev 4768) +++ trunk/linpha2/ChangeLog 2007-10-09 15:35:10 UTC (rev 4769) @@ -1,3 +1,6 @@ +2007-10-09 bzrudi + * Make Exiftool work with MAC OS!? ;-) + 2007-09-01 flo * worked some more on the maps plugin - save and load markers is now working This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: bzrudi <bz...@us...> - 2007-10-04 07:56:25
|
Update of /cvsroot/linpha/linpha In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30329 Modified Files: ChangeLog Log Message: new language files - thanks to Bell Lu! Index: ChangeLog =================================================================== RCS file: /cvsroot/linpha/linpha/ChangeLog,v retrieving revision 1.1267 retrieving revision 1.1268 diff -C2 -d -r1.1267 -r1.1268 *** ChangeLog 13 Aug 2007 10:31:22 -0000 1.1267 --- ChangeLog 4 Oct 2007 07:56:08 -0000 1.1268 *************** *** 1,2 **** --- 1,6 ---- + 2007-10-04 bzrudi + * add new language files - thanks to Bell Lu! + lang.zh-tw_big5.php, lang.zh-tw_utf8.php + 2007-08-13 vytautas * replace all stripos with strpos for php4 compatability |
From: bzrudi <bz...@us...> - 2007-10-04 07:56:15
|
Update of /cvsroot/linpha/linpha/lang In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30329/lang Added Files: lang.zh-tw_utf8.php lang.zh-tw_big5.php Log Message: new language files - thanks to Bell Lu! --- NEW FILE: lang.zh-tw_utf8.php --- <?php /* language file */ /* Feel free to modify this file to make use of your native language. If you do so, please save it as lang.YourLanguage.php in the LinPHA /lang dir and PLEASE mail me a copy! mailto:bz...@tu... */ /** for the translators do not forget this changes!! 02. Aug 2004 $path_2_cache changed default path from '/sql/cache' to 'sql/cache' 10. Sep 2004 $href_user_conf removed 'group' 10. Sep 2004 $new_user_name_info removed ':' 09. Oct 2004 $session_path_found_msg remvoed part "LinPHA login should work properly." 09. Oct 2004 $session_path_miss_msg removed part "You MUST set session_save_path in php.ini or you will NOT be able to be login later!!" 09. Oct 2004 $session_path_check_msg outdated, can be deleted 11. Oct 2004 renamed $basedir_activE_msg to $basedir_active_msg 11. Oct 2004 outdated, to delete: $basedir_active_msg1, $gd_basedir_err [...1106 lines suppressed...] $map_type_ctrl="ååå°åé¡åæ§å¶"; /* (maps plugin) -- */ $map_type_ctrl_info="<-- 顯示å°åä¸çå°åé¡åæ§å¶"; /* (maps plugin) -- */ $map_slide_ctrl="ååå°åæ»åæ§å¶"; /* (maps plugin) -- */ $map_slide_ctrl_info="<-- 顯示å°åä¸çå°åæ»åæ§å¶"; /* (maps plugin) -- */ $map_pan_ctrl="ååå°å平移æ§å¶"; /* (maps plugin) -- */ $map_pan_ctrl_info="<-- 顯示å°åä¸çå°å平移æ§å¶"; /* (maps plugin) -- */ $map_auto_popup="ååæ¨ç¤ºèªåè·³åºåè½"; /* (maps plugin) -- */ $map_auto_popup_info="<-- ç¶æ»é¼ ç§»éæèªåè·³åºæ¨ç¤º"; /* (maps plugin) -- */ $map_album_add="æ°å¢ç¸æ¬"; /* (maps plugin) -- */ $map_marker_del="åªé¤æ¨ç¤º"; /* (maps plugin) -- */ $map_search_location="æå°/æ°å¢ ä½ç½®"; /* (maps plugin) -- */ $map_location_here="ä½ ç¾å¨çä½ç½®"; /* (maps plugin) -- */ $map_search_loc_button="æå°ä½ç½®"; /* (maps plugin) -- */ $map_add_location="æ°å¢ä½ç½®"; /* (maps plugin) -- */ $map_assign_album="ææ´¾ç¸æ¬å°å°åä½ç½®"; /* (maps plugin) -- */ $general_ignored_files="æ¶èä¸è¦å¿½ç¥çæªæ¡"; /* (build_general_config.php) -- */ $general_ignored_files_info="<-- è¦å¿½ç¥çæªæ¡files to ignore (ç¨ , (éè)åé)"; /* (build_general_config.php) -- */ $general_ignored_fileext="æ¶èä¸è¦å¿½ç¥çé屬æªå"; /* (build_general_config.php) -- */ $general_ignored_fileext_info="<-- è¦å¿½ç¥çé屬æªå (ç¨ , (éè)åé)"; /*(build_general_config.php) -- */ ?> --- NEW FILE: lang.zh-tw_big5.php --- <?php /* language file */ /* Feel free to modify this file to make use of your native language. If you do so, please save it as lang.YourLanguage.php in the LinPHA /lang dir and PLEASE mail me a copy! mailto:bz...@tu... */ /** for the translators do not forget this changes!! 02. Aug 2004 $path_2_cache changed default path from '/sql/cache' to 'sql/cache' 10. Sep 2004 $href_user_conf removed 'group' 10. Sep 2004 $new_user_name_info removed ':' 09. Oct 2004 $session_path_found_msg remvoed part "LinPHA login should work properly." 09. Oct 2004 $session_path_miss_msg removed part "You MUST set session_save_path in php.ini or you will NOT be able to be login later!!" 09. Oct 2004 $session_path_check_msg outdated, can be deleted 11. Oct 2004 renamed $basedir_activE_msg to $basedir_active_msg 11. Oct 2004 outdated, to delete: $basedir_active_msg1, $gd_basedir_err [...1106 lines suppressed...] $map_type_ctrl="±Ò°Ê¦a¹ÏÃþ«¬±±¨î"; /* (maps plugin) -- */ $map_type_ctrl_info="<-- Åã¥Ü¦a¹Ï¤Wªº¦a¹ÏÃþ«¬±±¨î"; /* (maps plugin) -- */ $map_slide_ctrl="±Ò°Ê¦a¹Ï·Æ°Ê±±¨î"; /* (maps plugin) -- */ $map_slide_ctrl_info="<-- Åã¥Ü¦a¹Ï¤Wªº¦a¹Ï·Æ°Ê±±¨î"; /* (maps plugin) -- */ $map_pan_ctrl="±Ò°Ê¦a¹Ï¥²¾±±¨î"; /* (maps plugin) -- */ $map_pan_ctrl_info="<-- Åã¥Ü¦a¹Ï¤Wªº¦a¹Ï¥²¾±±¨î"; /* (maps plugin) -- */ $map_auto_popup="±Ò°Ê¼Ð¥Ü¦Û°Ê¸õ¥X¥\¯à"; /* (maps plugin) -- */ $map_auto_popup_info="<-- ·í·Æ¹«²¾¹L®É¦Û°Ê¸õ¥X¼Ð¥Ü"; /* (maps plugin) -- */ $map_album_add="·s¼W¬Û¥»"; /* (maps plugin) -- */ $map_marker_del="§R°£¼Ð¥Ü"; /* (maps plugin) -- */ $map_search_location="·j´M/·s¼W ¦ì¸m"; /* (maps plugin) -- */ $map_location_here="§A²{¦bªº¦ì¸m"; /* (maps plugin) -- */ $map_search_loc_button="·j´M¦ì¸m"; /* (maps plugin) -- */ $map_add_location="·s¼W¦ì¸m"; /* (maps plugin) -- */ $map_assign_album="«ü¬£¬Û¥»¨ì¦a¹Ï¦ì¸m"; /* (maps plugin) -- */ $general_ignored_files="¦¬Âä¤n©¿²¤ªºÀÉ®×"; /* (build_general_config.php) -- */ $general_ignored_files_info="<-- n©¿²¤ªºÀÉ®×files to ignore (¥Î , (³r¸¹)¤À¹j)"; /* (build_general_config.php) -- */ $general_ignored_fileext="¦¬Âä¤n©¿²¤ªºªþÄÝÀɦW"; /* (build_general_config.php) -- */ $general_ignored_fileext_info="<-- n©¿²¤ªºªþÄÝÀɦW (¥Î , (³r¸¹)¤À¹j)"; /*(build_general_config.php) -- */ ?> |
From: Florian A. <flo...@ya...> - 2007-09-12 17:15:03
|
http://www.pcwelt.de/start/dsl_voip/online/news/93351/index.html?NLC-Newsletter&id=93351 |
From: <fan...@us...> - 2007-09-01 22:55:31
|
Revision: 4768 http://linpha.svn.sourceforge.net/linpha/?rev=4768&view=rev Author: fangehrn Date: 2007-09-01 15:55:23 -0700 (Sat, 01 Sep 2007) Log Message: ----------- 2007-09-01 flo * worked some more on the maps plugin - save and load markers is now working Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/docs/dev/TODO.txt trunk/linpha2/index.php trunk/linpha2/install/sql/sql.data.php trunk/linpha2/install/sql/sql.mysql.php trunk/linpha2/install/sql/sql.tables.php trunk/linpha2/lib/adodb/adodb-errorhandler.inc.php trunk/linpha2/lib/classes/linpha.sql.class.php trunk/linpha2/lib/plugins/maps/LinMaps.js trunk/linpha2/lib/plugins/maps/module.exampleMap.php trunk/linpha2/templates/default/map.head.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2007-08-23 19:14:12 UTC (rev 4767) +++ trunk/linpha2/ChangeLog 2007-09-01 22:55:23 UTC (rev 4768) @@ -1,3 +1,7 @@ +2007-09-01 flo + * worked some more on the maps plugin + - save and load markers is now working + 2007-08-23 bzrudi * Make Exiftool work with GPS EXIF data Modified: trunk/linpha2/docs/dev/TODO.txt =================================================================== --- trunk/linpha2/docs/dev/TODO.txt 2007-08-23 19:14:12 UTC (rev 4767) +++ trunk/linpha2/docs/dev/TODO.txt 2007-09-01 22:55:23 UTC (rev 4768) @@ -37,6 +37,8 @@ - should enable browsers cache for the thumbnails and maybe also for the images +- fix error handler + ## Big Todos - Common Tasks @@ -54,6 +56,8 @@ -> otherwise it would be possible to overwrite the current installation, (and to delete cache folders) - DONT add feature to drop tables if they already exists - add Usage link after installation has been successfully finished + - dont create tables which start with plugins_ automatically + provide plugin interface to create such tables while activating plugin - Plugins (copy from linpha1) - Guestbook, first apply patch with security image Modified: trunk/linpha2/index.php =================================================================== --- trunk/linpha2/index.php 2007-08-23 19:14:12 UTC (rev 4767) +++ trunk/linpha2/index.php 2007-09-01 22:55:23 UTC (rev 4768) @@ -73,7 +73,7 @@ // plugins -case 'map': +case 'maps': /** * @todo check if plugin enabled */ @@ -86,4 +86,4 @@ break; } -?> +?> \ No newline at end of file Modified: trunk/linpha2/install/sql/sql.data.php =================================================================== --- trunk/linpha2/install/sql/sql.data.php 2007-08-23 19:14:12 UTC (rev 4767) +++ trunk/linpha2/install/sql/sql.data.php 2007-09-01 22:55:23 UTC (rev 4768) @@ -107,7 +107,9 @@ 'plugins_log_email_subject' => 'Linpha Log', 'plugins_filemanager_enable' => '0', - 'plugins_filemanager_nruploads' => '5' + 'plugins_filemanager_nruploads' => '5', + + 'plugins_maps_defaultMarkerZoom' => '10', ); $options_user_overrideable = Array( Modified: trunk/linpha2/install/sql/sql.mysql.php =================================================================== --- trunk/linpha2/install/sql/sql.mysql.php 2007-08-23 19:14:12 UTC (rev 4767) +++ trunk/linpha2/install/sql/sql.mysql.php 2007-09-01 22:55:23 UTC (rev 4768) @@ -144,6 +144,16 @@ "md5sum VARCHAR(32) NOT NULL default '', " . "meta_data VARCHAR(255) NOT NULL default '', " . "PRIMARY KEY (id) " . + ")", + "CREATE TABLE ".$linpha_tables['plugins_maps_markers']." ( ". + "id INT NOT NULL AUTO_INCREMENT, " . + "albId INT NOT NULL default '0', " . + "albPath VARCHAR(255) NOT NULL default '', " . + "markerName VARCHAR(255) NOT NULL default '', " . + "markerLat VARCHAR(255) NOT NULL default '', " . + "markerLon VARCHAR(255) NOT NULL default '', " . + "markerZoom INT NOT NULL default '0', " . + "PRIMARY KEY (id) " . ")" ); ?> Modified: trunk/linpha2/install/sql/sql.tables.php =================================================================== --- trunk/linpha2/install/sql/sql.tables.php 2007-08-23 19:14:12 UTC (rev 4767) +++ trunk/linpha2/install/sql/sql.tables.php 2007-09-01 22:55:23 UTC (rev 4768) @@ -35,6 +35,7 @@ "meta_iptc" => "meta_iptc", "meta_xmp" => "meta_xmp", "meta_comments" => "meta_comments", - "meta_data" => "meta_data" + "meta_data" => "meta_data", + "plugins_maps_markers" => "plugins_maps_markers" ); ?> Modified: trunk/linpha2/lib/adodb/adodb-errorhandler.inc.php =================================================================== --- trunk/linpha2/lib/adodb/adodb-errorhandler.inc.php 2007-08-23 19:14:12 UTC (rev 4767) +++ trunk/linpha2/lib/adodb/adodb-errorhandler.inc.php 2007-09-01 22:55:23 UTC (rev 4768) @@ -30,6 +30,7 @@ */ function ADODB_Error_Handler($dbms, $fn, $errno, $errmsg, $p1, $p2, &$thisConnection) { + echo 'hi'; if (error_reporting() == 0) return; // obey @ protocol switch($fn) { case 'EXECUTE': Modified: trunk/linpha2/lib/classes/linpha.sql.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.sql.class.php 2007-08-23 19:14:12 UTC (rev 4767) +++ trunk/linpha2/lib/classes/linpha.sql.class.php 2007-09-01 22:55:23 UTC (rev 4768) @@ -55,8 +55,11 @@ } else { + /** + * this seems to does not work correctly anymore error_reporting(0); include_once(LINPHA_DIR.'/lib/adodb/adodb-errorhandler.inc.php'); + */ $sql_dir = ''; include(LINPHA_DIR.'/var/config.dir.php'); // no include_once if we reconnect from another directory... Modified: trunk/linpha2/lib/plugins/maps/LinMaps.js =================================================================== --- trunk/linpha2/lib/plugins/maps/LinMaps.js 2007-08-23 19:14:12 UTC (rev 4767) +++ trunk/linpha2/lib/plugins/maps/LinMaps.js 2007-09-01 22:55:23 UTC (rev 4768) @@ -15,7 +15,11 @@ { this.editMarker = false; this.navIsHidden = false; - this.defaultMarkerZoom = 10; + this.defaultMarkerZoom = linMapsDefaultZoomSize; + + this.markersData = false; + this.markersObj = false; + this.bounds = false; }, /** @@ -23,8 +27,67 @@ */ loadMarkers: function() { + myLinGlobal.AjaxPost('cmd=loadMarkers',myLinMaps.showMarkers); + }, + showMarkers: function(t) + { + myLinMaps.markersData = eval('(' + t.responseText + ')'); + //myLinMaps.markers = t.responseText.evalJSON(true); + + /** + * delete existing markers + */ + if( myLinMaps.markersObj ) + { + for( i = 0; i < myLinMaps.markersObj.length; i++ ) + { + map.removeOverlay( myLinMaps.markersObj[i] ); + } + + myLinMaps.markersObj = false; + } + + /** + * draw new markers + */ + myLinMaps.bounds = new GLatLngBounds(); + for( i = 0; i < myLinMaps.markersData.markers.length; i++ ) + { + myLinMaps.markersObj[i] = myLinMaps.createMarker( myLinMaps.markersData.markers[i] ); + } + + map.setCenter(myLinMaps.bounds.getCenter(), map.getBoundsZoomLevel(myLinMaps.bounds)); + }, + + createMarker: function( markerNode ) + { + /*var icon = new GIcon(); + icon.image = image[0]; + icon.iconSize = new GSize(image[1], image[2]); + subt = image[2] / 100 * 11; + subt = Math.ceil(subt); + var anchor = image[2] - subt; + icon.iconAnchor= new GPoint(10, anchor); + //{icon: icon, draggable: true}*/ + + //alert( markerNode.id + ' ' + markerNode.name + ' ' + markerNode.lat + ' ' + markerNode.lon); + + var point = new GLatLng( markerNode.lat, markerNode.lon); + var marker = new GMarker(point/*, icon*/); + + GEvent.addListener(marker, "click", function() { + marker.openInfoWindowHtml( '<b>' + markerNode.name + '</b><br />' + markerNode.id ); + }); + + map.addOverlay( marker ); + + this.bounds.extend(point); + + return marker; + }, + geocodeAddress: function(address) { if( this.editMarker ) @@ -79,17 +142,19 @@ }, updateEditMarker: function() { - if( this.editMarker ) + if( myLinMaps.editMarker ) // marker activated, use myLinMaps. instead of this. when fired from GEvent class { - latlng = this.editMarker.getPoint(); + latlng = myLinMaps.editMarker.getPoint(); $('linInputLat').value = latlng.lat(); $('linInputLon').value = latlng.lng(); + $('linInputZoom').value = map.getZoom(); } else { $('linInputMarkerName').value = ''; $('linInputLat').value = ''; $('linInputLon').value = ''; + $('linInputZoom').value = ''; } }, saveMarker: function(t) @@ -201,6 +266,9 @@ linEnableOnResize(); linOnResizeWrapper(); + GEvent.addListener(map, "zoomend", myLinMaps.updateEditMarker); + + myLinMaps.loadMarkers(); } //initLinMaps(); Modified: trunk/linpha2/lib/plugins/maps/module.exampleMap.php =================================================================== --- trunk/linpha2/lib/plugins/maps/module.exampleMap.php 2007-08-23 19:14:12 UTC (rev 4767) +++ trunk/linpha2/lib/plugins/maps/module.exampleMap.php 2007-09-01 22:55:23 UTC (rev 4768) @@ -1,295 +1,352 @@ -<?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'); - +<?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"); +$urlFull = LINPHA_LINK.'&linCat=maps'; + +if(isset($_GET['xml'])) +{ + if(isset($_POST['cmd'])) + { + switch($_POST['cmd']) + { + case 'loadMarkers': + + echo '{ "markers": [' . "\n"; + + $query = $GLOBALS['linpha']->db->Execute( + "SELECT id, albId, albPath, markerName, markerLat, markerLon, markerZoom " . + "FROM ".LIN_PREFIX."plugins_maps_markers" + ); + + while($data = $query->FetchRow()) + { + echo '{"id": '.$data['id'].', "albId": '.$data['albId'].', "path": "'.htmlspecialchars($data['albPath'],ENT_QUOTES).'", ' . + '"name": "'.htmlspecialchars($data['markerName'],ENT_QUOTES).'", ' . + '"lat": '.$data['markerLat'].', "lon": '.$data['markerLon'].', ' . + '"zoom": '.$data['markerZoom'].'},'. "\n"; + } + + /* + ?> + { + "markers": [ + {"id": 1, "path": "../../asd", "name": "my sweet home 1", "lat": 47.487868258751625, "lon": 9.388654232025146, "zoom": 17}, + {"id": 2, "path": "../../asd2", "name": "my sweet home 2", "lat": 47.587868258751625, "lon": 9.388654232025146, "zoom": 10}, + {"id": 3, "path": "../../asd3", "name": "my sweet home 3", "lat": 47.687868258751625, "lon": 9.388654232025146, "zoom": 15}, + ] + } + <?php + */ + + echo '] }' . "\n"; + + break; + + case 'saveMarker': + case 'editMarker': + + header('Content-type: text/xml'); + echo '<?xml version="1.0" ?>'."\n"; + echo '<root>'."\n"; + + 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 + { + if( !isset($_POST['linInputZoom']) OR empty($_POST['linInputZoom']) ) + { + $_POST['linInputZoom'] = $GLOBALS['linpha']->sql->config->value['plugins_maps_defaultMarkerZoom']; + } + + if( $_POST['cmd'] == 'saveMarker' ) + { + $GLOBALS['linpha']->db->Execute("INSERT INTO ".LIN_PREFIX."plugins_maps_markers " . + "(markerName, markerLat, markerLon, markerZoom) " . + "VALUES (" . + "'".LinSql::linAddslashes($_POST['linInputMarkerName'])."', " . + "'".floatval($_POST['linInputLat'])."', " . + "'".floatval($_POST['linInputLon'])."', " . + "'".intval($_POST['linInputZoom'])."')" + ); + } + else // edit Marker + { + if( !isset($_POST['linInputMarkerId']) OR empty($_POST['linInputMarkerId']) ) + { + echo '<responseCode>failed</responseCode>'."\n"; + echo '<responseMsg>'.i18n("Error: No valid marker").'</responseMsg>'."\n"; + } + } + + echo '<responseCode>success</responseCode>'."\n"; + } + + echo '</root>'."\n"; + + break; + } + } + + 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="<?php /* <?php echo $urlFull; ?>&xml */ + ?>" 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 /> + <label for="linInputZoom" style="display: block; float: left; width: 150px;">Zoom: + </label><input type="text" id="linInputZoom" name="linInputZoom" 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=maps&albId=0">'.i18n("All albums").'</a><br />'; + + foreach($parentIds as $id=>$value) + { + echo '<a href="'.LINPHA_LINK.'&linCat=maps&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> + Not assigned images:<br /> + albums/album1 (22 images)<br /> + </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\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 = $urlFull; +$linpha->template->URL_base = $urlFull; +$linpha->template->output['title'] = i18n("Google Maps"); +include_once(LINPHA_DIR.'/templates/'.$linpha->template->template_name.'/global.html.php'); + + function getExifLatLon(&$LatLon) { /*Array PJMT @@ -345,4 +402,4 @@ } return $return; } -?> +?> \ No newline at end of file Modified: trunk/linpha2/templates/default/map.head.php =================================================================== --- trunk/linpha2/templates/default/map.head.php 2007-08-23 19:14:12 UTC (rev 4767) +++ trunk/linpha2/templates/default/map.head.php 2007-09-01 22:55:23 UTC (rev 4768) @@ -11,4 +11,6 @@ var maxImageHeight = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_image_height']; ?>; var maxThumbSize = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_max']; ?>; var displayThumbSize = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; ?>; + +var linMapsDefaultZoomSize = <?php echo $GLOBALS['linpha']->sql->config->value['plugins_maps_defaultMarkerZoom']; ?>; </script> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <fan...@us...> - 2007-08-20 22:19:11
|
Revision: 4766 http://linpha.svn.sourceforge.net/linpha/?rev=4766&view=rev Author: fangehrn Date: 2007-08-20 15:19:07 -0700 (Mon, 20 Aug 2007) Log Message: ----------- 2007-08-20 flo * google maps - added some basic marker/geocode functions Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/index.php trunk/linpha2/lib/plugins/maps/module.exampleMap.php trunk/linpha2/templates/default/map.head.php Added Paths: ----------- trunk/linpha2/lib/plugins/maps/LinMaps.js Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2007-08-19 22:48:44 UTC (rev 4765) +++ trunk/linpha2/ChangeLog 2007-08-20 22:19:07 UTC (rev 4766) @@ -1,3 +1,7 @@ +2007-08-20 flo + * google maps + - added some basic marker/geocode functions + 2007-08-19 flo * adding google maps support - modified gmapper class: increased the number of paragraphs "no image at this zoomlevel" Modified: trunk/linpha2/index.php =================================================================== --- trunk/linpha2/index.php 2007-08-19 22:48:44 UTC (rev 4765) +++ trunk/linpha2/index.php 2007-08-20 22:19:07 UTC (rev 4766) @@ -67,12 +67,20 @@ case 'download': require_once(LINPHA_DIR.'/lib/modules/module.download.php'); break; +case 'empty': + require_once(LINPHA_DIR.'/lib/modules/module.empty.php'); + break; + + +// plugins case 'map': + /** + * @todo check if plugin enabled + */ require_once(LINPHA_DIR.'/lib/plugins/maps/module.exampleMap.php'); break; -case 'empty': - require_once(LINPHA_DIR.'/lib/modules/module.empty.php'); - break; + + default: require_once(LINPHA_DIR.'/lib/modules/module.empty.php'); break; Added: trunk/linpha2/lib/plugins/maps/LinMaps.js =================================================================== --- trunk/linpha2/lib/plugins/maps/LinMaps.js (rev 0) +++ trunk/linpha2/lib/plugins/maps/LinMaps.js 2007-08-20 22:19:07 UTC (rev 4766) @@ -0,0 +1,213 @@ + +/** + * class and global definitions + */ +var LinMaps = Class.create(); +var myLinMaps; + +LinMaps.prototype = +{ + /** + * initialize() + * Constructor runs on completion of the DOM loading. + */ + initialize: function() + { + this.editMarker = false; + this.navIsHidden = false; + this.defaultMarkerZoom = 10; + }, + + /** + * Marker functions + */ + loadMarkers: function() + { + + }, + geocodeAddress: function(address) + { + if( this.editMarker ) + { + map.removeOverlay( this.editMarker ) + } + + if( address == '' ) + { + this.createEditMarker( map.getCenter() ); + } + else + { + geocoder.getLatLng( + address, + function(point) + { + if(!point) + { + alert(address + " not found"); + } + else + { + map.setCenter(point, myLinMaps.defaultMarkerZoom); + myLinMaps.createEditMarker( point ); + + $('linInputMarkerName').value = address; + } + } + ); + } + }, + createEditMarker: function( center ) + { + this.editMarker = new GMarker(center, {draggable: true}); + + /*GEvent.addListener(marker, "dragstart", function() { + map.closeInfoWindow(); + });*/ + + /*GEvent.addListener(marker, "dragend", function() { + marker.openInfoWindowHtml("Just bouncing along..."); + });*/ + + GEvent.addListener(this.editMarker, "drag", function() { + myLinMaps.updateEditMarker(); + }); + + map.addOverlay( this.editMarker ); + + this.updateEditMarker(); + }, + updateEditMarker: function() + { + if( this.editMarker ) + { + latlng = this.editMarker.getPoint(); + $('linInputLat').value = latlng.lat(); + $('linInputLon').value = latlng.lng(); + } + else + { + $('linInputMarkerName').value = ''; + $('linInputLat').value = ''; + $('linInputLon').value = ''; + } + }, + saveMarker: function(t) + { + xmlAnswer = t.responseXML.documentElement; + + if( xmlAnswer.getElementsByTagName('responseCode').item(0).firstChild.data == 'success' ) + { + map.removeOverlay( myLinMaps.editMarker ); + myLinMaps.editMarker = false; + myLinMaps.updateEditMarker(); + + myLinMaps.loadMarkers(); + } + else + { + alert(xmlAnswer.getElementsByTagName('responseMsg').item(0).firstChild.data ); + } + }, + + + /** + * Thumbnail functions + */ + toggleNav: function() + { + + if( this.navIsHidden ) + { + // restore save margin + $('gmapper_map').style.marginRight = $('linDivMapNav').style.marginRight; + $('linDivMapNav').style.marginRight = 0; + + Element.show('linDivMapNav'); + + this.navIsHidden = false; + } + else + { + Element.hide('linDivMapNav'); + + // backup current margin + $('linDivMapNav').style.marginRight = $('gmapper_map').style.marginRight; + + $('gmapper_map').style.marginRight = 7; + + this.navIsHidden = true; + } + + // update google map size + map.checkResize(); + } + + + + + + + + +} // end class LinMaps + +function linOnResizeWrapper() +{ + myLinGlobal.setWindowSize(); + var newHeight = myLinGlobal.linInnerHeight - $('linDivMain').offsetTop - 80; + if(newHeight < 100) + { + newHeight = 100; + } + + $('linDivMapNav').style.height = newHeight; + $('linDivMapMain').style.height = newHeight; + + + /** + * tempoarely set the map heigth to a small value (zero does not work!) + * in IE setMainHeight() would not work while reducing the window size + * because IE takes always as much space as he actually needs ignoring + * the height attribute + */ + + /*$('linDivMapNav').style.height = 10; + $('linDivMapMain').style.height = 10; + + myLinGlobal.setMainHeight(); + + $('linDivMapMain').style.height = $('linDivMain').offsetHeight - $('linDivMapTop').offsetHeight - $('linDivMapBottom').offsetHeight - 5;*/ + + /** + * set also height of the navigation bar + * overflow:auto does not work in IE with height: 100% + */ + /*$('linDivMapNav').style.height = $('linDivMapMain').style.height;*/ + + // resize google map itself also + map.checkResize(); +} + +/** + * initLinMaps() + * + * create the class object + */ +function initLinMaps() +{ + myLinMaps = new LinMaps(); + + linEnableOnResize(); + linOnResizeWrapper(); + +} + +//initLinMaps(); +Event.observe(window, 'load', initLinMaps, false); + +// prevent memory leaks in internet explorer +Event.observe(window, 'unload', GUnload, false); + + + Modified: trunk/linpha2/lib/plugins/maps/module.exampleMap.php =================================================================== --- trunk/linpha2/lib/plugins/maps/module.exampleMap.php 2007-08-19 22:48:44 UTC (rev 4765) +++ trunk/linpha2/lib/plugins/maps/module.exampleMap.php 2007-08-20 22:19:07 UTC (rev 4766) @@ -1,6 +1,80 @@ <?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']); } @@ -27,20 +101,7 @@ ob_start(); ?> - <div id="linDivMapTop"> - <?php - 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> + <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;"> @@ -56,6 +117,31 @@ </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> @@ -66,7 +152,58 @@ "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, @@ -149,6 +286,7 @@ $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'); Modified: trunk/linpha2/templates/default/map.head.php =================================================================== --- trunk/linpha2/templates/default/map.head.php 2007-08-19 22:48:44 UTC (rev 4765) +++ trunk/linpha2/templates/default/map.head.php 2007-08-20 22:19:07 UTC (rev 4766) @@ -2,74 +2,13 @@ $linTpl->output['googleMap']->headjs(); ?> <script type="text/javascript" language="JavaScript" src="<?php echo LINPHA_CLIENT; ?>/lib/plugins/maps/gmapper1/bodyjs.js"></script> -<script language="JavaScript" type="text/javascript"> - -var linNavIsHidden = false; -function linToggleNav() -{ - - if( linNavIsHidden ) - { - // restore save margin - $('gmapper_map').style.marginRight = $('linDivMapNav').style.marginRight; - $('linDivMapNav').style.marginRight = 0; - - Element.show('linDivMapNav'); - - linNavIsHidden = false; - } - else - { - Element.hide('linDivMapNav'); - - // backup current margin - $('linDivMapNav').style.marginRight = $('gmapper_map').style.marginRight; - - $('gmapper_map').style.marginRight = 7; - - linNavIsHidden = true; - } - - // update google map size - map.checkResize(); -} - - - -function linOnResizeWrapper() -{ - /** - * tempoarely set the map heigth to a small value (zero does not work!) - * in IE setMainHeight() would not work while reducing the window size - * because IE takes always as much space as he actually needs ignoring - * the height attribute - */ - - $('linDivMapNav').style.height = 10; - $('linDivMapMain').style.height = 10; - - myLinGlobal.setMainHeight(); - - $('linDivMapMain').style.height = $('linDivMain').offsetHeight - $('linDivMapTop').offsetHeight - $('linDivMapBottom').offsetHeight - 5; - - /** - * set also height of the navigation bar - * overflow:auto does not work in IE with height: 100% - */ - $('linDivMapNav').style.height = $('linDivMapMain').style.height; - - // resize google map itself also - map.checkResize(); -} - -function initLinMap() -{ - linEnableOnResize(); - linOnResizeWrapper(); -} -Event.observe(window, 'load', initLinMap, false); - -// prevent memory leaks in internet explorer -Event.observe(window, 'unload', GUnload, false); -</script> - \ No newline at end of file +<script type="text/javascript" language="JavaScript" src="<?php echo LINPHA_CLIENT; ?>/lib/plugins/maps/LinMaps.js"></script> +<script language="JavaScript" type="text/javascript"> +var xmlUrl = '<?php echo linConvertAmp($linTpl->URL_base); ?>'; +var imageSrc = '<?php echo LINPHA_CLIENT.'/get_image.php?linId='; ?>'; +var thumbSrc = '<?php echo LINPHA_CLIENT.'/get_thumb.php?linId='; ?>'; +var maxImageWidth = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_image_width']; ?>; +var maxImageHeight = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_image_height']; ?>; +var maxThumbSize = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_max']; ?>; +var displayThumbSize = <?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; ?>; +</script> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2007-08-19 22:48:55
|
Revision: 4765 http://linpha.svn.sourceforge.net/linpha/?rev=4765&view=rev Author: fangehrn Date: 2007-08-19 15:48:44 -0700 (Sun, 19 Aug 2007) Log Message: ----------- - auto height and width for google map - started adding thumb navigation Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/lib/classes/linpha.sql.class.php trunk/linpha2/lib/js/LinGlobal.js trunk/linpha2/lib/js/LinThumbnails.js trunk/linpha2/lib/plugins/maps/module.exampleMap.php trunk/linpha2/templates/default/map.head.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2007-08-19 14:47:57 UTC (rev 4764) +++ trunk/linpha2/ChangeLog 2007-08-19 22:48:44 UTC (rev 4765) @@ -2,7 +2,12 @@ * adding google maps support - modified gmapper class: increased the number of paragraphs "no image at this zoomlevel" used to auto zoom out + would be better if it is somehow possible to find out the number of the small map images + and only zoom out if all small images are not shown, it is now sometimes very annoying + when auto zoom out happens while zooming in -> turned off tilecheck completly - show thumbnails on google maps + - auto height and width for google map + - started adding thumb navigation 2007-08-18 flo * adding google maps support Modified: trunk/linpha2/lib/classes/linpha.sql.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.sql.class.php 2007-08-19 14:47:57 UTC (rev 4764) +++ trunk/linpha2/lib/classes/linpha.sql.class.php 2007-08-19 22:48:44 UTC (rev 4765) @@ -699,7 +699,6 @@ * because if we try to get infos from an id which doesn't exist anymore * we would run in an endless loop */ - if($i == 1000) { linSysLog(i18n("Error: cannot get informations, you want to run the database cleanup script")); Modified: trunk/linpha2/lib/js/LinGlobal.js =================================================================== --- trunk/linpha2/lib/js/LinGlobal.js 2007-08-19 14:47:57 UTC (rev 4764) +++ trunk/linpha2/lib/js/LinGlobal.js 2007-08-19 22:48:44 UTC (rev 4765) @@ -167,6 +167,7 @@ * * sets two variables with the scroll offset * takes care of browser incompatibilites + * @uses linSyslog() */ setScrollSize: function() { @@ -211,3 +212,23 @@ //Event.observe(window, 'load', initLinGlobal, false); initLinGlobal(); + + +/** + * on resize functions + */ +function linEnableOnResize() +{ + Event.observe(window, 'resize', linOnResizeCreateTrigger, false); +} + +/** + * resizeWindow, use this wrapper function because internet explorer triggers the resize event to fast + * + * linOnResizeWrapper() must be defined where it's actually used (LinThumbnails.js, LinMapView.js) + */ +function linOnResizeCreateTrigger() +{ + clearTimeout(this.timerResize); + this.timerResize = setTimeout(linOnResizeWrapper,250); +} Modified: trunk/linpha2/lib/js/LinThumbnails.js =================================================================== --- trunk/linpha2/lib/js/LinThumbnails.js 2007-08-19 14:47:57 UTC (rev 4764) +++ trunk/linpha2/lib/js/LinThumbnails.js 2007-08-19 22:48:44 UTC (rev 4765) @@ -384,28 +384,10 @@ { location.href = linUrlBase + '&linId=' + linImgIds[0]['id'] + '&slideshow'; }, - - /** - * resizeWindow, use this wrapper function because internet explorer triggers the resize event to fast - */ - resizeWindow: function () - { - clearTimeout(this.timerResize); - this.timerResize = setTimeout(linThumbnailsWrapper,250); - } } -/** - * linThumbnailsWrapper() - * - * use this wrapper function if called from setTimeout() - * because 'this.' would not work otherwise - */ -function linThumbnailsWrapper() -{ - myLinThumbnails.displayThumbs(); -} + /** * initLinThumbnails() * @@ -414,9 +396,14 @@ function initLinThumbnails() { myLinThumbnails = new LinThumbnails(); - Event.observe(window, 'resize', myLinThumbnails.resizeWindow, false); - + + linEnableOnResize(); myLinThumbnails.displayThumbs(); } +function linOnResizeWrapper() +{ + myLinThumbnails.displayThumbs(); +} + Event.observe(window, 'load', initLinThumbnails, false); Modified: trunk/linpha2/lib/plugins/maps/module.exampleMap.php =================================================================== --- trunk/linpha2/lib/plugins/maps/module.exampleMap.php 2007-08-19 14:47:57 UTC (rev 4764) +++ trunk/linpha2/lib/plugins/maps/module.exampleMap.php 2007-08-19 22:48:44 UTC (rev 4765) @@ -1,115 +1,149 @@ <?php require_once(LINPHA_DIR."/lib/plugins/maps/gmapper1/class.gmapper.php"); -$key = "ABQIAAAAAXCMfho4_sqSSh0VqMB80xT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSfO_6bbb_ScfT_zPgcnJMKyGltOg"; // key for http://localhost -$GLOBALS['linpha']->template->output['googleMap'] = new gmap($key); +if(isset($_GET['albId'])) { + $albId = intval($_GET['albId']); +} -ob_start(); - -?> -<div id="gmapper_map" style="height: 800px;"></div> - -<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> - -<?php - -$GLOBALS['linpha']->template->output['googleMap']->map( - $zoom = 4, - $lat = '49.980067', - $lng = '10.8731', - $type = "hybrid", - $min_zoom = 1, - $max_zoom = 23, - $navcontrol = "large", - $overview = 1, - $mousezoom = 1, - $tilecheck = 1 -); - -$GLOBALS['linpha']->template->output['googleMap']->markstart(); - -$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, array(LINPHA_CLIENT."/lib/plugins/maps/gmapper1/gruen.png",20,34)); - - - - -$query = $GLOBALS['linpha']->db->Execute("SELECT id, gpslatituderef,gpslatitude,gpslongituderef,gpslongitude " . +$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"); + "AND gpslongitude IS NOT NULL "); while($data = $query->FetchRow()) { - $latlon = parsePJMTLatLon($data); - $GLOBALS['linpha']->template->output['googleMap']->otherMarker( - $latlon['gpslatitude'], - $latlon['gpslongitude'] , - '<img src="'.LINPHA_CLIENT.'/get_thumb.php?linId='.$data['id'].'" />', - array(LINPHA_CLIENT."/lib/plugins/maps/gmapper1/gelb.png",20,34) - ); + $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(); -$GLOBALS['linpha']->template->output['googleMap']->markend(); +?> + <div id="linDivMapTop"> + <?php + 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> + + <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="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> + </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"; + */ +} -/*$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'); @@ -129,12 +163,11 @@ [gpslongitude] => 1879048192/134217728 (14),1207959552/134217728 (9),472055494/16777216 (28.1367000341) (Degrees Minutes Seconds East or West) )*/ - // use '?' to be \x84non-greedy\x93 (http://de.wikipedia.org/wiki/Regul%C3%A4rer_Ausdruck#Gieriges_Verhalten) - - 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); Modified: trunk/linpha2/templates/default/map.head.php =================================================================== --- trunk/linpha2/templates/default/map.head.php 2007-08-19 14:47:57 UTC (rev 4764) +++ trunk/linpha2/templates/default/map.head.php 2007-08-19 22:48:44 UTC (rev 4765) @@ -1,7 +1,75 @@ <?php $linTpl->output['googleMap']->headjs(); +?> +<script type="text/javascript" language="JavaScript" src="<?php echo LINPHA_CLIENT; ?>/lib/plugins/maps/gmapper1/bodyjs.js"></script> +<script language="JavaScript" type="text/javascript"> -// <body onunload="GUnload()"> -// window.addEventListener("resize", function() {showZooms()}, false); -?> -<script type="text/javascript" language="JavaScript" src="<?php echo LINPHA_CLIENT; ?>/lib/plugins/maps/gmapper1/bodyjs.js"></script> \ No newline at end of file +var linNavIsHidden = false; +function linToggleNav() +{ + + if( linNavIsHidden ) + { + // restore save margin + $('gmapper_map').style.marginRight = $('linDivMapNav').style.marginRight; + $('linDivMapNav').style.marginRight = 0; + + Element.show('linDivMapNav'); + + linNavIsHidden = false; + } + else + { + Element.hide('linDivMapNav'); + + // backup current margin + $('linDivMapNav').style.marginRight = $('gmapper_map').style.marginRight; + + $('gmapper_map').style.marginRight = 7; + + linNavIsHidden = true; + } + + // update google map size + map.checkResize(); +} + + + +function linOnResizeWrapper() +{ + /** + * tempoarely set the map heigth to a small value (zero does not work!) + * in IE setMainHeight() would not work while reducing the window size + * because IE takes always as much space as he actually needs ignoring + * the height attribute + */ + + $('linDivMapNav').style.height = 10; + $('linDivMapMain').style.height = 10; + + myLinGlobal.setMainHeight(); + + $('linDivMapMain').style.height = $('linDivMain').offsetHeight - $('linDivMapTop').offsetHeight - $('linDivMapBottom').offsetHeight - 5; + + /** + * set also height of the navigation bar + * overflow:auto does not work in IE with height: 100% + */ + $('linDivMapNav').style.height = $('linDivMapMain').style.height; + + // resize google map itself also + map.checkResize(); +} + +function initLinMap() +{ + linEnableOnResize(); + linOnResizeWrapper(); +} +Event.observe(window, 'load', initLinMap, false); + +// prevent memory leaks in internet explorer +Event.observe(window, 'unload', GUnload, false); +</script> + \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2007-08-19 14:48:17
|
Revision: 4764 http://linpha.svn.sourceforge.net/linpha/?rev=4764&view=rev Author: fangehrn Date: 2007-08-19 07:47:57 -0700 (Sun, 19 Aug 2007) Log Message: ----------- 2007-08-19 flo * adding google maps support - modified gmapper class: increased the number of paragraphs "no image at this zoomlevel" used to auto zoom out - show thumbnails on google maps Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/docs/dev/external_libraries.txt trunk/linpha2/lib/plugins/maps/gmapper1/bodyjs.js trunk/linpha2/lib/plugins/maps/module.exampleMap.php trunk/linpha2/templates/default/map.head.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2007-08-18 17:37:12 UTC (rev 4763) +++ trunk/linpha2/ChangeLog 2007-08-19 14:47:57 UTC (rev 4764) @@ -1,3 +1,9 @@ +2007-08-19 flo + * adding google maps support + - modified gmapper class: increased the number of paragraphs "no image at this zoomlevel" + used to auto zoom out + - show thumbnails on google maps + 2007-08-18 flo * adding google maps support - added gmapper class (http://gmapper.ajax-info.de/) Modified: trunk/linpha2/docs/dev/external_libraries.txt =================================================================== --- trunk/linpha2/docs/dev/external_libraries.txt 2007-08-18 17:37:12 UTC (rev 4763) +++ trunk/linpha2/docs/dev/external_libraries.txt 2007-08-19 14:47:57 UTC (rev 4764) @@ -20,7 +20,7 @@ - ptviewer 3.1.2 (http://webuser.hs-furtwangen.de/~dersch/) - gmapper 1.0 - to avoid relative path problems: + - to avoid relative path problems: marker(), otherMarker(), tabMarker(), linkMarker(), mapMarker(), directions(), geocode(): replaced all marker( ... , $img = "143.png" , ... ) @@ -29,7 +29,7 @@ with marker( ... , $markerImage , ... ) echo "var image = new Array(\"$markerImage[0]\",$markerImage[1],$markerImage[2]);\n"; - + - increased the number of paragraphs "no image at this zoomlevel" used to auto zoom out - PHP_JPEG_Metadata_Toolkit_1.11 Modified: trunk/linpha2/lib/plugins/maps/gmapper1/bodyjs.js =================================================================== --- trunk/linpha2/lib/plugins/maps/gmapper1/bodyjs.js 2007-08-18 17:37:12 UTC (rev 4763) +++ trunk/linpha2/lib/plugins/maps/gmapper1/bodyjs.js 2007-08-19 14:47:57 UTC (rev 4764) @@ -1 +1 @@ -function createMarker(_1,_2){var _3=new GIcon();_3.image=_2[0];_3.iconSize=new GSize(_2[1],_2[2]);subt=_2[2]/100*11;subt=Math.ceil(subt);var _4=_2[2]-subt;_3.iconAnchor=new GPoint(10,_4);var _5=new GMarker(_1,_3);return _5;}function createMapMarker(_6,_7){var _8=new GIcon();_8.image=_7[0];_8.iconSize=new GSize(_7[1],_7[2]);subt=_7[2]/100*11;subt=Math.ceil(subt);var _9=_7[2]-subt;_8.iconAnchor=new GPoint(10,_9);var _a=_7[2]/3;_a=Math.floor(_a);_8.infoWindowAnchor=new GPoint(_a,2);var _b=new GMarker(_6,_8);GEvent.addListener(_b,"click",function(){map.showMapBlowup(_b.getPoint());});return _b;}function createTabMarker(_c,_d,_e){var _f=new GIcon();_f.image=_e[0];_f.iconSize=new GSize(_e[1],_e[2]);subt=_e[2]/100*11;subt=Math.ceil(subt);var _10=_e[2]-subt;_f.iconAnchor=new GPoint(10,_10);var _11=_e[2]/3;_f.infoWindowAnchor=new GPoint(_11,2);var _12=new GMarker(_c,_f);GEvent.addListener(_12,"click",function(){_12.openInfoWindowTabsHtml(_d);});return _12;}function createLinkMarker(_13,_14,_15){var _16=new GIcon();_16.image=_15[0];_16.iconSize=new GSize(_15[1],_15[2]);subt=_15[2]/100*11;subt=Math.ceil(subt);var _17=_15[2]-subt;_16.iconAnchor=new GPoint(10,_17);var _18=_15[2]/3;_16.infoWindowAnchor=new GPoint(_18,2);var _19=new GMarker(_13,_16);GEvent.addListener(_19,"click",function(){window.location.href=_14;});return _19;}function createOtherMarker(_1a,_1b,_1c){var _1d=new GIcon();_1d.image=_1c[0];_1d.iconSize=new GSize(_1c[1],_1c[2]);subt=_1c[2]/100*11;subt=Math.ceil(subt);var _1e=_1c[2]-subt;_1d.iconAnchor=new GPoint(10,_1e);var _1f=_1c[2]/3;_1f=Math.floor(_1f);_1d.infoWindowAnchor=new GPoint(_1f,2);var _20=new GMarker(_1a,_1d);var _21=_1b;GEvent.addListener(_20,"click",function(){_20.openInfoWindowHtml(_21);});return _20;}var arrowIcon=new GIcon();arrowIcon.iconSize=new GSize(24,24);arrowIcon.shadowSize=new GSize(1,1);arrowIcon.iconAnchor=new GPoint(12,12);arrowIcon.infoWindowAnchor=new GPoint(0,0);var degreesPerRadian=180/Math.PI;function bearing(_22,to){var _24=_22.latRadians();var _25=_22.lngRadians();var _26=to.latRadians();var _27=to.lngRadians();var _28=-Math.atan2(Math.sin(_25-_27)*Math.cos(_26),Math.cos(_24)*Math.sin(_26)-Math.sin(_24)*Math.cos(_26)*Math.cos(_25-_27));if(_28<0){_28+=Math.PI*2;}_28=_28*degreesPerRadian;_28=_28.toFixed(1);return _28;}function arrowHead(_29){var p1=_29[_29.length-1];var p2=_29[_29.length-2];var dir=bearing(p2,p1);var dir=Math.round(dir/3)*3;while(dir>=120){dir-=120;}arrowIcon.image="/img/dir_"+dir+".png";map.addOverlay(new GMarker(p1,arrowIcon));}function midArrows(_2e){for(var i=1;i<_2e.length-1;i++){var p1=_2e[i-1];var p2=_2e[i+1];var dir=bearing(p1,p2);var dir=Math.round(dir/3)*3;while(dir>=120){dir-=120;}arrowIcon.image="/img/dir_"+dir+".png";map.addOverlay(new GMarker(_2e[i],arrowIcon));}}function geocodeAddress(_34,typ,_36,_37){geocoder.getLatLng(_34,function(_38){if(!_38){alert(_34+" nicht gefunden");}else{var lat=_38.lat();var lng=_38.lng();map.setCenter(_38,_37);if(typ=="otherMarker"){_36=createOtherMarker(_38,_34,_36);}else{if(typ=="marker"){_36=createMarker(_38,_36);}else{if(typ=="mapMarker"){_36=createMapMarker(_38,_36);}}}map.addOverlay(_36);}});}function getAdress(){var _3b=document.getElementById("adresse").value;return _3b;}function tilechk(){paragraphs=map.getContainer().getElementsByTagName("p").length;if(paragraphs>4){map.zoomOut(false,true);}}function wheelevent(e){if(!e){e=window.event;}if(e.preventDefault){e.preventDefault();}e.returnValue=false;} \ No newline at end of file +function createMarker(_1,_2){var _3=new GIcon();_3.image=_2[0];_3.iconSize=new GSize(_2[1],_2[2]);subt=_2[2]/100*11;subt=Math.ceil(subt);var _4=_2[2]-subt;_3.iconAnchor=new GPoint(10,_4);var _5=new GMarker(_1,_3);return _5;}function createMapMarker(_6,_7){var _8=new GIcon();_8.image=_7[0];_8.iconSize=new GSize(_7[1],_7[2]);subt=_7[2]/100*11;subt=Math.ceil(subt);var _9=_7[2]-subt;_8.iconAnchor=new GPoint(10,_9);var _a=_7[2]/3;_a=Math.floor(_a);_8.infoWindowAnchor=new GPoint(_a,2);var _b=new GMarker(_6,_8);GEvent.addListener(_b,"click",function(){map.showMapBlowup(_b.getPoint());});return _b;}function createTabMarker(_c,_d,_e){var _f=new GIcon();_f.image=_e[0];_f.iconSize=new GSize(_e[1],_e[2]);subt=_e[2]/100*11;subt=Math.ceil(subt);var _10=_e[2]-subt;_f.iconAnchor=new GPoint(10,_10);var _11=_e[2]/3;_f.infoWindowAnchor=new GPoint(_11,2);var _12=new GMarker(_c,_f);GEvent.addListener(_12,"click",function(){_12.openInfoWindowTabsHtml(_d);});return _12;}function createLinkMarker(_13,_14,_15){var _16=new GIcon();_16.image=_15[0];_16.iconSize=new GSize(_15[1],_15[2]);subt=_15[2]/100*11;subt=Math.ceil(subt);var _17=_15[2]-subt;_16.iconAnchor=new GPoint(10,_17);var _18=_15[2]/3;_16.infoWindowAnchor=new GPoint(_18,2);var _19=new GMarker(_13,_16);GEvent.addListener(_19,"click",function(){window.location.href=_14;});return _19;}function createOtherMarker(_1a,_1b,_1c){var _1d=new GIcon();_1d.image=_1c[0];_1d.iconSize=new GSize(_1c[1],_1c[2]);subt=_1c[2]/100*11;subt=Math.ceil(subt);var _1e=_1c[2]-subt;_1d.iconAnchor=new GPoint(10,_1e);var _1f=_1c[2]/3;_1f=Math.floor(_1f);_1d.infoWindowAnchor=new GPoint(_1f,2);var _20=new GMarker(_1a,_1d);var _21=_1b;GEvent.addListener(_20,"click",function(){_20.openInfoWindowHtml(_21);});return _20;}var arrowIcon=new GIcon();arrowIcon.iconSize=new GSize(24,24);arrowIcon.shadowSize=new GSize(1,1);arrowIcon.iconAnchor=new GPoint(12,12);arrowIcon.infoWindowAnchor=new GPoint(0,0);var degreesPerRadian=180/Math.PI;function bearing(_22,to){var _24=_22.latRadians();var _25=_22.lngRadians();var _26=to.latRadians();var _27=to.lngRadians();var _28=-Math.atan2(Math.sin(_25-_27)*Math.cos(_26),Math.cos(_24)*Math.sin(_26)-Math.sin(_24)*Math.cos(_26)*Math.cos(_25-_27));if(_28<0){_28+=Math.PI*2;}_28=_28*degreesPerRadian;_28=_28.toFixed(1);return _28;}function arrowHead(_29){var p1=_29[_29.length-1];var p2=_29[_29.length-2];var dir=bearing(p2,p1);var dir=Math.round(dir/3)*3;while(dir>=120){dir-=120;}arrowIcon.image="/img/dir_"+dir+".png";map.addOverlay(new GMarker(p1,arrowIcon));}function midArrows(_2e){for(var i=1;i<_2e.length-1;i++){var p1=_2e[i-1];var p2=_2e[i+1];var dir=bearing(p1,p2);var dir=Math.round(dir/3)*3;while(dir>=120){dir-=120;}arrowIcon.image="/img/dir_"+dir+".png";map.addOverlay(new GMarker(_2e[i],arrowIcon));}}function geocodeAddress(_34,typ,_36,_37){geocoder.getLatLng(_34,function(_38){if(!_38){alert(_34+" nicht gefunden");}else{var lat=_38.lat();var lng=_38.lng();map.setCenter(_38,_37);if(typ=="otherMarker"){_36=createOtherMarker(_38,_34,_36);}else{if(typ=="marker"){_36=createMarker(_38,_36);}else{if(typ=="mapMarker"){_36=createMapMarker(_38,_36);}}}map.addOverlay(_36);}});}function getAdress(){var _3b=document.getElementById("adresse").value;return _3b;}function tilechk(){paragraphs=map.getContainer().getElementsByTagName("p").length;if(paragraphs>10){map.zoomOut(false,true);}}function wheelevent(e){if(!e){e=window.event;}if(e.preventDefault){e.preventDefault();}e.returnValue=false;} \ No newline at end of file Modified: trunk/linpha2/lib/plugins/maps/module.exampleMap.php =================================================================== --- trunk/linpha2/lib/plugins/maps/module.exampleMap.php 2007-08-18 17:37:12 UTC (rev 4763) +++ trunk/linpha2/lib/plugins/maps/module.exampleMap.php 2007-08-19 14:47:57 UTC (rev 4764) @@ -5,17 +5,23 @@ $GLOBALS['linpha']->template->output['googleMap'] = new gmap($key); ob_start(); + ?> <div id="gmapper_map" style="height: 800px;"></div> <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> +<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> +<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> <?php + $GLOBALS['linpha']->template->output['googleMap']->map( $zoom = 4, $lat = '49.980067', @@ -30,15 +36,42 @@ ); $GLOBALS['linpha']->template->output['googleMap']->markstart(); + $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, array(LINPHA_CLIENT."/lib/plugins/maps/gmapper1/gruen.png",20,34)); + + + + +$query = $GLOBALS['linpha']->db->Execute("SELECT id, 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()) +{ + $latlon = parsePJMTLatLon($data); + $GLOBALS['linpha']->template->output['googleMap']->otherMarker( + $latlon['gpslatitude'], + $latlon['gpslongitude'] , + '<img src="'.LINPHA_CLIENT.'/get_thumb.php?linId='.$data['id'].'" />', + array(LINPHA_CLIENT."/lib/plugins/maps/gmapper1/gelb.png",20,34) + ); +} + + + + $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(); @@ -84,4 +117,32 @@ $linpha->template->URL_full = 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) + )*/ + + // use '?' to be \x84non-greedy\x93 (http://de.wikipedia.org/wiki/Regul%C3%A4rer_Ausdruck#Gieriges_Verhalten) + + + foreach(array('gpslatitude','gpslongitude') as $value) + { + $arrHits = array(); + 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 Modified: trunk/linpha2/templates/default/map.head.php =================================================================== --- trunk/linpha2/templates/default/map.head.php 2007-08-18 17:37:12 UTC (rev 4763) +++ trunk/linpha2/templates/default/map.head.php 2007-08-19 14:47:57 UTC (rev 4764) @@ -2,5 +2,6 @@ $linTpl->output['googleMap']->headjs(); // <body onunload="GUnload()"> +// window.addEventListener("resize", function() {showZooms()}, false); ?> <script type="text/javascript" language="JavaScript" src="<?php echo LINPHA_CLIENT; ?>/lib/plugins/maps/gmapper1/bodyjs.js"></script> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2007-08-18 17:37:15
|
Revision: 4763 http://linpha.svn.sourceforge.net/linpha/?rev=4763&view=rev Author: fangehrn Date: 2007-08-18 10:37:12 -0700 (Sat, 18 Aug 2007) Log Message: ----------- 2007-08-18 flo * adding google maps support - modified gmapper class to fix relativ path problems - added some test markers Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/docs/dev/external_libraries.txt trunk/linpha2/lib/plugins/maps/gmapper1/class.gmapper.php trunk/linpha2/lib/plugins/maps/module.exampleMap.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2007-08-18 16:28:16 UTC (rev 4762) +++ trunk/linpha2/ChangeLog 2007-08-18 17:37:12 UTC (rev 4763) @@ -2,6 +2,8 @@ * adding google maps support - added gmapper class (http://gmapper.ajax-info.de/) - added basic map at ../linpha2/?&linCat=map + - modified gmapper class to fix relativ path problems + - added some test markers 2007-07-13 bzrudi * Major redesign and cleanups in Installer and a lot of eyecandy. Modified: trunk/linpha2/docs/dev/external_libraries.txt =================================================================== --- trunk/linpha2/docs/dev/external_libraries.txt 2007-08-18 16:28:16 UTC (rev 4762) +++ trunk/linpha2/docs/dev/external_libraries.txt 2007-08-18 17:37:12 UTC (rev 4763) @@ -19,6 +19,18 @@ - ptviewer 3.1.2 (http://webuser.hs-furtwangen.de/~dersch/) +- gmapper 1.0 + to avoid relative path problems: + marker(), otherMarker(), tabMarker(), linkMarker(), mapMarker(), directions(), geocode(): + replaced all + marker( ... , $img = "143.png" , ... ) + $dims = getimagesize($img); + echo "var image = new Array(\"$img\",$dims[0],$dims[1]);\n"; + with + marker( ... , $markerImage , ... ) + echo "var image = new Array(\"$markerImage[0]\",$markerImage[1],$markerImage[2]);\n"; + + - PHP_JPEG_Metadata_Toolkit_1.11 CHANGES Modified: trunk/linpha2/lib/plugins/maps/gmapper1/class.gmapper.php =================================================================== --- trunk/linpha2/lib/plugins/maps/gmapper1/class.gmapper.php 2007-08-18 16:28:16 UTC (rev 4762) +++ trunk/linpha2/lib/plugins/maps/gmapper1/class.gmapper.php 2007-08-18 17:37:12 UTC (rev 4763) @@ -214,11 +214,10 @@ * @param string $img Steuerung der Grafik * @return bool */ - function marker($lat, $lng, $img = "143.png") + function marker($lat, $lng, $markerImage) // $img = "143.png" { if ($lat and $lng) { - $dims = getimagesize($img); - echo "var image = new Array(\"$img\",$dims[0],$dims[1]);\n"; + echo "var image = new Array(\"$markerImage[0]\",$markerImage[1],$markerImage[2]);\n"; echo "var point = new GLatLng(\"$lat\",\"$lng\");\n"; echo "var marker = createMarker(point, image);\n"; echo "var to = point;\n"; @@ -238,11 +237,10 @@ * @param string $img Steuerung der Grafik * @return bool */ - function otherMarker($lat, $lng, $html = "", $img = "143.png") + function otherMarker($lat, $lng, $html = "", $markerImage) // $img = "143.png" { - $dims = getimagesize($img); if ($lat and $lng) { - echo "var image = new Array(\"$img\",$dims[0],$dims[1]);\n"; + echo "var image = new Array(\"$markerImage[0]\",$markerImage[1],$markerImage[2]);\n"; echo "var point = new GLatLng(\"$lat\",\"$lng\");\n"; echo "var marker = createOtherMarker(point, '$html',image);\n"; @@ -262,11 +260,10 @@ * @param string $img Steuerung der Grafik * @return bool */ - function tabMarker($lat, $lng, $tabs, $img = "143.png") + function tabMarker($lat, $lng, $tabs, $markerImage) // $img = "143.png" { if ($lat and $lng) { - $dims = getimagesize($img); - echo "var image = new Array(\"$img\",$dims[0],$dims[1]);\n"; + echo "var image = new Array(\"$markerImage[0]\",$markerImage[1],$markerImage[2]);\n"; echo "var infoTabs = [\n"; foreach($tabs as $tab) { $str .= " @@ -293,11 +290,10 @@ * @param string $img Steuerung der Grafik * @return bool */ - function linkMarker($lat, $lng, $link, $img = "143.png") + function linkMarker($lat, $lng, $link, $markerImage) // $img = "143.png" { if ($lat and $lng) { - $dims = getimagesize($img); - echo "var image = new Array(\"$img\",$dims[0],$dims[1]);\n"; + echo "var image = new Array(\"$markerImage[0]\",$markerImage[1],$markerImage[2]);\n"; echo "var point = new GLatLng(\"$lat\",\"$lng\");\n"; echo "var marker = createLinkMarker(point, '$link',image);\n"; echo "map.addOverlay(marker);\n"; @@ -315,11 +311,10 @@ * @param string $img Steuerung der Grafik * @return bool */ - function mapMarker($lat, $lng, $img = "143.png") + function mapMarker($lat, $lng, $markerImage) // $img = "143.png" { if ($lat and $lng) { - $dims = getimagesize($img); - echo "var image = new Array(\"$img\",$dims[0],$dims[1]);\n"; + echo "var image = new Array(\"$markerImage[0]\",$markerImage[1],$markerImage[2]);\n"; echo "var point = new GLatLng(\"$lat\",\"$lng\");\n"; echo "var marker = createMapMarker(point,image);\n"; echo "map.addOverlay(marker);\n"; @@ -340,10 +335,8 @@ * @param string $textbox Name des HTML Elements in dem die Wegliste ausgegeben wird (Element ID) * @return bool */ - function directions($start, $end, $startmarker = "143.png", $endmarker = "143.png", $zoombounds = 0, $textbox = "") + function directions($start, $end, $startMarker, $endMarker, $zoombounds = 0, $textbox = "") // $startmarker = "143.png", $endmarker = "143.png" { - $dims = getimagesize($startmarker); - $dims2 = getimagesize($endmarker); echo "var dire = new GDirections(); GEvent.addListener(dire, \"load\", gload); dire.load(\"from: $start to: $end\",{getPolyline:true,getSteps:true}); @@ -362,10 +355,10 @@ } echo " map.addOverlay(poly); - var image = new Array(\"$startmarker\",\"$dims[0]\",\"$dims[1]\"); + var image = new Array(\"$startMarker[0]\",\"$startMarker[1]\",\"$startMarker[2]\"); var marker = createMapMarker(step1, image); map.addOverlay(marker); - var image = new Array(\"$endmarker\",\"$dims2[0]\",\"$dims2[1]\"); + var image = new Array(\"$endMarker[0]\",\"$endMarker[1]\",\"$endMarker[2]\"); var marker = createMapMarker(step_last, image); map.addOverlay(marker);"; if ($textbox != "") { @@ -511,11 +504,10 @@ * @param int $zoom legt den Kartenzoom fest (Default: 14) * @return array */ - function geocode($adress, $typ = 'marker', $img = "143.png", $zoom = 14) + function geocode($adress, $typ = 'marker', $markerImage, $zoom = 14) // $img = "143.png" { if ($adress) { - $dims = getimagesize($img); - echo "var image = new Array('$img',$dims[0],$dims[1]);\n"; + echo "var image = new Array('$markerImage[0]',$markerImage[1],$markerImage[2]);\n"; if ($adress == "getAdress()") { echo "geocodeAddress($adress,'$typ',image,$zoom);\n"; } else { Modified: trunk/linpha2/lib/plugins/maps/module.exampleMap.php =================================================================== --- trunk/linpha2/lib/plugins/maps/module.exampleMap.php 2007-08-18 16:28:16 UTC (rev 4762) +++ trunk/linpha2/lib/plugins/maps/module.exampleMap.php 2007-08-18 17:37:12 UTC (rev 4763) @@ -6,14 +6,14 @@ ob_start(); ?> -<div id="gmapper_map" style="width: 600px; height: 600px;"></div> +<div id="gmapper_map" style="height: 800px;"></div> -<input type = "text" id = "adresse" size = "30"><br> -<input type = "button" onclick = "<?php $GLOBALS['linpha']->template->output['googleMap']->geocode("getAdress()", "otherMarker", "dash.png"); ?>" value = "Geocode"> <br> -Content after<br> -<a href = "#" onclick = "<?php $GLOBALS['linpha']->template->output['googleMap']->geocode("Berlin", "otherMarker", "143.png"); ?>">Berlin</a><br> -<a href = "#" onclick = "<?php $GLOBALS['linpha']->template->output['googleMap']->geocode("M\xFCnchen", "otherMarker", "rot.png", 10); ?>">München</a><br> -<a href = "#" onclick = "<?php $GLOBALS['linpha']->template->output['googleMap']->geocode("K\xF6lner Dom", "otherMarker", "gruen.png", 17); ?>">Kölner Dom</a> +<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> <?php $GLOBALS['linpha']->template->output['googleMap']->map( @@ -29,6 +29,16 @@ $tilecheck = 1 ); +$GLOBALS['linpha']->template->output['googleMap']->markstart(); +$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, array(LINPHA_CLIENT."/lib/plugins/maps/gmapper1/gruen.png",20,34)); +$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(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fan...@us...> - 2007-08-18 16:28:19
|
Revision: 4762 http://linpha.svn.sourceforge.net/linpha/?rev=4762&view=rev Author: fangehrn Date: 2007-08-18 09:28:16 -0700 (Sat, 18 Aug 2007) Log Message: ----------- 2007-08-18 flo * adding google maps support - added gmapper class (http://gmapper.ajax-info.de/) - added basic map at ../linpha2/?&linCat=map Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/index.php trunk/linpha2/lib/classes/linpha.class.php trunk/linpha2/lib/include/common.php Added Paths: ----------- trunk/linpha2/lib/plugins/maps/gmapper1/ trunk/linpha2/lib/plugins/maps/gmapper1/143.png trunk/linpha2/lib/plugins/maps/gmapper1/bodyjs.clean.js trunk/linpha2/lib/plugins/maps/gmapper1/bodyjs.js trunk/linpha2/lib/plugins/maps/gmapper1/class.gmapper.php trunk/linpha2/lib/plugins/maps/gmapper1/dash.png trunk/linpha2/lib/plugins/maps/gmapper1/docs/ trunk/linpha2/lib/plugins/maps/gmapper1/docs/gmap.html trunk/linpha2/lib/plugins/maps/gmapper1/docs/stylesheet.css trunk/linpha2/lib/plugins/maps/gmapper1/gelb.png trunk/linpha2/lib/plugins/maps/gmapper1/gruen.png trunk/linpha2/lib/plugins/maps/gmapper1/img/ trunk/linpha2/lib/plugins/maps/gmapper1/img/dir_105.png trunk/linpha2/lib/plugins/maps/gmapper1/img/dir_111.png trunk/linpha2/lib/plugins/maps/gmapper1/img/dir_30.png trunk/linpha2/lib/plugins/maps/gmapper1/img/dir_45.png trunk/linpha2/lib/plugins/maps/gmapper1/img/dir_60.png trunk/linpha2/lib/plugins/maps/gmapper1/img/dir_72.png trunk/linpha2/lib/plugins/maps/gmapper1/img/dir_75.png trunk/linpha2/lib/plugins/maps/gmapper1/img/dir_90.png trunk/linpha2/lib/plugins/maps/gmapper1/img/dir_93.png trunk/linpha2/lib/plugins/maps/gmapper1/rot.png trunk/linpha2/lib/plugins/maps/module.exampleMap.php trunk/linpha2/templates/default/map.head.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2007-08-09 08:34:51 UTC (rev 4761) +++ trunk/linpha2/ChangeLog 2007-08-18 16:28:16 UTC (rev 4762) @@ -1,3 +1,8 @@ +2007-08-18 flo + * adding google maps support + - added gmapper class (http://gmapper.ajax-info.de/) + - added basic map at ../linpha2/?&linCat=map + 2007-07-13 bzrudi * Major redesign and cleanups in Installer and a lot of eyecandy. Please test and report any issues, errors, warnings, layout quirks! Modified: trunk/linpha2/index.php =================================================================== --- trunk/linpha2/index.php 2007-08-09 08:34:51 UTC (rev 4761) +++ trunk/linpha2/index.php 2007-08-18 16:28:16 UTC (rev 4762) @@ -67,6 +67,9 @@ case 'download': require_once(LINPHA_DIR.'/lib/modules/module.download.php'); break; +case 'map': + require_once(LINPHA_DIR.'/lib/plugins/maps/module.exampleMap.php'); + break; case 'empty': require_once(LINPHA_DIR.'/lib/modules/module.empty.php'); break; Modified: trunk/linpha2/lib/classes/linpha.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.class.php 2007-08-09 08:34:51 UTC (rev 4761) +++ trunk/linpha2/lib/classes/linpha.class.php 2007-08-18 16:28:16 UTC (rev 4762) @@ -45,6 +45,15 @@ /** * some defines + * + * LINPHA_DIR is used in PHP contex to include other php files + * LINPHA_LINK is used in HTML contex for URLs + * LINPHA_CLIENT is used in HTML context for images and javascript includes + * + * we have to difference LINPHA_LINK and LINPHA_CLIENT because LINPHA_LINK does not + * point always to the linpha directory, e.g. when linpha is included in another + * website + * */ if(!defined('LINPHA_LINK')) { Modified: trunk/linpha2/lib/include/common.php =================================================================== --- trunk/linpha2/lib/include/common.php 2007-08-09 08:34:51 UTC (rev 4761) +++ trunk/linpha2/lib/include/common.php 2007-08-18 16:28:16 UTC (rev 4762) @@ -11,7 +11,7 @@ * - lib/include/calendar.php, lib/lang/language.php, * - install/index.php, install/step* */ - define('LINPHA_VERSION','2.0 alpha 1'); + define('LINPHA_VERSION','2.0 alpha 2'); /** * Magic Quotes stuff Added: trunk/linpha2/lib/plugins/maps/gmapper1/143.png =================================================================== (Binary files differ) Property changes on: trunk/linpha2/lib/plugins/maps/gmapper1/143.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/linpha2/lib/plugins/maps/gmapper1/bodyjs.clean.js =================================================================== --- trunk/linpha2/lib/plugins/maps/gmapper1/bodyjs.clean.js (rev 0) +++ trunk/linpha2/lib/plugins/maps/gmapper1/bodyjs.clean.js 2007-08-18 16:28:16 UTC (rev 4762) @@ -0,0 +1,180 @@ +function createMarker(point, image) +{ + var icon = new GIcon(); + icon.image = image[0]; + icon.iconSize = new GSize(image[1], image[2]); + subt = image[2] / 100 * 11; + subt = Math.ceil(subt); + var anchor = image[2] - subt; + icon.iconAnchor= new GPoint(10, anchor); + //{icon: icon, draggable: true} + var marker = new GMarker(point,icon); + return marker; +} + +function createMapMarker(point,image) +{ + var icon = new GIcon(); + icon.image = image[0]; + icon.iconSize = new GSize(image[1], image[2]); + subt = image[2] / 100 * 11; + subt = Math.ceil(subt); + var anchor = image[2] - subt; + icon.iconAnchor= new GPoint(10, anchor); + var infoanchor = image[2] / 3; + infoanchor = Math.floor(infoanchor); + icon.infoWindowAnchor = new GPoint(infoanchor, 2); + var marker = new GMarker(point,icon); + GEvent.addListener(marker, "click", function() {map.showMapBlowup(marker.getPoint());}); + return marker; +} + + +function createTabMarker(point, tabs,image) +{ + var icon = new GIcon(); + icon.image = image[0]; + icon.iconSize = new GSize(image[1], image[2]); + subt = image[2] / 100 * 11; + subt = Math.ceil(subt); + var anchor = image[2] - subt; + icon.iconAnchor= new GPoint(10, anchor); + var infoanchor = image[2] / 3; + icon.infoWindowAnchor = new GPoint(infoanchor, 2); + var marker = new GMarker(point,icon); + GEvent.addListener(marker, "click", function() { + marker.openInfoWindowTabsHtml(tabs); + }); + return marker; +} + +function createLinkMarker(point, link,image) +{ + var icon = new GIcon(); + icon.image = image[0]; + icon.iconSize = new GSize(image[1], image[2]); + subt = image[2] / 100 * 11; + subt = Math.ceil(subt); + var anchor = image[2] - subt; + icon.iconAnchor= new GPoint(10, anchor); + var infoanchor = image[2] / 3; + icon.infoWindowAnchor = new GPoint(infoanchor, 2); + var marker = new GMarker(point,icon); + + GEvent.addListener(marker, "click", function() { + window.location.href = link; + }); + return marker; +} + +function createOtherMarker(point, number,image) +{ + var icon = new GIcon(); + icon.image = image[0]; + icon.iconSize = new GSize(image[1], image[2]); + subt = image[2] / 100 * 11; + subt = Math.ceil(subt); + var anchor = image[2] - subt; + icon.iconAnchor= new GPoint(10, anchor); + var infoanchor = image[2] / 3; + infoanchor = Math.floor(infoanchor); + icon.infoWindowAnchor = new GPoint(infoanchor, 2); + var marker = new GMarker(point,icon); + var html = number; + GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(html);}); + return marker; +} + + var arrowIcon = new GIcon(); + arrowIcon.iconSize = new GSize(24,24); + arrowIcon.shadowSize = new GSize(1,1); + arrowIcon.iconAnchor = new GPoint(12,12); + arrowIcon.infoWindowAnchor = new GPoint(0,0); + var degreesPerRadian = 180.0 / Math.PI; + function bearing( from, to ) { + var lat1 = from.latRadians(); + var lon1 = from.lngRadians(); + var lat2 = to.latRadians(); + var lon2 = to.lngRadians(); + + var angle = - Math.atan2( Math.sin( lon1 - lon2 ) * Math.cos( lat2 ), Math.cos( lat1 ) * Math.sin( lat2 ) - Math.sin( lat1 ) * Math.cos( lat2 ) * Math.cos( lon1 - lon2 ) ); + if ( angle < 0.0 ) + angle += Math.PI * 2.0; + + angle = angle * degreesPerRadian; + angle = angle.toFixed(1); + + return angle; + } + + function arrowHead(points) { + var p1=points[points.length-1]; + var p2=points[points.length-2]; + var dir = bearing(p2,p1); + var dir = Math.round(dir/3) * 3; + while (dir >= 120) {dir -= 120;} + arrowIcon.image = "/img/dir_"+dir+".png"; + map.addOverlay(new GMarker(p1, arrowIcon)); + } + + function midArrows(points) { + for (var i=1; i < points.length-1; i++) { + var p1=points[i-1]; + var p2=points[i+1]; + var dir = bearing(p1,p2); + + var dir = Math.round(dir/3) * 3; + while (dir >= 120) {dir -= 120;} + arrowIcon.image = "/img/dir_"+dir+".png"; + map.addOverlay(new GMarker(points[i], arrowIcon)); + } + } + + function geocodeAddress(address,typ,marker,zoom) { + geocoder.getLatLng( + address, + function(point) { + if (!point) { + alert(address + " nicht gefunden"); + } else { + var lat = point.lat(); + var lng = point.lng(); + map.setCenter(point,zoom); + if(typ == "otherMarker") + { + marker = createOtherMarker(point,address,marker); + } + else if(typ == "marker") + { + marker = createMarker(point,marker); + } + else if(typ == "mapMarker") + { + marker = createMapMarker(point,marker); + } + map.addOverlay(marker); + } + } + ); +} + + function getAdress() + { + var adress = document.getElementById('adresse').value; + return adress; + } + + function tilechk() + { + paragraphs = map.getContainer().getElementsByTagName('p').length; + if(paragraphs>4) + { + map.zoomOut(false,true); + } + } + function wheelevent(e) + { + if (!e) e = window.event; + if (e.preventDefault) e.preventDefault(); + e.returnValue = false; + } \ No newline at end of file Added: trunk/linpha2/lib/plugins/maps/gmapper1/bodyjs.js =================================================================== --- trunk/linpha2/lib/plugins/maps/gmapper1/bodyjs.js (rev 0) +++ trunk/linpha2/lib/plugins/maps/gmapper1/bodyjs.js 2007-08-18 16:28:16 UTC (rev 4762) @@ -0,0 +1 @@ +function createMarker(_1,_2){var _3=new GIcon();_3.image=_2[0];_3.iconSize=new GSize(_2[1],_2[2]);subt=_2[2]/100*11;subt=Math.ceil(subt);var _4=_2[2]-subt;_3.iconAnchor=new GPoint(10,_4);var _5=new GMarker(_1,_3);return _5;}function createMapMarker(_6,_7){var _8=new GIcon();_8.image=_7[0];_8.iconSize=new GSize(_7[1],_7[2]);subt=_7[2]/100*11;subt=Math.ceil(subt);var _9=_7[2]-subt;_8.iconAnchor=new GPoint(10,_9);var _a=_7[2]/3;_a=Math.floor(_a);_8.infoWindowAnchor=new GPoint(_a,2);var _b=new GMarker(_6,_8);GEvent.addListener(_b,"click",function(){map.showMapBlowup(_b.getPoint());});return _b;}function createTabMarker(_c,_d,_e){var _f=new GIcon();_f.image=_e[0];_f.iconSize=new GSize(_e[1],_e[2]);subt=_e[2]/100*11;subt=Math.ceil(subt);var _10=_e[2]-subt;_f.iconAnchor=new GPoint(10,_10);var _11=_e[2]/3;_f.infoWindowAnchor=new GPoint(_11,2);var _12=new GMarker(_c,_f);GEvent.addListener(_12,"click",function(){_12.openInfoWindowTabsHtml(_d);});return _12;}function createLinkMarker(_13,_14,_15){var _16=new GIcon();_16.image=_15[0];_16.iconSize=new GSize(_15[1],_15[2]);subt=_15[2]/100*11;subt=Math.ceil(subt);var _17=_15[2]-subt;_16.iconAnchor=new GPoint(10,_17);var _18=_15[2]/3;_16.infoWindowAnchor=new GPoint(_18,2);var _19=new GMarker(_13,_16);GEvent.addListener(_19,"click",function(){window.location.href=_14;});return _19;}function createOtherMarker(_1a,_1b,_1c){var _1d=new GIcon();_1d.image=_1c[0];_1d.iconSize=new GSize(_1c[1],_1c[2]);subt=_1c[2]/100*11;subt=Math.ceil(subt);var _1e=_1c[2]-subt;_1d.iconAnchor=new GPoint(10,_1e);var _1f=_1c[2]/3;_1f=Math.floor(_1f);_1d.infoWindowAnchor=new GPoint(_1f,2);var _20=new GMarker(_1a,_1d);var _21=_1b;GEvent.addListener(_20,"click",function(){_20.openInfoWindowHtml(_21);});return _20;}var arrowIcon=new GIcon();arrowIcon.iconSize=new GSize(24,24);arrowIcon.shadowSize=new GSize(1,1);arrowIcon.iconAnchor=new GPoint(12,12);arrowIcon.infoWindowAnchor=new GPoint(0,0);var degreesPerRadian=180/Math.PI;function bearing(_22,to){var _24=_22.latRadians();var _25=_22.lngRadians();var _26=to.latRadians();var _27=to.lngRadians();var _28=-Math.atan2(Math.sin(_25-_27)*Math.cos(_26),Math.cos(_24)*Math.sin(_26)-Math.sin(_24)*Math.cos(_26)*Math.cos(_25-_27));if(_28<0){_28+=Math.PI*2;}_28=_28*degreesPerRadian;_28=_28.toFixed(1);return _28;}function arrowHead(_29){var p1=_29[_29.length-1];var p2=_29[_29.length-2];var dir=bearing(p2,p1);var dir=Math.round(dir/3)*3;while(dir>=120){dir-=120;}arrowIcon.image="/img/dir_"+dir+".png";map.addOverlay(new GMarker(p1,arrowIcon));}function midArrows(_2e){for(var i=1;i<_2e.length-1;i++){var p1=_2e[i-1];var p2=_2e[i+1];var dir=bearing(p1,p2);var dir=Math.round(dir/3)*3;while(dir>=120){dir-=120;}arrowIcon.image="/img/dir_"+dir+".png";map.addOverlay(new GMarker(_2e[i],arrowIcon));}}function geocodeAddress(_34,typ,_36,_37){geocoder.getLatLng(_34,function(_38){if(!_38){alert(_34+" nicht gefunden");}else{var lat=_38.lat();var lng=_38.lng();map.setCenter(_38,_37);if(typ=="otherMarker"){_36=createOtherMarker(_38,_34,_36);}else{if(typ=="marker"){_36=createMarker(_38,_36);}else{if(typ=="mapMarker"){_36=createMapMarker(_38,_36);}}}map.addOverlay(_36);}});}function getAdress(){var _3b=document.getElementById("adresse").value;return _3b;}function tilechk(){paragraphs=map.getContainer().getElementsByTagName("p").length;if(paragraphs>4){map.zoomOut(false,true);}}function wheelevent(e){if(!e){e=window.event;}if(e.preventDefault){e.preventDefault();}e.returnValue=false;} \ No newline at end of file Added: trunk/linpha2/lib/plugins/maps/gmapper1/class.gmapper.php =================================================================== --- trunk/linpha2/lib/plugins/maps/gmapper1/class.gmapper.php (rev 0) +++ trunk/linpha2/lib/plugins/maps/gmapper1/class.gmapper.php 2007-08-18 16:28:16 UTC (rev 4762) @@ -0,0 +1,745 @@ +<?php +/** + * + * @author Philipp Kiszka <in...@o-...> + * @name Gmapper + * @version 1.0 + * @link http://gmapper.ajax-info.de + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + */ +class gmap { + // Google Maps API Key + var $key; + /** + * Der Konstruktor nimmt den Google Maps API Key als Parameter entgegen. + * Dies ist die empfohlene Methode, den API Key einzubinden. + * + * @param string $mapkey Google Maps API Key + */ + function gmap($mapkey = "") + { + $this->key = $mapkey; + } + /** + * Erzeugt JS Code im HEAD Bereich der Seite. + * DEPRECATED: + * API Key sollte jetzt im Konstruktor der Klasse \xFCbergeben werden. + * Beispiel: + * $karte = new gmap("API KEY"); + * + * @param string $key Google Maps API Key + * @return bool + */ + function headjs($key = "") + { + if (!$key) { + $key = $this->key; + } + echo "<script src=\"http://maps.google.com/maps?file=api&v=2&key=$key\" type=\"text/javascript\" language=\"javascript\"></script>\n + <style type=\"text/css\">\n + v\:* {\n + behavior:url(#default#VML);\n + }\n + </style>"; + if ($key) { + return true; + } else { + return false; + } + } + + /** + * Platziert die Karte + * + * @param int $width Breite der Karte + * @param int $height H\xF6he der Karte + * @return bool + */ + function mapdiv($height, $width) + { + $width = $width . "px"; + $height = $height . "px"; + echo "<div id = \"gmapper_map\" style = \"width:$width;height:$height;\" ></div>"; + if ($height and $width) { + return true; + } else { + return false; + } + } + + /** + * Erzeugt die Kartendarstellung + * + * @param int $zoom Initiale Zoomstufe + * @param int $lat Initialer Breitengrad + * @param int $lng Initialer L\xE4ngengrad + * @param string $typ Kartentyp (normal,satellit,hybrid) Default: normal + * @param int $min_zoom Minimal m\xF6gliche Zoomstufe + * @param int $max_zoom Maximal M\xF6gliche Zoomstufe + * @param string $navcontrol Typ der Kartennavigation (small,large) Default: large + * @param int $overview Schaltet die \xDCbersichtskarte an oder aus. + * @param int $mousezoom Schaltet den Mouserad Zoom an oder aus. + * @param int $tilecheck Schaltet den Check nach Tile-Grafiken beim Zoomen an und aus (Default: an) + * @return bool + */ + function map($zoom, $lat, $lng, $typ = "normal", $min_zoom = 0, $max_zoom = 0, $navcontrol = "large", $overview = 0, $mousezoom = 1, $tilecheck = 1) + { + $width = $width . "px"; + $height = $height . "px"; + $lat2 = $lat - 0.1; + if ($typ == "normal") { + $typstr = "G_NORMAL_MAP"; + } elseif ($typ == "satellit") { + $typstr = "G_SATELLITE_MAP"; + } elseif ($typ == "hybrid") { + $typstr = "G_HYBRID_MAP"; + } + if ($navcontrol == "large") { + $controlstr = "GLargeMapControl()"; + } elseif ($navcontrol == "small") { + $controlstr = "GSmallMapControl()"; + } + echo "<script type=\"text/javascript\">\n + //<![CDATA[\n + var map = new GMap2(document.getElementById(\"gmapper_map\"));\n + var geocoder = new GClientGeocoder();\n"; + if ($mousezoom) { + echo "map.enableScrollWheelZoom();\n + var mapdiv = document.getElementById(\"gmapper_map\");\n + GEvent.addDomListener(mapdiv, \"DOMMouseScroll\", wheelevent);\n + mapdiv.onmousewheel = wheelevent;\n "; + } + if ($overview) { + echo "map.addControl(new GOverviewMapControl());\n"; + } + echo " + map.addControl(new $controlstr);\n + map.addControl(new GMapTypeControl());\n"; + if ($min_zoom > 0 and $max_zoom > 0) { + echo " + var mt = map.getMapTypes(); + for (var i=0; i<mt.length; i++) { + mt[i].getMinimumResolution = function() {return $min_zoom;} + mt[i].getMaximumResolution = function() {return $max_zoom;} + }"; + } + echo " + var mycontrol = new GMapTypeControl(); + map.addControl(mycontrol);\n + map.setCenter(new GLatLng( $lat,$lng),$zoom);\n + new GKeyboardHandler(map);\n + map.enableDoubleClickZoom();\n + map.enableContinuousZoom();\n + map.setMapType($typstr); + + \n"; + if ($tilecheck == 1) { + echo "var interval = setInterval(\"tilechk()\",500);"; + } + echo " + //]]>\n + </script>"; + return true; + } + + /** + * Zeigt den Kartenmasstab an. + * + * @return bool + */ + function showScale() + { + echo "map.addControl(new GScaleControl());\n"; + return true; + } + /** + * Sperrt das Drag / Pan der Karte. Die Karte wird so auf den Viewport fixiert. + * + * @return bool + */ + + function lockMap() + { + echo "map.disableDragging(); map.hideControls();\n"; + return true; + } + /** + * Erzeugt den JS Code im BODY der Seite. + * + * @return bool + */ + function bodyjs() + { + echo " + <script type=\"text/javascript\" src = \"bodyjs.js\"></script>\n"; + return true; + } + + /** + * Erzeugt ben\xF6tigten JS Code im Seitenfuss + * + * @return bool + */ + function footjs() + { + echo "//]]>\n</script>"; + return true; + } + /** + * Ende des Markerbereichs + * + * @return bool + */ + function markend() + { + echo "//]]>\n</script>"; + return true; + } + /** + * Start des Markerbereichs + * + * @return bool + */ + function markstart() + { + echo "<script type=\"text/javascript\">\n + //<![CDATA[\n"; + return true; + } + /** + * Erzeugt einen einfachen Marker. + * + * @param int $lat Breitengrad des Markers + * @param int $lng L\xE4ngengrad des Markers + * @param string $img Steuerung der Grafik + * @return bool + */ + function marker($lat, $lng, $img = "143.png") + { + if ($lat and $lng) { + $dims = getimagesize($img); + echo "var image = new Array(\"$img\",$dims[0],$dims[1]);\n"; + echo "var point = new GLatLng(\"$lat\",\"$lng\");\n"; + echo "var marker = createMarker(point, image);\n"; + echo "var to = point;\n"; + echo "map.addOverlay(marker);\n"; + echo "\n"; + return true; + } else { + return false; + } + } + /** + * Erzeugt einen Marker mit Infopopup und verschiedenen Grafiken + * + * @param int $lat Breitengrad des Markers + * @param int $lng L\xE4ngengrad des Markers + * @param string $html HTML Code f\xFCr das Infopopup + * @param string $img Steuerung der Grafik + * @return bool + */ + function otherMarker($lat, $lng, $html = "", $img = "143.png") + { + $dims = getimagesize($img); + if ($lat and $lng) { + echo "var image = new Array(\"$img\",$dims[0],$dims[1]);\n"; + echo "var point = new GLatLng(\"$lat\",\"$lng\");\n"; + echo "var marker = createOtherMarker(point, '$html',image);\n"; + + echo "map.addOverlay(marker);\n"; + echo "\n"; + return true; + } else { + return false; + } + } + /** + * Erzeugt einen Marker mit mehreren Tabs im Infopopup + * + * @param int $lat Breitengrad des Markers + * @param int $lng L\xE4ngengrad des Markers + * @param array $tabs Merhdimensionales Array mit den einzelnen Tabs + * @param string $img Steuerung der Grafik + * @return bool + */ + function tabMarker($lat, $lng, $tabs, $img = "143.png") + { + if ($lat and $lng) { + $dims = getimagesize($img); + echo "var image = new Array(\"$img\",$dims[0],$dims[1]);\n"; + echo "var infoTabs = [\n"; + foreach($tabs as $tab) { + $str .= " + new GInfoWindowTab(\"$tab[0]\", \"$tab[1]\"),\n"; + } + $str = substr($str, 0, strlen($str)-2); + echo $str; + echo "\n];\n"; + echo "var point = new GLatLng(\"$lat\",\"$lng\");\n"; + echo "var marker = createTabMarker(point, infoTabs,image);\n"; + echo "map.addOverlay(marker);\n"; + echo "\n"; + return true; + } else { + return false; + } + } + /** + * Erzeugt einen Marker der auf den in $link angegeben URL verweist. + * + * @param int $lat Breitengrad des Markers + * @param int $lng L\xE4ngengrad des Markers + * @param string $link Merhdimensionales Array mit den einzelnen Tabs + * @param string $img Steuerung der Grafik + * @return bool + */ + function linkMarker($lat, $lng, $link, $img = "143.png") + { + if ($lat and $lng) { + $dims = getimagesize($img); + echo "var image = new Array(\"$img\",$dims[0],$dims[1]);\n"; + echo "var point = new GLatLng(\"$lat\",\"$lng\");\n"; + echo "var marker = createLinkMarker(point, '$link',image);\n"; + echo "map.addOverlay(marker);\n"; + echo "\n"; + return true; + } else { + return false; + } + } + /** + * Erzeugt einen Marker dessen Infopopup eine Detailkarte enth\xE4lt + * + * @param int $lat Breitengrad des Markers + * @param int $lng L\xE4ngengrad des Markers + * @param string $img Steuerung der Grafik + * @return bool + */ + function mapMarker($lat, $lng, $img = "143.png") + { + if ($lat and $lng) { + $dims = getimagesize($img); + echo "var image = new Array(\"$img\",$dims[0],$dims[1]);\n"; + echo "var point = new GLatLng(\"$lat\",\"$lng\");\n"; + echo "var marker = createMapMarker(point,image);\n"; + echo "map.addOverlay(marker);\n"; + echo "\n"; + return true; + } else { + return false; + } + } + /** + * Erzeugt ein Geocoding Request und gibt eine Polyline, sowie Ortsliste zur\xFCck + * + * @param string $start Startort + * @param string $end Endort + * @param string $startmarker Markergrafik des Startorts + * @param string $endmarker Markergrafik des Endorts + * @param int $zoombounds Zoom und Center so setzen, dass sowohl Start als auch Zielort sichtbar sind. + * @param string $textbox Name des HTML Elements in dem die Wegliste ausgegeben wird (Element ID) + * @return bool + */ + function directions($start, $end, $startmarker = "143.png", $endmarker = "143.png", $zoombounds = 0, $textbox = "") + { + $dims = getimagesize($startmarker); + $dims2 = getimagesize($endmarker); + echo "var dire = new GDirections(); + GEvent.addListener(dire, \"load\", gload); + dire.load(\"from: $start to: $end\",{getPolyline:true,getSteps:true}); + function gload() + { + var distanz = dire.getDistance().meters; + distanz = distanz / 1000; + distanz = Math.round(distanz); + var poly = dire.getPolyline(); + var bounds = dire.getBounds(); + var route = dire.getRoute(0); + var step1 = route.getStep(0).getLatLng(); + var step_last = route.getEndLatLng();"; + if ($zoombounds) { + echo "map.setCenter(bounds.getCenter(), map.getBoundsZoomLevel(bounds));"; + } + echo " + map.addOverlay(poly); + var image = new Array(\"$startmarker\",\"$dims[0]\",\"$dims[1]\"); + var marker = createMapMarker(step1, image); + map.addOverlay(marker); + var image = new Array(\"$endmarker\",\"$dims2[0]\",\"$dims2[1]\"); + var marker = createMapMarker(step_last, image); + map.addOverlay(marker);"; + if ($textbox != "") { + echo "var steps = route.getNumSteps(); + document.getElementById('$textbox').innerHTML = '<b>Entfernung:</b> ' + distanz + ' Km<br>'; + for(i=0;i<=steps;i++) + { + mystep = route.getStep(i) + if(mystep) + { + o = i + 1; + shtml = mystep.getDescriptionHtml(); + document.getElementById('$textbox').innerHTML += o + '. ' + shtml + '<br>'; + } + }"; + } + echo "}"; + return true; + } + + /** + * Erzeugt ein Bounds Objekt + * + * @return bool + */ + function bounds() + { + echo "var bounds = new GLatLngBounds();\n"; + return true; + } + /** + * Erweitert ein vorhandenes Bounds Objekt um den zuletzt hinzugef\xFCgten Punkt. + * + * @return bool + */ + function boundsExtend() + { + echo "bounds.extend(point)\n"; + return true; + } + /** + * Setzt den Kartenzoom "To bounds". + * + * @return bool + */ + function zoomToBounds() + { + echo "map.setCenter(bounds.getCenter(), map.getBoundsZoomLevel(bounds));\n"; + return true; + } + + /** + * Erzeugt eine Linie zwischen mehreren Punkten + * + * @param array $punkte Erwartet ein Mehrdimensionales Array mit lat/lng der einzelnen Punkte + * @param string $color Die Farbe der Linie als Hexcode + * @param int $breite Die Breite der Linie + * @param int $transparent Transparenz an / aus + * @param string $arrows Richtungspfeile. "all" = \xFCberall, mid = "nur auf der Wegstrecke" , "end = "nur am "Ende" + * @param int $geodetic Legt fest ob "geod\xE4sische" Polylines gezeichnet werden. Diese ber\xFCcksichtigen die Erdkr\xFCmmung. + * @return bool + */ + function polyline($punkte, $color = "#FF0000", $breite = 1, $transparent = 0, $arrows = "", $geodetic = 0) + { + $polystr = ""; + $pts = "["; + + ?> + var polyline = new GPolyline([ + <?php + foreach($punkte as $punkt) { + $pts .= "new GLatLng($punkt[0],$punkt[1]),"; + $polystr .= "new GLatLng($punkt[0],$punkt[1]),\n"; + } + $polystr = substr($polystr, 0, strlen($polystr)-2); + $pts = substr($pts, 0, strlen($pts)-1); + $pts .= "]"; + + echo " + $polystr],'$color',$breite,$transparent"; + if ($geodetic == 1) { + echo ",{geodesic:true}"; + } + echo ");\n + map.addOverlay(polyline);\n"; + if ($arrows == "end") { + echo "arrowHead($pts);\n"; + } elseif ($arrows == "mid") { + echo "midArrows($pts);\n"; + } elseif ($arrows == "all") { + echo "arrowHead($pts);\n + midArrows($pts);\n"; + } + + return true; + } + + /** + * Ermittelt die L\xE4nge einer Polyline in Metern. + * + * @param array $punkte das Array aus dem die Polyline erstellt wurde. + * @return int $entfernung + */ + function getDistance($koord) + { + if (!is_array($koord)) { + return false; + } + + $ent = 0; + $welt = 6378.137; // Erdradius, ca. Angabe + + foreach($koord as $key => $fetch) { + if (isset($koord[$key + 1])) { + $erste_breite = $koord[$key][0]; // lat + $erste_laenge = $koord[$key][1]; // lon + $erste_breite_rad = deg2rad($erste_breite); + $erste_laenge_rad = deg2rad($erste_laenge); + + $zweite_breite = $koord[$key + 1][0]; // lat + $zweite_laenge = $koord[$key + 1][1]; // lon + $zweite_breite_rad = deg2rad($zweite_breite); + $zweite_laenge_rad = deg2rad($zweite_laenge); + + $dis = acos( + (sin($erste_breite_rad) * sin($zweite_breite_rad)) + + (cos($erste_breite_rad) * cos($zweite_breite_rad) * + cos($zweite_laenge_rad - $erste_laenge_rad))) * $welt; + + $ent = $ent + $dis; + } + } + $entfernung = $ent * 1000; + return round($entfernung, 0); + } + + /** + * Nimmt eine Adresse entgegen und erzeugt einen Marker. + * + * @param string $adress Zu suchende Adresse + * @param string $typ legt den Markertyp fest (marker,otherMarker,mapMarker) + * @param string $img legt die Markergrafik fest + * @param int $zoom legt den Kartenzoom fest (Default: 14) + * @return array + */ + function geocode($adress, $typ = 'marker', $img = "143.png", $zoom = 14) + { + if ($adress) { + $dims = getimagesize($img); + echo "var image = new Array('$img',$dims[0],$dims[1]);\n"; + if ($adress == "getAdress()") { + echo "geocodeAddress($adress,'$typ',image,$zoom);\n"; + } else { + echo "geocodeAddress('$adress','$typ',image,$zoom);\n"; + } + return true; + } else { + return false; + } + } + /** + * F\xFChrt ein Geocoding Request mit dem Google Geocoder aus. + * Die Anfrage sollte so aufgebaut sein: <strasse> <plz> <stadt> <land> + * + * @param string $input Geocoding Anfrage + * @param string $key Google Maps API Key (nur f\xFCr R\xFCckw\xE4rtskompatibilit\xE4t) + * @return array $point + */ + function getGeoPoint($input, $key = "") + { + if (!$key) { + $key = $this->key; + } + $input = urlencode($input); + $address = "http://maps.google.com/maps/geo?q=$input&key=$key&output=csv"; + $point = file_get_contents($address); + $point = explode(",", $point); + $point = array($point[2], $point[3]); + if (!empty($point)) { + return $point; + } else { + return false; + } + } + /** + * Parsed KML Dateien und gibt sie auf der Karte aus + * + * @param string $url Zu parsende Datei (erwartet immer eine URL !) + * @return bool + */ + function parseKml($url) + { + if ($url) { + echo "var geoXml = new GGeoXml(\"$url\");\n + map.addOverlay(geoXml);\n"; + return true; + } else { + return true; + } + } + + /** + * Parsed XML Dateien und gibt Geopunkte als Array zur\xFCck + * + * @param string $file Zu parsende Datei + * @return array + */ + function parseGxml($file) + { + $parser = new XMLParser($file, 'file', 1); + $tree = $parser->getTree(); + $points = array(); + foreach($tree[MARKERS][MARKER] as $marker) { + $lat = $marker[ATTRIBUTES][LAT]; + $lng = $marker[ATTRIBUTES][LNG]; + $arr = array($lat, $lng); + array_push($points, $arr); + } + if (!empty($points)) { + return $points; + } else { + return false; + } + } + /** + * Parsed XML Dateien und gibt Marker als Array zur\xFCck. + * + * @param string $file Zu parsende Datei + * @return array + */ + function xmlMapPoints($file) + { + $parser = new XMLParser($file, 'file', 1); + $tree = $parser->getTree(); + $points = array(); + foreach($tree[MAP][MARKERS][MARKER] as $marker) { + $lat = $marker[ATTRIBUTES][LAT]; + $lng = $marker[ATTRIBUTES][LNG]; + $img = $marker[ATTRIBUTES][IMAGE]; + $link = $marker[ATTRIBUTES][LINK]; + $arr = array($lat, $lng, $link, $img); + array_push($points, $arr); + } + return $points; + } + + /** + * Erzeugt die Kartendarstellung aus einer XML Datei + * + * @param string $file XML Datei + * @return bool + */ + function xmlMap($file) + { + $parser = new XMLParser($file, 'file', 1); + $tree = $parser->getTree(); + $lat = $tree[MAP][STARTLAT][VALUE]; + $lng = $tree[MAP][STARTLONG][VALUE]; + $width = $tree[MAP][WIDTH][VALUE]; + $height = $tree[MAP][HEIGHT][VALUE]; + $min_zoom = $tree[MAP][MINZOOM][VALUE]; + $typ = $tree[MAP][MAPTYPE][VALUE]; + $zoom = $tree[MAP][STARTZOOM][VALUE]; + if (!$min_zoom) { + $min_zoom = 1; + } + $max_zoom = $tree[MAP][MAXZOOM][VALUE]; + if (!$max_zoom) { + $max_zoom = 17; + } + $navcontrol = $tree[MAP][NAVCONTROL][VALUE]; + + $width = $width . "px"; + $height = $height . "px"; + + if ($typ == "normal") { + $typstr = "G_NORMAL_MAP"; + } elseif ($typ == "satellit") { + $typstr = "G_SATELLITE_MAP"; + } elseif ($typ == "hybrid") { + $typstr = "G_HYBRID_MAP"; + } + if ($navcontrol == "large") { + $controlstr = "GLargeMapControl()"; + } elseif ($navcontrol == "small") { + $controlstr = "GSmallMapControl()"; + } + echo " + <script type=\"text/javascript\"> + + var map = new GMap2(document.getElementById(\"gmapper_map\"));\n + map.addControl(new $controlstr);\n + map.addControl(new GMapTypeControl());\n + map.enableDoubleClickZoom();\n + map.enableContinuousZoom();\n + var mt = map.getMapTypes();\n + for (var i=0; i<mt.length; i++) { + mt[i].getMinimumResolution = function() {return $min_zoom;} + mt[i].getMaximumResolution = function() {return $max_zoom;} + } + map.addControl(new GMapTypeControl());\n + map.setCenter(new GLatLng( $lat,$lng),$zoom);\n + + map.setMapType($typstr);\n + </script>"; + return true; + } + // Ende Gmapper +} +// XML Parser Code +class XMLParser { + var $data; + var $vals; + var $collapse_dups; + var $index_numeric; + function XMLParser($data_source, $data_source_type = 'file', $collapse_dups = 0, $index_numeric = 0) + { + $this->collapse_dups = $collapse_dups; + $this->index_numeric = $index_numeric; + $this->data = ''; + if (file_exists($data_source)) + $this->data = implode('', file($data_source)); + else { + $fp = fopen($data_source, 'r'); + while (!feof($fp)) + $this->data .= fread($fp, 1000); + fclose($fp); + } + } + function getTree() + { + $parser = xml_parser_create('ISO-8859-1'); + xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); + xml_parse_into_struct($parser, $this->data, $vals, $index); + xml_parser_free($parser); + $i = -1; + return $this->getchildren($vals, $i); + } + function buildtag($thisvals, $vals, &$i, $type) + { + if (isset($thisvals['attributes'])) + $tag['ATTRIBUTES'] = $thisvals['attributes']; + if ($type === 'complete') + $tag['VALUE'] = $thisvals['value']; + else + $tag = array_merge($tag, $this->getchildren($vals, $i)); + + return $tag; + } + function getchildren($vals, &$i) + { + $children = array(); // Contains node data + if ($i > -1 && isset($vals[$i]['value'])) + $children['VALUE'] = $vals[$i]['value']; + while (++$i < count($vals)) { + $type = $vals[$i]['type']; + if ($type === 'cdata') + $children['VALUE'] .= $vals[$i]['value']; + elseif ($type === 'complete' || $type === 'open') { + $tag = $this->buildtag($vals[$i], $vals, $i, $type); + if ($this->index_numeric) { + $tag['TAG'] = $vals[$i]['tag']; + $children[] = $tag; + } else + $children[$vals[$i]['tag']][] = $tag; + } elseif ($type === 'close') + break; + } + if ($this->collapse_dups) + foreach($children as $key => $value) + if (is_array($value) && (count($value) == 1)) + $children[$key] = $value[0]; + return $children; + } + } + + ?> \ No newline at end of file Added: trunk/linpha2/lib/plugins/maps/gmapper1/dash.png =================================================================== (Binary files differ) Property changes on: trunk/linpha2/lib/plugins/maps/gmapper1/dash.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/linpha2/lib/plugins/maps/gmapper1/docs/gmap.html =================================================================== --- trunk/linpha2/lib/plugins/maps/gmapper1/docs/gmap.html (rev 0) +++ trunk/linpha2/lib/plugins/maps/gmapper1/docs/gmap.html 2007-08-18 16:28:16 UTC (rev 4762) @@ -0,0 +1,1148 @@ +<?xml version="1.0" encoding="iso-8859-1"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + <html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <!-- template designed by Marco Von Ballmoos --> + <title>Docs For Class gmap</title> + <link rel="stylesheet" href="stylesheet.css" /> + + <script language="javascript" type="text/javascript"> + var imgPlus = new Image(); + var imgMinus = new Image(); + imgPlus.src = "../media/images/plus.png"; + imgMinus.src = "../media/images/minus.png"; + + function showNode(Node){ + switch(navigator.family){ + case 'nn4': + // Nav 4.x code fork... + var oTable = document.layers["span" + Node]; + var oImg = document.layers["img" + Node]; + break; + case 'ie4': + // IE 4/5 code fork... + var oTable = document.all["span" + Node]; + var oImg = document.all["img" + Node]; + break; + case 'gecko': + // Standards Compliant code fork... + var oTable = document.getElementById("span" + Node); + var oImg = document.getElementById("img" + Node); + break; + } + oImg.src = imgMinus.src; + oTable.style.display = "block"; + } + + function hideNode(Node){ + switch(navigator.family){ + case 'nn4': + // Nav 4.x code fork... + var oTable = document.layers["span" + Node]; + var oImg = document.layers["img" + Node]; + break; + case 'ie4': + // IE 4/5 code fork... + var oTable = document.all["span" + Node]; + var oImg = document.all["img" + Node]; + break; + case 'gecko': + // Standards Compliant code fork... + var oTable = document.getElementById("span" + Node); + var oImg = document.getElementById("img" + Node); + break; + } + oImg.src = imgPlus.src; + oTable.style.display = "none"; + } + + function nodeIsVisible(Node){ + switch(navigator.family){ + case 'nn4': + // Nav 4.x code fork... + var oTable = document.layers["span" + Node]; + break; + case 'ie4': + // IE 4/5 code fork... + var oTable = document.all["span" + Node]; + break; + case 'gecko': + // Standards Compliant code fork... + var oTable = document.getElementById("span" + Node); + break; + } + return (oTable && oTable.style.display == "block"); + } + + function toggleNodeVisibility(Node){ + if (nodeIsVisible(Node)){ + hideNode(Node); + }else{ + showNode(Node); + } + } + </script> + </head> + <body> + <div class="page-body"> + +<h2 class="class-name">Class gmap</h2> + +<a name="sec-description"></a> +<div class="info-box"> + <div class="info-box-title">Description</div> + <div class="nav-bar"> + <span class="disabled">Description</span> | + <a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>) + | <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>) + + </div> + <div class="info-box-body"> + <!-- ========== Info from phpDoc block ========= --> + <ul class="tags"> + <li><span class="field">author:</span> Philipp Kiszka <<a href="mailto:in...@o-...">in...@o-...</a>></li> + <li><span class="field">version:</span> 1.0</li> + <li><span class="field">link:</span> <a href="http://gmapper.ajax-info.de">http://gmapper.ajax-info.de</a></li> + <li><span class="field">name:</span> Gmapper</li> + <li><span class="field">license:</span> <a href="http://opensource.org/licenses/gpl-license.php">GNU Public License</a></li> + </ul> + <p class="notes"> + Located in <a class="field" href="_class.gmapper.php.html">/class.gmapper.php</a> (line <span class="field">10</span>) + </p> + + + <pre></pre> + + </div> +</div> + + + + <a name="sec-var-summary"></a> + <div class="info-box"> + <div class="info-box-title">Variable Summary</span></div> + <div class="nav-bar"> + <a href="#sec-description">Description</a> | + <span class="disabled">Vars</span> (<a href="#sec-vars">details</a>) + | + <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>) + + </div> + <div class="info-box-body"> + <div class="var-summary"> + <div class="var-title"> + <span class="var-type">mixed</span> + <a href="#$key" title="details" class="var-name">$key</a> + </div> + </div> + </div> + </div> + + <a name="sec-method-summary"></a> + <div class="info-box"> + <div class="info-box-title">Method Summary</span></div> + <div class="nav-bar"> + <a href="#sec-description">Description</a> | + <a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>) + + | + <span class="disabled">Methods</span> (<a href="#sec-methods">details</a>) + </div> + <div class="info-box-body"> + <div class="method-summary"> + + <div class="method-definition"> + <span class="method-result">gmap</span> + <a href="#gmap" title="details" class="method-name">gmap</a> + ([<span class="var-type">string</span> <span class="var-name">$mapkey</span> = <span class="var-default">""</span>]) + </div> + + <div class="method-definition"> + <span class="method-result">bool</span> + <a href="#bodyjs" title="details" class="method-name">bodyjs</a> + () + </div> + + <div class="method-definition"> + <span class="method-result">bool</span> + <a href="#bounds" title="details" class="method-name">bounds</a> + () + </div> + + <div class="method-definition"> + <span class="method-result">bool</span> + <a href="#boundsExtend" title="details" class="method-name">boundsExtend</a> + () + </div> + + <div class="method-definition"> + <span class="method-result">bool</span> + <a href="#directions" title="details" class="method-name">directions</a> + (<span class="var-type">string</span> <span class="var-name">$start</span>, <span class="var-type">string</span> <span class="var-name">$end</span>, [<span class="var-type">string</span> <span class="var-name">$startmarker</span> = <span class="var-default">"143.png"</span>], [<span class="var-type">string</span> <span class="var-name">$endmarker</span> = <span class="var-default">"143.png"</span>], [<span class="var-type">int</span> <span class="var-name">$zoombounds</span> = <span class="var-default">0</span>], [<span class="var-type">string</span> <span class="var-name">$textbox</span> = <span class="var-default">""</span>]) + </div> + + <div class="method-definition"> + <span class="method-result">bool</span> + <a href="#footjs" title="details" class="method-name">footjs</a> + () + </div> + + <div class="method-definition"> + <span class="method-result">array</span> + <a href="#geocode" title="details" class="method-name">geocode</a> + (<span class="var-type">string</span> <span class="var-name">$adress</span>, [<span class="var-type">string</span> <span class="var-name">$typ</span> = <span class="var-default">'marker'</span>], [<span class="var-type">string</span> <span class="var-name">$img</span> = <span class="var-default">"143.png"</span>], [<span class="var-type">int</span> <span class="var-name">$zoom</span> = <span class="var-default">14</span>]) + </div> + + <div class="method-definition"> + <span class="method-result">int</span> + <a href="#getDistance" title="details" class="method-name">getDistance</a> + (<span class="var-type"></span> <span class="var-name">$koord</span>, <span class="var-type">array</span> <span class="var-name">$punkte</span>) + </div> + + <div class="method-definition"> + <span class="method-result">array</span> + <a href="#getGeoPoint" title="details" class="method-name">getGeoPoint</a> + (<span class="var-type">string</span> <span class="var-name">$input</span>, [<span class="var-type">string</span> <span class="var-name">$key</span> = <span class="var-default">""</span>]) + </div> + + <div class="method-definition"> + <span class="method-result">bool</span> + <a href="#headjs" title="details" class="method-name">headjs</a> + ([<span class="var-type">string</span> <span class="var-name">$key</span> = <span class="var-default">""</span>]) + </div> + + <div class="method-definition"> + <span class="method-result">bool</span> + <a href="#linkMarker" title="details" class="method-name">linkMarker</a> + (<span class="var-type">int</span> <span class="var-name">$lat</span>, <span class="var-type">int</span> <span class="var-name">$lng</span>, <span class="var-type">string</span> <span class="var-name">$link</span>, [<span class="var-type">string</span> <span class="var-name">$img</span> = <span class="var-default">"143.png"</span>]) + </div> + + <div class="method-definition"> + <span class="method-result">bool</span> + <a href="#lockMap" title="details" class="method-name">lockMap</a> + () + </div> + + <div class="method-definition"> + <span class="method-result">bool</span> + <a href="#map" title="details" class="method-name">map</a> + (<span class="var-type">int</span> <span class="var-name">$zoom</span>, <span class="var-type">int</span> <span class="var-name">$lat</span>, <span class="var-type">int</span> <span class="var-name">$lng</span>, [<span class="var-type">string</span> <span class="var-name">$typ</span> = <span class="var-default">"normal"</span>], [<span class="var-type">int</span> <span class="var-name">$min_zoom</span> = <span class="var-default">0</span>], [<span class="var-type">int</span> <span class="var-name">$max_zoom</span> = <span class="var-default">0</span>], [<span class="var-type">string</span> <span class="var-name">$navcontrol</span> = <span class="var-default">"large"</span>], [<span class="var-type">int</span> <span class="var-name">$overview</span> = <span class="var-default">0</span>], [<span class="var-type">int</span> <span class="var-name">$mousezoom</span> = <span class="var-default">1</span>], [<span class="var-type">int</span> <span class="var-name">$tilecheck</span> = <span class="var-default">1</span>]) + </div> + + <div class="method-definition"> + <span class="method-result">bool</span> + <a href="#mapdiv" title="details" class="method-name">mapdiv</a> + (<span class="var-type">int</span> <span class="var-name">$height</span>, <span class="var-type">int</span> <span class="var-name">$width</span>) + </div> + + <div class="method-definition"> + <span class="method-result">bool</span> + <a href="#mapMarker" title="details" class="method-name">mapMarker</a> + (<span class="var-type">int</span> <span class="var-name">$lat</span>, <span class="var-type">int</span> <span class="var-name">$lng</span>, [<span class="var-type">string</span> <span class="var-name">$img</span> = <span class="var-default">"143.png"</span>]) + </div> + + <div class="method-definition"> + <span class="method-result">bool</span> + <a href="#markend" title="details" class="method-name">markend</a> + () + </div> + + <div class="method-definition"> + <span class="method-result">bool</span> + <a href="#marker" title="details" class="method-name">marker</a> + (<span class="var-type">int</span> <span class="var-name">$lat</span>, <span class="var-type">int</span> <span class="var-name">$lng</span>, [<span class="var-type">string</span> <span class="var-name">$img</span> = <span class="var-default">"143.png"</span>]) + </div> + + <div class="method-definition"> + <span class="method-result">bool</span> + <a href="#markstart" title="details" class="method-name">markstart</a> + () + </div> + + <div class="method-definition"> + <span class="method-result">bool</span> + <a href="#otherMarker" title="details" class="method-name">otherMarker</a> + (<span class="var-type">int</span> <span class="var-name">$lat</span>, <span class="var-type">int</span> <span class="var-name">$lng</span>, [<span class="var-type">string</span> <span class="var-name">$html</span> = <span class="var-default">""</span>], [<span class="var-type">string</span> <span class="var-name">$img</span> = <span class="var-default">"143.png"</span>]) + </div> + + <div class="method-definition"> + <span class="method-result">array</span> + <a href="#parseGxml" title="details" class="method-name">parseGxml</a> + (<span class="var-type">string</span> <span class="var-name">$file</span>) + </div> + + <div class="method-definition"> + <span class="method-result">bool</span> + <a href="#parseKml" title="details" class="method-name">parseKml</a> + (<span class="var-type">string</span> <span class="var-name">$url</span>) + </div> + + <div class="method-definition"> + <span class="method-result">bool</span> + <a href="#polyline" title="details" class="method-name">polyline</a> + (<span class="var-type">array</span> <span class="var-name">$punkte</span>, [<span class="var-type">string</span> <span class="var-name">$color</span> = <span class="var-default">"#FF0000"</span>], [<span class="var-type">int</span> <span class="var-name">$breite</span> = <span class="var-default">1</span>], [<span class="var-type">int</span> <span class="var-name">$transparent</span> = <span class="var-default">0</span>], [<span class="var-type">string</span> <span class="var-name">$arrows</span> = <span class="var-default">""</span>], [<span class="var-type">int</span> <span class="var-name">$geodetic</span> = <span class="var-default">0</span>]) + </div> + + <div class="method-definition"> + <span class="method-result">bool</span> + <a href="#showScale" title="details" class="method-name">showScale</a> + () + </div> + + <div class="method-definition"> + <span class="method-result">bool</span> + <a href="#tabMarker" title="details" class="method-name">tabMarker</a> + (<span class="var-type">int</span> <span class="var-name">$lat</span>, <span class="var-type">int</span> <span class="var-name">$lng</span>, <span class="var-type">array</span> <span class="var-name">$tabs</span>, [<span class="var-type">string</span> <span class="var-name">$img</span> = <span class="var-default">"143.png"</span>]) + </div> + + <div class="method-definition"> + <span class="method-result">bool</span> + <a href="#xmlMap" title="details" class="method-name">xmlMap</a> + (<span class="var-type">string</span> <span class="var-name">$file</span>) + </div> + + <div class="method-definition"> + <span class="method-result">array</span> + <a href="#xmlMapPoints" title="details" class="method-name">xmlMapPoints</a> + (<span class="var-type">string</span> <span class="var-name">$file</span>) + </div> + + <div class="method-definition"> + <span class="method-result">bool</span> + <a href="#zoomToBounds" title="details" class="method-name">zoomToBounds</a> + () + </div> + </div> + </div> + </div> + + <a name="sec-vars"></a> + <div class="info-box"> + <div class="info-box-title">Variables</div> + <div class="nav-bar"> + <a href="#sec-description">Description</a> | + <a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>) + + + | + <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>) + + </div> + <div class="info-box-body"> + <a name="var$key" id="$key"><!-- --></A> +<div class="evenrow"> + + <div class="var-header"> + <span class="var-title"> + <span class="var-type">mixed</span> + <span class="var-name">$key</span> + (line <span class="line-number">12</span>) + </span> + </div> + + <!-- ========== Info from phpDoc block ========= --> + + + + + +</div> + + </div> + </div> + + <a name="sec-methods"></a> + <div class="info-box"> + <div class="info-box-title">Methods</div> + <div class="nav-bar"> + <a href="#sec-description">Description</a> | + <a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>) + <a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>) + + </div> + <div class="info-box-body"> + <A NAME='method_detail'></A> +<a name="methodgmap" id="gmap"><!-- --></a> +<div class="oddrow"> + + <div class="method-header"> + <span class="method-title">Constructor gmap</span> (line <span class="line-number">19</span>) + </div> + + <!-- ========== Info from phpDoc block ========= --> +<p class="short-description">Der Konstruktor nimmt den Google Maps API Key als Parameter entgegen.</p> +<p class="description"><p>Dies ist die empfohlene Methode, den API Key einzubinden.</p></p> + + <div class="method-signature"> + <span class="method-result">gmap</span> + <span class="method-name"> + gmap + </span> + ([<span class="var-type">string</span> <span class="var-name">$mapkey</span> = <span class="var-default">""</span>]) + </div> + + <ul class="parameters"> + <li> + <span class="var-type">string</span> + <span class="var-name">$mapkey</span><span class="var-description">: Google Maps API Key</span> </li> + </ul> + + + </div> +<a name="methodbodyjs" id="bodyjs"><!-- --></a> +<div class="evenrow"> + + <div class="method-header"> + <span class="method-title">bodyjs</span> (line <span class="line-number">171</span>) + </div> + + <!-- ========== Info from phpDoc block ========= --> +<p class="short-description">Erzeugt den JS Code im BODY der Seite.</p> + + <div class="method-signature"> + <span class="method-result">bool</span> + <span class="method-name"> + bodyjs + </span> + () + </div> + + + + </div> +<a name="methodbounds" id="bounds"><!-- --></a> +<div class="oddrow"> + + <div class="method-header"> + <span class="method-title">bounds</span> (line <span class="line-number">394</span>) + </div> + + <!-- ========== Info from phpDoc block ========= --> +<p class="short-description">Erzeugt ein Bounds Objekt</p> + + <div class="method-signature"> + <span class="method-result">bool</span> + <span class="method-name"> + bounds + </span> + () + </div> + + + + </div> +<a name="methodboundsExtend" id="boundsExtend"><!-- --></a> +<div class="evenrow"> + + <div class="method-header"> + <span class="method-title">boundsExtend</span> (line <span class="line-number">404</span>) + </div> + + <!-- ========== Info from phpDoc block ========= --> +<p class="short-description">Erweitert ein vorhandenes Bounds Objekt um den zuletzt hinzugef\xFCgten Punkt.</p> + + <div class="method-signature"> + <span class="method-result">bool</span> + <span class="method-name"> + boundsExtend + </span> + () + </div> + + + + </div> +<a name="methoddirections" id="directions"><!-- --></a> +<div class="oddrow"> + + <div class="method-header"> + <span class="method-title">directions</span> (line <span class="line-number">343</span>) + </div> + + <!-- ========== Info from phpDoc block ========= --> +<p class="short-description">Erzeugt ein Geocoding Request und gibt eine Polyline, sowie Ortsliste zur\xFCck</p> + + <div class="method-signature"> + <span class="method-result">bool</span> + <span class="method-name"> + directions + </span> + (<span class="var-type">string</span> <span class="var-name">$start</span>, <span class="var-type">string</span> <span class="var-name">$end</span>, [<span class="var-type">string</span> <span class="var-name">$startmarker</span> = <span class="var-default">"143.png"</span>], [<span class="var-type">string</span> <span class="var-name">$endmarker</span> = <span class="var-default">"143.png"</span>], [<span class="var-type">int</span> <span class="var-name">$zoombounds</span> = <span class="var-default">0</span>], [<span class="var-type">string</span> <span class="var-name">$textbox</span> = <span class="var-default">""</span>]) + </div> + + <ul class="parameters"> + <li> + <span class="var-type">string</span> + <span class="var-name">$start</span><span class="var-description">: Startort</span> </li> + <li> + <span class="var-type">string</span> + <span class="var-name">$end</span><span class="var-description">: Endort</span> </li> + <li> + <span class="var-type">string</span> + <span class="var-name">$startmarker</span><span cl... [truncated message content] |
From: Vytautas K. <vyt...@us...> - 2007-08-13 10:31:58
|
Update of /cvsroot/linpha/linpha In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv9137 Modified Files: ChangeLog Log Message: php4 compatability fix Index: ChangeLog =================================================================== RCS file: /cvsroot/linpha/linpha/ChangeLog,v retrieving revision 1.1266 retrieving revision 1.1267 diff -C2 -d -r1.1266 -r1.1267 *** ChangeLog 11 Aug 2007 08:00:22 -0000 1.1266 --- ChangeLog 13 Aug 2007 10:31:22 -0000 1.1267 *************** *** 1,2 **** --- 1,5 ---- + 2007-08-13 vytautas + * replace all stripos with strpos for php4 compatability + 2007-08-11 flo * hopefully finally fixed get_thumb_order() |
From: Vytautas K. <vyt...@us...> - 2007-08-13 10:31:31
|
Update of /cvsroot/linpha/linpha/functions In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv9137/functions Modified Files: db_api.php Log Message: php4 compatability fix Index: db_api.php =================================================================== RCS file: /cvsroot/linpha/linpha/functions/db_api.php,v retrieving revision 1.108 retrieving revision 1.109 diff -C2 -d -r1.108 -r1.109 *** db_api.php 11 Aug 2007 08:00:22 -0000 1.108 --- db_api.php 13 Aug 2007 10:31:23 -0000 1.109 *************** *** 1243,1248 **** if ($DHTMLenabled) { ! $part1 = substr($DHTML_txt_warning, 0, stripos($DHTML_txt_warning, '<!-- notice end -->')); ! $part2 = substr($DHTML_txt_warning, stripos($DHTML_txt_warning, '<!-- notice end -->')); $DHTML_txt_warning = $part1.'<tr><td width="20%">'.$omitting_why.'</td><td width="80%">'.$omitting_str.'</td></tr>'.$part2; --- 1243,1248 ---- if ($DHTMLenabled) { ! $part1 = substr($DHTML_txt_warning, 0, strpos($DHTML_txt_warning, '<!-- notice end -->')); ! $part2 = substr($DHTML_txt_warning, strpos($DHTML_txt_warning, '<!-- notice end -->')); $DHTML_txt_warning = $part1.'<tr><td width="20%">'.$omitting_why.'</td><td width="80%">'.$omitting_str.'</td></tr>'.$part2; *************** *** 1278,1283 **** } if ($DHTMLenabled) { ! $part1 = substr($DHTML_txt_warning, 0, stripos($DHTML_txt_warning, '<!-- notice end -->')); ! $part2 = substr($DHTML_txt_warning, stripos($DHTML_txt_warning, '<!-- notice end -->')); $DHTML_txt_warning = $part1.'<tr><td width="20%">'.$omitting_why.'</td><td width="80%">'.$omitting_str.'</td></tr>'.$part2; --- 1278,1283 ---- } if ($DHTMLenabled) { ! $part1 = substr($DHTML_txt_warning, 0, strpos($DHTML_txt_warning, '<!-- notice end -->')); ! $part2 = substr($DHTML_txt_warning, strpos($DHTML_txt_warning, '<!-- notice end -->')); $DHTML_txt_warning = $part1.'<tr><td width="20%">'.$omitting_why.'</td><td width="80%">'.$omitting_str.'</td></tr>'.$part2; *************** *** 1860,1865 **** } if ($DHTMLenabled) { ! $part1 = substr($DHTML_txt_warning, 0, stripos($DHTML_txt_warning, '<!-- notice end -->')); ! $part2 = substr($DHTML_txt_warning, stripos($DHTML_txt_warning, '<!-- notice end -->')); $DHTML_txt_warning = $part1.'<tr><td width="20%">'.$omitting_why.'</td><td width="80%">'.$omitting_str.'</td></tr>'.$part2; --- 1860,1865 ---- } if ($DHTMLenabled) { ! $part1 = substr($DHTML_txt_warning, 0, strpos($DHTML_txt_warning, '<!-- notice end -->')); ! $part2 = substr($DHTML_txt_warning, strpos($DHTML_txt_warning, '<!-- notice end -->')); $DHTML_txt_warning = $part1.'<tr><td width="20%">'.$omitting_why.'</td><td width="80%">'.$omitting_str.'</td></tr>'.$part2; |
From: Florian A. <fan...@us...> - 2007-08-11 08:00:32
|
Update of /cvsroot/linpha/linpha/functions In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30342/functions Modified Files: db_api.php Log Message: 2007-08-11 flo * hopefully finally fixed get_thumb_order() the changes after 1.3.2 are not security relevant Index: db_api.php =================================================================== RCS file: /cvsroot/linpha/linpha/functions/db_api.php,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** db_api.php 11 Aug 2007 07:45:42 -0000 1.107 --- db_api.php 11 Aug 2007 08:00:22 -0000 1.108 *************** *** 875,879 **** ##########################################################*/ ! switch($order_by) { case "file": $order_by="filename ASC"; break; --- 875,883 ---- ##########################################################*/ ! if(empty($order_by)) { ! $order_by = read_config('sort_thumbs'); ! } ! ! switch($order_by) { case "file": $order_by="filename ASC"; break; |
From: Florian A. <fan...@us...> - 2007-08-11 08:00:32
|
Update of /cvsroot/linpha/linpha In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30342 Modified Files: ChangeLog Log Message: 2007-08-11 flo * hopefully finally fixed get_thumb_order() the changes after 1.3.2 are not security relevant Index: ChangeLog =================================================================== RCS file: /cvsroot/linpha/linpha/ChangeLog,v retrieving revision 1.1265 retrieving revision 1.1266 diff -C2 -d -r1.1265 -r1.1266 *** ChangeLog 11 Aug 2007 07:45:42 -0000 1.1265 --- ChangeLog 11 Aug 2007 08:00:22 -0000 1.1266 *************** *** 1,2 **** --- 1,6 ---- + 2007-08-11 flo + * hopefully finally fixed get_thumb_order() + the changes after 1.3.2 are not security relevant + 2007-08-11 bzrudi * Minor code cleanups for thumborder related stuff |
From: bzrudi <bz...@us...> - 2007-08-11 07:45:58
|
Update of /cvsroot/linpha/linpha/install In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv24542/install Modified Files: forth_stage_install.php Log Message: Minor code cleanups for thumborder related stuff Index: forth_stage_install.php =================================================================== RCS file: /cvsroot/linpha/linpha/install/forth_stage_install.php,v retrieving revision 1.176 retrieving revision 1.177 diff -C2 -d -r1.176 -r1.177 *** forth_stage_install.php 3 Jul 2007 14:37:46 -0000 1.176 --- forth_stage_install.php 11 Aug 2007 07:45:42 -0000 1.177 *************** *** 1086,1090 **** 'use_convert' => $_POST['use_convert'], 'convert_path' => $_POST['convert_path'], ! 'sort_thumbs' => '0', 'style' => 'aqua', 'thumb_quality' => $_POST['quality'], --- 1086,1090 ---- 'use_convert' => $_POST['use_convert'], 'convert_path' => $_POST['convert_path'], ! 'sort_thumbs' => 'file', 'style' => 'aqua', 'thumb_quality' => $_POST['quality'], |
From: bzrudi <bz...@us...> - 2007-08-11 07:45:58
|
Update of /cvsroot/linpha/linpha/functions In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv24542/functions Modified Files: db_api.php Log Message: Minor code cleanups for thumborder related stuff Index: db_api.php =================================================================== RCS file: /cvsroot/linpha/linpha/functions/db_api.php,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** db_api.php 10 Aug 2007 04:26:48 -0000 1.106 --- db_api.php 11 Aug 2007 07:45:42 -0000 1.107 *************** *** 874,882 **** ## sort order for the thumbnails ##########################################################*/ - if(!isset($order_by)) { - $order_by = read_config('sort_thumbs'); - } ! switch($order_by) { case "file": $order_by="filename ASC"; break; --- 874,879 ---- ## sort order for the thumbnails ##########################################################*/ ! switch($order_by) { case "file": $order_by="filename ASC"; break; *************** *** 886,890 **** case "prev_path": $order_by="prev_path ASC"; break; case "prev_pathdesc": $order_by="prev_path DESC"; break; - case "0": $order_by="filename ASC"; break; // stats_view.php --- 883,886 ---- |
From: bzrudi <bz...@us...> - 2007-08-11 07:45:58
|
Update of /cvsroot/linpha/linpha In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv24542 Modified Files: ChangeLog Log Message: Minor code cleanups for thumborder related stuff Index: ChangeLog =================================================================== RCS file: /cvsroot/linpha/linpha/ChangeLog,v retrieving revision 1.1264 retrieving revision 1.1265 diff -C2 -d -r1.1264 -r1.1265 *** ChangeLog 10 Aug 2007 04:26:47 -0000 1.1264 --- ChangeLog 11 Aug 2007 07:45:42 -0000 1.1265 *************** *** 1,2 **** --- 1,5 ---- + 2007-08-11 bzrudi + * Minor code cleanups for thumborder related stuff + ############################################### ### ### |