firebug-cvs Mailing List for FireBug: wireless wildfire monitoring (Page 10)
Brought to you by:
doolin
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(36) |
Jun
(45) |
Jul
(108) |
Aug
(31) |
Sep
(2) |
Oct
(4) |
Nov
(113) |
Dec
(20) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(63) |
Feb
(37) |
Mar
(24) |
Apr
(6) |
May
(5) |
Jun
(5) |
Jul
(71) |
Aug
(42) |
Sep
(7) |
Oct
|
Nov
|
Dec
|
2005 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
(64) |
Jun
(71) |
Jul
(51) |
Aug
(89) |
Sep
(24) |
Oct
(1) |
Nov
(1) |
Dec
(2) |
2006 |
Jan
|
Feb
|
Mar
(3) |
Apr
(2) |
May
|
Jun
|
Jul
(21) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: David M. D. <do...@us...> - 2005-06-14 20:25:06
|
Update of /cvsroot/firebug/firebug/web/gmaps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23624 Modified Files: db_gmap.php db_render_xml.php Log Message: Added weather data to gmap front end. Index: db_render_xml.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/gmaps/db_render_xml.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** db_render_xml.php 9 Jun 2005 18:55:27 -0000 1.9 --- db_render_xml.php 14 Jun 2005 20:24:57 -0000 1.10 *************** *** 71,75 **** /** TODO: Remove hardcoded db and table names. */ ! $dbname = "task"; $tblname = "gga_l"; --- 71,75 ---- /** TODO: Remove hardcoded db and table names. */ ! $dbname = "rfs_demo_06_09_2005"; $tblname = "gga_l"; *************** *** 99,104 **** die("Cannot select from table\n"); } - - /*** --- 99,102 ---- *************** *** 142,149 **** $icon = $icons[$nodeid]; $id = $ids[$i]; $title = "Firebug sensor $nodeid"; ! $address = "<line>Firebug sensor $nodeid</line>"; emit_gps_location($id,$lat,$long,$image,$icon,$title,$address); $global_id = $i; } --- 140,168 ---- $icon = $icons[$nodeid]; $id = $ids[$i]; + + $title = "Firebug sensor $nodeid"; ! ! ! $query = "SELECT temperature,humidity,pressure FROM xbow_weather_l where nodeid = $nodeid"; ! $result = @pg_query($dbh,$query); ! if(!result) { ! die("Cannot select from table\n"); ! } ! ! $wrow = pg_fetch_array($result, NULL, PGSQL_ASSOC) or perr("db_render_xml", "Cannot retrieve data"); ! $temp = $wrow["temperature"]; ! $humidity = $wrow["humidity"]; ! $pressure = $wrow["pressure"]; ! ! $address = "<line>Firebug sensor $nodeid</line><line>Temp: $temp C</line><line>Rel. Hum: $humidity%</line><line>Press: $pressure mBar</line>"; ! emit_gps_location($id,$lat,$long,$image,$icon,$title,$address); $global_id = $i; + + + + + } *************** *** 171,176 **** $lat = 37.918128; $long = 122.33185; ! $address = "<line>Here be spiders...</line>\n<line>Building 454, Room 1</line>"; ! $image = "/firebug/images/spider.png"; //print($icon); --- 190,195 ---- $lat = 37.918128; $long = 122.33185; ! $address = "<line>Nick's office</line>\n<line>Building 454, Room 1</line>"; ! $image = "images/sitar.jpg"; //print($icon); Index: db_gmap.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/gmaps/db_gmap.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** db_gmap.php 9 Jun 2005 03:53:08 -0000 1.3 --- db_gmap.php 14 Jun 2005 20:24:56 -0000 1.4 *************** *** 26,30 **** } ! t.dump = function(a) {alert(a);} //debugging function _loadXmlFileFromURL(url, mapApp) { --- 26,30 ---- } ! //t.dump = function(a) {alert(a);} //debugging function _loadXmlFileFromURL(url, mapApp) { |
From: David M. D. <do...@us...> - 2005-06-14 20:24:09
|
Update of /cvsroot/firebug/firebug/web/gmaps/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23253 Added Files: dave.jpg kar.jpg Log Message: Custom images for gmap frontend. --- NEW FILE: dave.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: kar.jpg --- (This appears to be a binary file; contents omitted.) |
From: David M. D. <do...@us...> - 2005-06-14 20:23:38
|
Update of /cvsroot/firebug/firebug/web/gmaps/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23056 Added Files: sitar.jpg Log Message: Custom images for gmap frontend. --- NEW FILE: sitar.jpg --- (This appears to be a binary file; contents omitted.) |
From: David M. D. <do...@us...> - 2005-06-13 17:28:34
|
Update of /cvsroot/firebug/firebug/web/gmaps/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14043/images Log Message: Directory /cvsroot/firebug/firebug/web/gmaps/images added to the repository |
From: David M. D. <do...@us...> - 2005-06-09 18:56:31
|
Update of /cvsroot/firebug/firebug/web/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14446/images Added Files: greensensor.png redsensor.png yellowsensor.png Log Message: Added more images for web app. --- NEW FILE: redsensor.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: yellowsensor.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: greensensor.png --- (This appears to be a binary file; contents omitted.) |
From: David M. D. <do...@us...> - 2005-06-09 18:55:37
|
Update of /cvsroot/firebug/firebug/web/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14006/images Modified Files: greenman.png Added Files: redengine.png redengine_large.png teardrop.png Log Message: Added more images for web app. --- NEW FILE: teardrop.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: redengine.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: redengine_large.png --- (This appears to be a binary file; contents omitted.) Index: greenman.png =================================================================== RCS file: /cvsroot/firebug/firebug/web/images/greenman.png,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvsYgxdYk and /tmp/cvsKeoqny differ |
From: David M. D. <do...@us...> - 2005-06-09 18:55:37
|
Update of /cvsroot/firebug/firebug/web/gmaps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14006/gmaps Modified Files: db_render_xml.php geocodeinfo_rfs.xsl Log Message: Added more images for web app. Index: db_render_xml.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/gmaps/db_render_xml.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** db_render_xml.php 9 Jun 2005 03:53:08 -0000 1.8 --- db_render_xml.php 9 Jun 2005 18:55:27 -0000 1.9 *************** *** 16,35 **** ! $images=array(14 => 'http://localhost/firebug/images/greenman.png', ! 17 => 'http://localhost/firebug/images/redman.png', 23 => 'http://localhost/firebug/images/greenman.png', ! 24 => 'http://localhost/firebug/images/greenman.png', ! 25 => 'http://localhost/firebug/images/greenman.png', ! 28 => 'http://localhost/firebug/images/greenman.png'); ! ! $icons=array(14 => 'http://localhost/firebug/images/sensor.png', ! 17 => 'http://localhost/firebug/images/sensor.png', ! 23 => 'http://localhost/firebug/images/sensor.png', ! 24 => 'http://localhost/firebug/images/sensor.png', ! 25 => 'http://localhost/firebug/images/sensor.png', ! 28 => 'http://localhost/firebug/images/sesnor.png'); function emit_gps_location($id, $lat, $long, $icon, $image, $title, $address) { --- 16,41 ---- ! /** TODO: In the future, the images and motes need ! * to be associated according to the state of ! * mote or environmental conditions around the mote. ! * These are hardwired for now for conducting a demo ! * at Richmond Field Station. ! */ ! $images=array(14 => 'http://localhost/firebug/images/redengine.png', ! 17 => 'http://localhost/firebug/images/redman.png', 23 => 'http://localhost/firebug/images/greenman.png', ! 24 => 'http://localhost/firebug/images/yellowsensor.png', ! 25 => 'http://localhost/firebug/images/redsensor.png', ! 28 => 'http://localhost/firebug/images/greensensor.png'); + $icons=array(14 => 'http://localhost/firebug/images/redengine.png', + 17 => 'http://localhost/firebug/images/greenman.png', + 23 => 'http://localhost/firebug/images/redman.png', + 24 => 'http://localhost/firebug/images/yellowsensor.png', + 25 => 'http://localhost/firebug/images/redsensor.png', + 28 => 'http://localhost/firebug/images/greensensor.png'); + $global_id = 0; function emit_gps_location($id, $lat, $long, $icon, $image, $title, $address) { *************** *** 68,72 **** $tblname = "gga_l"; ! global $ids, $images, $icons; $dbh = connect_postgres($dbname); --- 74,78 ---- $tblname = "gga_l"; ! global $ids, $images, $icons, $global_id; $dbh = connect_postgres($dbname); *************** *** 123,126 **** --- 129,135 ---- $longmin=$value; break; + case "nodeid": + $nodeid=$value; + break; default: $disp[$key]=$value; *************** *** 130,139 **** $lat = $latdeg + (float)($latmin/60.0); $long = $longdeg + ($longmin/60.0); ! $image = $images[14]; ! $icon = $icons[14]; $id = $ids[$i]; ! $title = 'Foo Bar'; ! $address = '<line>Dave and Karthik</line>'; emit_gps_location($id,$lat,$long,$image,$icon,$title,$address); } --- 139,149 ---- $lat = $latdeg + (float)($latmin/60.0); $long = $longdeg + ($longmin/60.0); ! $image = $images[$nodeid]; ! $icon = $icons[$nodeid]; $id = $ids[$i]; ! $title = "Firebug sensor $nodeid"; ! $address = "<line>Firebug sensor $nodeid</line>"; emit_gps_location($id,$lat,$long,$image,$icon,$title,$address); + $global_id = $i; } *************** *** 157,164 **** print_from_database(); ! $icon = $images[14]; ! $id = $ids[2]; ! $lat = 37.9177; ! $long = 122.332; $address = "<line>Here be spiders...</line>\n<line>Building 454, Room 1</line>"; $image = "/firebug/images/spider.png"; --- 167,174 ---- print_from_database(); ! $icon = "/firebug/images/teardrop.png";//$images[14]; ! $id = $ids[7]; ! $lat = 37.918128; ! $long = 122.33185; $address = "<line>Here be spiders...</line>\n<line>Building 454, Room 1</line>"; $image = "/firebug/images/spider.png"; *************** *** 167,170 **** --- 177,182 ---- emit_gps_location($id,$lat,$long,$icon,$image,'Nick\'s office',$address); + //$address = '<line>Dave and Karthik</line>'; + print("</overlay>\n"); print("</page>\n"); Index: geocodeinfo_rfs.xsl =================================================================== RCS file: /cvsroot/firebug/firebug/web/gmaps/geocodeinfo_rfs.xsl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** geocodeinfo_rfs.xsl 8 Jun 2005 22:29:42 -0000 1.2 --- geocodeinfo_rfs.xsl 9 Jun 2005 18:55:27 -0000 1.3 *************** *** 31,35 **** </xsl:variable> ! <div style="font-weight: bold">FireBug --- personnel</div> <div> --- 31,35 ---- </xsl:variable> ! <div style="font-weight: bold">Project FireBug</div> <div> |
From: David M. D. <do...@us...> - 2005-06-09 03:53:18
|
Update of /cvsroot/firebug/firebug/web/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30891/images Added Files: spider.png Log Message: Reformatted maps web app, moved image and icon handling into associative arrays. --- NEW FILE: spider.png --- (This appears to be a binary file; contents omitted.) |
From: David M. D. <do...@us...> - 2005-06-09 03:53:17
|
Update of /cvsroot/firebug/firebug/web/gmaps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30891/gmaps Modified Files: connect.php db_gmap.php db_render_xml.php Log Message: Reformatted maps web app, moved image and icon handling into associative arrays. Index: db_render_xml.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/gmaps/db_render_xml.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** db_render_xml.php 9 Jun 2005 01:34:04 -0000 1.7 --- db_render_xml.php 9 Jun 2005 03:53:08 -0000 1.8 *************** *** 3,19 **** ! function emit_gps_location($id, $lat, $long, $icon) { ! printf("<location infoStyle=\"geocodeinfo_rfs.xsl\" id=\"$id\">\n"); print("<point lat=\"$lat\" lng=\"-$long\"/>\n"); ! printf("<icon image=\"%s\" class=\"local\"/>\n", $icon); print("<info>") or perr("db_render_xml","4"); print("<title xml:space=\"preserve\" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\">\n") or perr("db_render_xml","5"); print("</title>\n") or perr("db_render_xml","6"); print("<address>\n") or perr("db_render_xml","8"); ! print("<line>Ms. Eva Green</line>\n") or perr("db_render_xml","9"); print("</address>\n") or perr("db_render_xml","10"); print("<image>") or perr("db_render_xml","11"); ! print("http://localhost/firebug/images/greenman.png") or perr("db_render_xml","12"); print("</image>\n") or perr("db_render_xml","13"); print("</info>\n") or perr("db_render_xml","14"); --- 3,51 ---- ! /*** ! * ! * Setting up google maps specific stuff ! * ! * $ids contains the ten ids that you can associate ! * with locations ! * ! * $ imgs lists the image icons that you can have ! * ! ***/ ! $ids=array('A','B','C','D','E','F','G','H','I','J'); ! ! $images=array(14 => 'http://localhost/firebug/images/greenman.png', ! 17 => 'http://localhost/firebug/images/redman.png', ! 23 => 'http://localhost/firebug/images/greenman.png', ! 24 => 'http://localhost/firebug/images/greenman.png', ! 25 => 'http://localhost/firebug/images/greenman.png', ! 28 => 'http://localhost/firebug/images/greenman.png'); ! ! $icons=array(14 => 'http://localhost/firebug/images/sensor.png', ! 17 => 'http://localhost/firebug/images/sensor.png', ! 23 => 'http://localhost/firebug/images/sensor.png', ! 24 => 'http://localhost/firebug/images/sensor.png', ! 25 => 'http://localhost/firebug/images/sensor.png', ! 28 => 'http://localhost/firebug/images/sesnor.png'); ! ! ! ! ! function emit_gps_location($id, $lat, $long, $icon, $image, $title, $address) { ! ! print("<location infoStyle=\"geocodeinfo_rfs.xsl\" id=\"$id\">\n"); print("<point lat=\"$lat\" lng=\"-$long\"/>\n"); ! print("<icon image=\"$icon\" class=\"local\"/>\n"); print("<info>") or perr("db_render_xml","4"); print("<title xml:space=\"preserve\" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\">\n") or perr("db_render_xml","5"); + print $title or perr("db_render_xml","title won't print"); print("</title>\n") or perr("db_render_xml","6"); print("<address>\n") or perr("db_render_xml","8"); ! //print("<line>Ms. Eva Green</line>\n") or perr("db_render_xml","9"); ! print "$address\n" or perr("db_render_xml","address won't print"); print("</address>\n") or perr("db_render_xml","10"); print("<image>") or perr("db_render_xml","11"); ! print "$image" or perr("db_render_xml","12"); print("</image>\n") or perr("db_render_xml","13"); print("</info>\n") or perr("db_render_xml","14"); *************** *** 24,48 **** ! /** TODO: All of the following code needs to be moved to ! * a function for printing gps locations. */ function print_from_database() { - /** TODO: Replace with an associative array keying images to - * physical events. For example: fire_fighter_danger => redman.png. - */ - $imgs=array('/firebug/images/greenman.png');//,'/firebug/images/redman.png'); - - /*** - * - * Setting up google maps specific stuff - * - * $ids contains the ten ids that you can associate - * with locations - * - * $ imgs lists the image icons that you can have - * - ***/ - $ids=array('A','B','C','D','E','F','G','H','I','J'); /** TODO: Remove hardcoded db and table names. --- 56,65 ---- ! /** TODO: Refactor the code for connecting to the ! * database into it's own function, rewrite this ! * as a print lat long location. */ function print_from_database() { /** TODO: Remove hardcoded db and table names. *************** *** 51,55 **** $tblname = "gga_l"; ! $dbh = connect_postgres($dbname); --- 68,72 ---- $tblname = "gga_l"; ! global $ids, $images, $icons; $dbh = connect_postgres($dbname); *************** *** 86,94 **** * ***/ ! ! $rows = pg_numrows($stat); ! ! ! for ($i=0;$i<$rows;$i++) { --- 103,107 ---- * ***/ ! $rows = pg_numrows($stat); for ($i=0;$i<$rows;$i++) { *************** *** 117,124 **** $lat = $latdeg + (float)($latmin/60.0); $long = $longdeg + ($longmin/60.0); ! $icon = $imgs[0]; $id = $ids[$i]; ! ! emit_gps_location($id,$lat,$long,$icon); } --- 130,139 ---- $lat = $latdeg + (float)($latmin/60.0); $long = $longdeg + ($longmin/60.0); ! $image = $images[14]; ! $icon = $icons[14]; $id = $ids[$i]; ! $title = 'Foo Bar'; ! $address = '<line>Dave and Karthik</line>'; ! emit_gps_location($id,$lat,$long,$image,$icon,$title,$address); } *************** *** 137,146 **** print("<overlay panelStyle=\"sidepanel.xsl\">\n\n\n"); print_from_database(); ! // $icon = $imgs[1]; ! // $id = $ids[3]; ! //emit_gps_location($id,37.9177,-122.332,$icon); print("</overlay>\n"); --- 152,169 ---- print("<overlay panelStyle=\"sidepanel.xsl\">\n\n\n"); + + + // An ugly function, can be refactored later. print_from_database(); ! $icon = $images[14]; ! $id = $ids[2]; ! $lat = 37.9177; ! $long = 122.332; ! $address = "<line>Here be spiders...</line>\n<line>Building 454, Room 1</line>"; ! $image = "/firebug/images/spider.png"; ! //print($icon); ! emit_gps_location($id,$lat,$long,$icon,$image,'Nick\'s office',$address); print("</overlay>\n"); Index: connect.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/gmaps/connect.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** connect.php 8 Jun 2005 22:29:42 -0000 1.2 --- connect.php 9 Jun 2005 03:53:08 -0000 1.3 *************** *** 14,18 **** ! $connstr = "dbname=$db user=postgres host=192.168.1.131 port=5432"; //print "$connstr"; --- 14,20 ---- ! //$connstr = "dbname=$db user=postgres host=192.168.1.131 port=5432"; ! //$connstr = "dbname=$db user=postgres host=10.0.1.10 port=5432"; ! $connstr = "dbname=$db user=postgres host=localhost port=5432"; //print "$connstr"; Index: db_gmap.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/gmaps/db_gmap.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** db_gmap.php 8 Jun 2005 22:29:42 -0000 1.2 --- db_gmap.php 9 Jun 2005 03:53:08 -0000 1.3 *************** *** 75,122 **** <!-- Note: Map height always maximum? --> <div style="position:absolute;left:5px;top:10px;right:5px;border:solid thin grey;"> ! <div id="container_frb" style="float:right;width:35%;" ></div> ! <div style="float:left;position:relative;left:10px;width:60%"> ! ! <!-- ! <div style="position:absolute;left:0px;top:0px;width:50%;overflow:auto;"> ! ! ! ! ! <h1 style="font-family:sans-serif;font-size:medium;">Unofficial Google Maps Embedding How To : Demo Two</h1> ! ! <p><tt>_MapsApplication({container div}, {panel div}, {metapanel div}, {permalink div}, {toggle div} | null, {printheader div})</tt></p> ! ! ! <p><dl> ! <dt style="font-weight:bold;">Container div</dt> ! ! <dd>The <tt><div></tt> where the map should be displayed.</dd> ! ! <dt style="font-weight:bold;">Panel div</dt> ! <dd>The <tt><div></tt> where the "sidepanel" should be displayed.</dd> ! ! <dt style="font-weight:bold;">Metapanel div</dt> ! <dd>It appears Gmaps uses this to display error and other messages</dd> ! ! <dt style="font-weight:bold;">Permalink div</dt> ! <dd>It appears Gmaps uses this to display a permanent URL. (Now appears to be required.)</dd> ! ! <dt style="font-weight:bold;">Toggle div</dt> ! ! <dd>The <tt><div></tt> where the map specification toggle should be displayed. The toggle switches between different map specifications, e.g. Map view and Satellite view. </dd> ! ! <dt style="font-weight:bold;">Printheader div</dt> ! <dd>Presumably displayed at the head of a printed map.</dd> ! </dl> </p> ! ! <p style="font-size:x-small;">-- follower at rancidbacon.com <br /> (Original page: <a href="http://stuff.rancidbacon.com/google-maps-embed-how-to/demo2.html">http://stuff.rancidbacon.com/google-maps-embed-how-to/demo2.html</a>)</p> ! ! <p style="font-size:x-small;">26 May 2005</p> ! </div> ! --> <div style="position:absolute;left:50%;top:5px;width:50%;"> <div id="toggle" style="position:absolute;top:0px:left:10px;font-family:sans-serif;font-size:smaller;"> </div> --- 75,85 ---- <!-- Note: Map height always maximum? --> <div style="position:absolute;left:5px;top:10px;right:5px;border:solid thin grey;"> ! <div id="container_frb" style="float:right;width:65%;" ></div> ! <div style="float:left;position:relative;left:10px;width:30%"> + <!-- <div style="position:absolute;left:50%;top:5px;width:50%;"> + --> <div id="toggle" style="position:absolute;top:0px:left:10px;font-family:sans-serif;font-size:smaller;"> </div> |
From: David M. D. <do...@us...> - 2005-06-09 01:34:13
|
Update of /cvsroot/firebug/firebug/web/gmaps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21823 Modified Files: db_render_xml.php Log Message: Wrote a php function to emit an xml location element for adding icons, cartoon bubbles to google map. Index: db_render_xml.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/gmaps/db_render_xml.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** db_render_xml.php 9 Jun 2005 01:14:59 -0000 1.6 --- db_render_xml.php 9 Jun 2005 01:34:04 -0000 1.7 *************** *** 1,13 **** <?php include("connect.php"); - /* - if ($HTTP_POST_VARS["tbl1"]!=Null){ - $HTTP_SESSION_VARS["tblname"] = $HTTP_POST_VARS["tbl1"]; - $HTTP_SESSION_VARS["dbname"] = $HTTP_POST_VARS["db1"]; - } - $dbname = $HTTP_SESSION_VARS["dbname"]; - $tblname = $HTTP_SESSION_VARS["tblname"]; - */ function emit_gps_location($id, $lat, $long, $icon) { --- 1,5 ---- *************** *** 30,41 **** } ! print("<?xml version=\"1.0\"?>\n"); ! print("<page>\n"); ! print("<title>Richmond Field Station Demo</title>\n"); ! print("<query>Demo?</query>\n"); ! print("<request/>\n"); ! print("<center lat=\"37.9177\" lng=\"-122.332\"/>\n"); ! print("<span lat=\"0.002\" lng=\"0.003\"/>\n"); ! print("<overlay panelStyle=\"sidepanel.xsl\">\n\n\n"); /** TODO: Remove hardcoded db and table names. --- 22,48 ---- } ! ! ! /** TODO: All of the following code needs to be moved to ! * a function for printing gps locations. ! */ ! function print_from_database() { ! ! /** TODO: Replace with an associative array keying images to ! * physical events. For example: fire_fighter_danger => redman.png. ! */ ! $imgs=array('/firebug/images/greenman.png');//,'/firebug/images/redman.png'); ! ! /*** ! * ! * Setting up google maps specific stuff ! * ! * $ids contains the ten ids that you can associate ! * with locations ! * ! * $ imgs lists the image icons that you can have ! * ! ***/ ! $ids=array('A','B','C','D','E','F','G','H','I','J'); /** TODO: Remove hardcoded db and table names. *************** *** 82,101 **** $rows = pg_numrows($stat); - /*** - * - * Setting up google maps specific stuff - * - * $ids contains the ten ids that you can associate - * with locations - * - * $ imgs lists the image icons that you can have - * - ***/ - $ids=array('A','B','C','D','E','F','G','H','I','J'); - /** TODO: Replace with an associative array keying images to - * physical events. For example: fire_fighter_danger => redman.png. - */ - $imgs=array('/firebug/images/greenman.png'); for ($i=0;$i<$rows;$i++) { --- 89,93 ---- *************** *** 131,137 **** } ! print("</overlay>\n"); ! print("</page>\n"); - pg_close($dbh); ?> --- 123,149 ---- } ! pg_close($dbh); ! } ! ! ! ! print("<?xml version=\"1.0\"?>\n"); ! print("<page>\n"); ! print("<title>Richmond Field Station Demo</title>\n"); ! print("<query>Demo?</query>\n"); ! print("<request/>\n"); ! print("<center lat=\"37.9177\" lng=\"-122.332\"/>\n"); ! print("<span lat=\"0.002\" lng=\"0.003\"/>\n"); ! print("<overlay panelStyle=\"sidepanel.xsl\">\n\n\n"); ! ! print_from_database(); ! ! // $icon = $imgs[1]; ! // $id = $ids[3]; ! ! //emit_gps_location($id,37.9177,-122.332,$icon); ! ! print("</overlay>\n"); ! print("</page>\n"); ?> |
From: David M. D. <do...@us...> - 2005-06-09 01:15:28
|
Update of /cvsroot/firebug/firebug/web/gmaps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9208 Modified Files: db_render_xml.php Log Message: Wrote a php function to emit an xml location element for adding icons, cartoon bubbles to google map. Index: db_render_xml.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/gmaps/db_render_xml.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** db_render_xml.php 8 Jun 2005 22:46:29 -0000 1.5 --- db_render_xml.php 9 Jun 2005 01:14:59 -0000 1.6 *************** *** 11,15 **** --- 11,32 ---- */ + function emit_gps_location($id, $lat, $long, $icon) { + printf("<location infoStyle=\"geocodeinfo_rfs.xsl\" id=\"$id\">\n"); + print("<point lat=\"$lat\" lng=\"-$long\"/>\n"); + printf("<icon image=\"%s\" class=\"local\"/>\n", $icon); + print("<info>") or perr("db_render_xml","4"); + print("<title xml:space=\"preserve\" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\">\n") or perr("db_render_xml","5"); + print("</title>\n") or perr("db_render_xml","6"); + print("<address>\n") or perr("db_render_xml","8"); + print("<line>Ms. Eva Green</line>\n") or perr("db_render_xml","9"); + print("</address>\n") or perr("db_render_xml","10"); + print("<image>") or perr("db_render_xml","11"); + print("http://localhost/firebug/images/greenman.png") or perr("db_render_xml","12"); + print("</image>\n") or perr("db_render_xml","13"); + print("</info>\n") or perr("db_render_xml","14"); + print("</location>\n\n"); + + } print("<?xml version=\"1.0\"?>\n"); *************** *** 19,23 **** print("<request/>\n"); print("<center lat=\"37.9177\" lng=\"-122.332\"/>\n"); - print("<span lat=\"0.002\" lng=\"0.003\"/>\n"); print("<overlay panelStyle=\"sidepanel.xsl\">\n\n\n"); --- 36,39 ---- *************** *** 64,68 **** ***/ ! $rows = pg_numrows($stat); /*** --- 80,84 ---- ***/ ! $rows = pg_numrows($stat); /*** *************** *** 77,85 **** ***/ $ids=array('A','B','C','D','E','F','G','H','I','J'); $imgs=array('/firebug/images/greenman.png'); for ($i=0;$i<$rows;$i++) { ! //printf("<location infoStyle=\"geocodeinfo_rfs.xsl\" id=\"$ids[$i]\">\n"); ! printf("<location infoStyle=\"geocodeinfo_rfs.xsl\" id=\"$ids[$i]\">\n");// or perr("db_render_xml", "Can't printf"); $row = array_values(pg_fetch_row($stat,$i)) or perr("db_render_xml", "Cannot retrieve data"); --- 93,104 ---- ***/ $ids=array('A','B','C','D','E','F','G','H','I','J'); + + /** TODO: Replace with an associative array keying images to + * physical events. For example: fire_fighter_danger => redman.png. + */ $imgs=array('/firebug/images/greenman.png'); for ($i=0;$i<$rows;$i++) { ! $row = array_values(pg_fetch_row($stat,$i)) or perr("db_render_xml", "Cannot retrieve data"); *************** *** 106,126 **** $lat = $latdeg + (float)($latmin/60.0); $long = $longdeg + ($longmin/60.0); ! ! print("<point lat=\"$lat\" lng=\"-$long\"/>\n");//, $lat, $long);// or perr("db_render_xml", "1"); ! printf("<icon image=\"%s\" class=\"local\"/>\n", $imgs[0]); ! print("<info>") or perr("db_render_xml","4"); ! print("<title xml:space=\"preserve\" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\">\n") or perr("db_render_xml","5"); ! print("</title>\n") or perr("db_render_xml","6"); ! print("<address>\n") or perr("db_render_xml","8"); ! print("<line>Ms. Eva Green</line>\n") or perr("db_render_xml","9"); ! print("</address>\n") or perr("db_render_xml","10"); ! print("<image>") or perr("db_render_xml","11"); ! //print("http://www.google.co.nz/images/logo_sm.gif\n") or perr("db_render_xml","12"); ! print("http://localhost/firebug/images/greenman.png") or perr("db_render_xml","12"); ! print("</image>\n") or perr("db_render_xml","13"); ! print("</info>\n") or perr("db_render_xml","14"); ! print("</location>\n\n"); ! } --- 125,132 ---- $lat = $latdeg + (float)($latmin/60.0); $long = $longdeg + ($longmin/60.0); + $icon = $imgs[0]; + $id = $ids[$i]; ! emit_gps_location($id,$lat,$long,$icon); } |
From: David M. D. <do...@us...> - 2005-06-08 22:46:38
|
Update of /cvsroot/firebug/firebug/web/gmaps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26689 Modified Files: db_render_xml.php Added Files: sidepanel.xsl Log Message: xsl for sidepanel. Index: db_render_xml.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/gmaps/db_render_xml.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** db_render_xml.php 8 Jun 2005 22:42:55 -0000 1.4 --- db_render_xml.php 8 Jun 2005 22:46:29 -0000 1.5 *************** *** 107,111 **** $long = $longdeg + ($longmin/60.0); - // print "$lat,$long"; print("<point lat=\"$lat\" lng=\"-$long\"/>\n");//, $lat, $long);// or perr("db_render_xml", "1"); --- 107,110 ---- --- NEW FILE: sidepanel.xsl --- <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:apply-templates select="location"/> </xsl:template> <xsl:template match="location"> <table> <tr style="cursor:pointer" onclick="showLocationInfo('{@id}')"> <xsl:attribute name="id"> <xsl:value-of select="@id"/> </xsl:attribute> <xsl:if test="icon/@class != 'noicon'"> <td style="vertical-align: top; padding-right: 4px;"> <img style="width:24px; height:38px" alt=""> <!-- <xsl:attribute name="src">http://maps.google.com/mapfiles/icon.png</xsl:attribute> --> <xsl:attribute name="src"> <xsl:if test="icon/@image != 'http://maps.google.com/mapfiles/marker.png'"> <xsl:value-of select="icon/@image"/> </xsl:if> <xsl:if test="icon/@image = 'http://maps.google.com/mapfiles/marker.png'"> http://maps.google.com/mapfiles/icon.png </xsl:if> </xsl:attribute> </img> </td> </xsl:if> <td style="padding-bottom: 0.5em; padding-top: 1px; padding-left: 4px"> <xsl:if test="info/title"> <xsl:attribute name="class">label</xsl:attribute> <div> <xsl:choose> <xsl:when test="icon/@class != 'noicon'"> <a href="javascript:void(0)" onclick="this.blur()"> <xsl:attribute name="style">color: #0000cc</xsl:attribute> <xsl:copy-of select="info/title/node()"/> </a> </xsl:when> <xsl:otherwise> <xsl:attribute name="style">font-weight: bold</xsl:attribute> <xsl:copy-of select="info/title/node()"/> </xsl:otherwise> </xsl:choose> </div> </xsl:if> <xsl:apply-templates select="info/address/line"/> </td> </tr> </table> </xsl:template> <xsl:template match="line"> <div> <xsl:value-of select="."/> </div> </xsl:template> </xsl:stylesheet> |
From: Karthik D. <da...@us...> - 2005-06-08 22:43:09
|
Update of /cvsroot/firebug/firebug/web/gmaps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25087 Modified Files: db_render_xml.php Log Message: minor fixes. Index: db_render_xml.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/gmaps/db_render_xml.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** db_render_xml.php 8 Jun 2005 22:40:48 -0000 1.3 --- db_render_xml.php 8 Jun 2005 22:42:55 -0000 1.4 *************** *** 107,111 **** $long = $longdeg + ($longmin/60.0); ! print "$lat,$long"; print("<point lat=\"$lat\" lng=\"-$long\"/>\n");//, $lat, $long);// or perr("db_render_xml", "1"); --- 107,111 ---- $long = $longdeg + ($longmin/60.0); ! // print "$lat,$long"; print("<point lat=\"$lat\" lng=\"-$long\"/>\n");//, $lat, $long);// or perr("db_render_xml", "1"); *************** *** 131,133 **** pg_close($dbh); ?> - </p> --- 131,132 ---- |
From: Karthik D. <da...@us...> - 2005-06-08 22:40:57
|
Update of /cvsroot/firebug/firebug/web/gmaps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24193 Modified Files: db_render_xml.php Log Message: we have labels now. Index: db_render_xml.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/gmaps/db_render_xml.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** db_render_xml.php 8 Jun 2005 22:29:42 -0000 1.2 --- db_render_xml.php 8 Jun 2005 22:40:48 -0000 1.3 *************** *** 42,45 **** --- 42,51 ---- } + $cols = pg_numrows($stat); + for($i=0; $i < $cols; $i++) { + $header=pg_fetch_row($stat, $i); + $labels[$i]=$header[0]; + } + $statement = "SELECT * FROM $tblname"; $stat = @pg_exec($dbh,$statement); *************** *** 79,84 **** foreach ($row as $key => $value) { ! print "$key"; //$value\n"; ! switch($key) { case "latitudedegree": $latdeg=$value; --- 85,90 ---- foreach ($row as $key => $value) { ! // print "$key"; //$value\n"; ! switch($labels[$key]) { case "latitudedegree": $latdeg=$value; *************** *** 90,94 **** $longdeg=$value; break; ! case "longitudeminutes": $longmin=$value; break; --- 96,100 ---- $longdeg=$value; break; ! case "longitudeminute": $longmin=$value; break; *************** *** 101,107 **** $long = $longdeg + ($longmin/60.0); ! //print "$lat,$long"; ! print("<point lat=\"$lat\" lng=-\"$long\"/>\n");//, $lat, $long);// or perr("db_render_xml", "1"); printf("<icon image=\"%s\" class=\"local\"/>\n", $imgs[0]); print("<info>") or perr("db_render_xml","4"); --- 107,113 ---- $long = $longdeg + ($longmin/60.0); ! print "$lat,$long"; ! print("<point lat=\"$lat\" lng=\"-$long\"/>\n");//, $lat, $long);// or perr("db_render_xml", "1"); printf("<icon image=\"%s\" class=\"local\"/>\n", $imgs[0]); print("<info>") or perr("db_render_xml","4"); |
From: David M. D. <do...@us...> - 2005-06-08 22:29:52
|
Update of /cvsroot/firebug/firebug/web/gmaps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18069/gmaps Modified Files: connect.php db_gmap.php db_render_xml.php db_xml_create.php geocodeinfo_rfs.xsl Log Message: Fixed a mess of php db code. Index: db_render_xml.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/gmaps/db_render_xml.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** db_render_xml.php 8 Jun 2005 20:45:36 -0000 1.1 --- db_render_xml.php 8 Jun 2005 22:29:42 -0000 1.2 *************** *** 1,3 **** - <p> <?php include("connect.php"); --- 1,2 ---- *************** *** 20,39 **** print("<request/>\n"); print("<center lat=\"37.9177\" lng=\"-122.332\"/>\n"); ! print("<!-- Original -->\n"); ! print("<!--\n"); ! print("<span lat=\"0.0179\" lng=\"0.027586\"/>\n"); ! print("-->\n"); print("<span lat=\"0.002\" lng=\"0.003\"/>\n"); ! print("<overlay panelStyle=\"sidepanel.xsl\">\n"); $dbname = "task"; $tblname = "gga_l"; $dbh = connect_postgres($dbname); $statement = "SELECT a.attname FROM pg_attribute a,pg_class c where c.relname ='$tblname' and a.attrelid = c.oid and a.attnum > 0"; $stat = @pg_exec($dbh,$statement); if(!stat) { die("Cannot select from database\n"); } $statement = "SELECT * FROM $tblname"; $stat = @pg_exec($dbh,$statement); --- 19,45 ---- print("<request/>\n"); print("<center lat=\"37.9177\" lng=\"-122.332\"/>\n"); ! print("<span lat=\"0.002\" lng=\"0.003\"/>\n"); ! print("<overlay panelStyle=\"sidepanel.xsl\">\n\n\n"); + /** TODO: Remove hardcoded db and table names. + */ $dbname = "task"; $tblname = "gga_l"; + + $dbh = connect_postgres($dbname); + if (!$dbh) { + print("no connection"); + } + $statement = "SELECT a.attname FROM pg_attribute a,pg_class c where c.relname ='$tblname' and a.attrelid = c.oid and a.attnum > 0"; $stat = @pg_exec($dbh,$statement); if(!stat) { + print("Cannot select from database\n"); die("Cannot select from database\n"); } + $statement = "SELECT * FROM $tblname"; $stat = @pg_exec($dbh,$statement); *************** *** 43,46 **** --- 49,53 ---- + /*** * *************** *** 64,73 **** ***/ $ids=array('A','B','C','D','E','F','G','H','I','J'); ! $imgs=array('http://libgmail.sourceforge.net/man.png', 'http://libgmail.sourceforge.net/spider.png'); for ($i=0;$i<$rows;$i++) { ! printf("<location infoStyle=\"geocodeinfo_rfs.xsl\" id=\"%s\">\n", $ids[$i]) or perr("db_xml_create", "Cant fprintf"); ! $row = array_values(pg_fetch_row($stat,$i)) or perr("db_xml_create", "Cannot retrieve data"); ! foreach ($rows as $key => $value) { switch($key) { case "latitudedegree": --- 71,83 ---- ***/ $ids=array('A','B','C','D','E','F','G','H','I','J'); ! $imgs=array('/firebug/images/greenman.png'); for ($i=0;$i<$rows;$i++) { ! //printf("<location infoStyle=\"geocodeinfo_rfs.xsl\" id=\"$ids[$i]\">\n"); ! printf("<location infoStyle=\"geocodeinfo_rfs.xsl\" id=\"$ids[$i]\">\n");// or perr("db_render_xml", "Can't printf"); ! $row = array_values(pg_fetch_row($stat,$i)) or perr("db_render_xml", "Cannot retrieve data"); ! ! foreach ($row as $key => $value) { ! print "$key"; //$value\n"; switch($key) { case "latitudedegree": *************** *** 80,84 **** $longdeg=$value; break; ! case "longtudeminute": $longmin=$value; break; --- 90,94 ---- $longdeg=$value; break; ! case "longitudeminutes": $longmin=$value; break; *************** *** 86,106 **** $disp[$key]=$value; } ! } ! $lat = $latdeg + ($latmin/60.0); $long = $longdeg + ($longmin/60.0); ! ! printf("<point lat=\"%f\" lng=\"%f\"/>\n", $lat, $long) or perr("db_xml_create", "1"); printf("<icon image=\"%s\" class=\"local\"/>\n", $imgs[0]); ! print("<info>") or perr("db_xml_create","4"); ! print("<title xml:space=\"preserve\" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\">\n") or perr("db_xml_create","5"); ! print("</title>\n") or perr("db_xml_create","6"); ! print("<address>\n") or perr("db_xml_create","8"); ! print("<line>Ms. Eva Green</line>\n") or perr("db_xml_create","9"); ! print("</address>\n") or perr("db_xml_create","10"); ! print("<image>\n") or perr("db_xml_create","11"); ! print("http://www.google.co.nz/images/logo_sm.gif\n") or perr("db_xml_create","12"); ! print("</image>\n") or perr("db_xml_create","13"); ! print("</info>\n") or perr("db_xml_create","14"); } pg_close($dbh); ?> --- 96,126 ---- $disp[$key]=$value; } ! } ! ! $lat = $latdeg + (float)($latmin/60.0); $long = $longdeg + ($longmin/60.0); ! ! //print "$lat,$long"; ! ! print("<point lat=\"$lat\" lng=-\"$long\"/>\n");//, $lat, $long);// or perr("db_render_xml", "1"); printf("<icon image=\"%s\" class=\"local\"/>\n", $imgs[0]); ! print("<info>") or perr("db_render_xml","4"); ! print("<title xml:space=\"preserve\" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\">\n") or perr("db_render_xml","5"); ! print("</title>\n") or perr("db_render_xml","6"); ! print("<address>\n") or perr("db_render_xml","8"); ! print("<line>Ms. Eva Green</line>\n") or perr("db_render_xml","9"); ! print("</address>\n") or perr("db_render_xml","10"); ! print("<image>") or perr("db_render_xml","11"); ! //print("http://www.google.co.nz/images/logo_sm.gif\n") or perr("db_render_xml","12"); ! print("http://localhost/firebug/images/greenman.png") or perr("db_render_xml","12"); ! print("</image>\n") or perr("db_render_xml","13"); ! print("</info>\n") or perr("db_render_xml","14"); ! print("</location>\n\n"); ! } + + print("</overlay>\n"); + print("</page>\n"); + pg_close($dbh); ?> Index: connect.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/gmaps/connect.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** connect.php 8 Jun 2005 20:45:36 -0000 1.1 --- connect.php 8 Jun 2005 22:29:42 -0000 1.2 *************** *** 8,17 **** function perr($fname, $err) { $pstring = "<strong>ERROR</strong>: ".$err. " in ".$fname; ! die($pstring); } function connect_postgres($db) { $connstr = "dbname=$db user=postgres host=192.168.1.131 port=5432"; ! if(!($dbh = @pg_connect($connstr))) { print("connect". "Could not connect to database\n"); } --- 8,25 ---- function perr($fname, $err) { $pstring = "<strong>ERROR</strong>: ".$err. " in ".$fname; ! print($pstring); } function connect_postgres($db) { + + $connstr = "dbname=$db user=postgres host=192.168.1.131 port=5432"; ! ! //print "$connstr"; ! ! $dbh = @pg_connect($connstr); ! //print("$dbh"); ! ! if(!$dbh) { print("connect". "Could not connect to database\n"); } Index: db_gmap.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/gmaps/db_gmap.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** db_gmap.php 8 Jun 2005 20:45:36 -0000 1.1 --- db_gmap.php 8 Jun 2005 22:29:42 -0000 1.2 *************** *** 23,27 **** /* Note: All XML & XSL files must be on same domain. */ ! _loadXmlFileFromURL("/firebug/web/gmaps/db_render_xml.php", myMapApp); } --- 23,27 ---- /* Note: All XML & XSL files must be on same domain. */ ! _loadXmlFileFromURL("db_render_xml.php", myMapApp); } *************** *** 70,113 **** <body onload="initMap()"> - <!----> ! <?php ! include("db_xml_create.php"); ! ?> <!-- Note: Map height always maximum? --> <div style="position:absolute;left:5px;top:10px;right:5px;border:solid thin grey;"> ! <div id="container_frb" style="float:right;width:35%;" > ! </div> ! <div style="float:left;position:relative;left:10px;width:60%"> <div style="position:absolute;left:0px;top:0px;width:50%;overflow:auto;"> ! <h1 style="font-family:sans-serif;font-size:medium;">Richmond Field Station Demo</h1> ! <p><dl> ! Sensor data last updated: ! </dl> ! </p> </div> ! ! <div style="position:absolute;left:50%;top:5px;width:50%;"> ! <div id="toggle" style="position:absolute;top:0px:left:10px;font-family:sans-serif;font-size:smaller;"> ! ! </div> <div style="position:absolute;top:30px;left:5px;"> ! <div id="panel" style="height:90%;width:100%;"> </div> - <div id="metapanel">metapanel</div> - <div id="permalink">permalink</div> - <div id="printheader">header</div> </div> ! </div> ! </div> </div> ! <!-- </body> </html> - --- 70,138 ---- <body onload="initMap()"> ! <!----> <!-- Note: Map height always maximum? --> <div style="position:absolute;left:5px;top:10px;right:5px;border:solid thin grey;"> ! <div id="container_frb" style="float:right;width:35%;" ></div> <div style="float:left;position:relative;left:10px;width:60%"> + + <!-- <div style="position:absolute;left:0px;top:0px;width:50%;overflow:auto;"> ! ! ! ! ! <h1 style="font-family:sans-serif;font-size:medium;">Unofficial Google Maps Embedding How To : Demo Two</h1> ! ! <p><tt>_MapsApplication({container div}, {panel div}, {metapanel div}, {permalink div}, {toggle div} | null, {printheader div})</tt></p> ! ! ! <p><dl> ! <dt style="font-weight:bold;">Container div</dt> ! ! <dd>The <tt><div></tt> where the map should be displayed.</dd> ! ! <dt style="font-weight:bold;">Panel div</dt> ! <dd>The <tt><div></tt> where the "sidepanel" should be displayed.</dd> ! ! <dt style="font-weight:bold;">Metapanel div</dt> ! <dd>It appears Gmaps uses this to display error and other messages</dd> ! ! <dt style="font-weight:bold;">Permalink div</dt> ! <dd>It appears Gmaps uses this to display a permanent URL. (Now appears to be required.)</dd> ! ! <dt style="font-weight:bold;">Toggle div</dt> ! ! <dd>The <tt><div></tt> where the map specification toggle should be displayed. The toggle switches between different map specifications, e.g. Map view and Satellite view. </dd> ! ! <dt style="font-weight:bold;">Printheader div</dt> ! <dd>Presumably displayed at the head of a printed map.</dd> ! </dl> </p> ! ! <p style="font-size:x-small;">-- follower at rancidbacon.com <br /> (Original page: <a href="http://stuff.rancidbacon.com/google-maps-embed-how-to/demo2.html">http://stuff.rancidbacon.com/google-maps-embed-how-to/demo2.html</a>)</p> ! ! <p style="font-size:x-small;">26 May 2005</p> ! </div> ! --> ! <div style="position:absolute;left:50%;top:5px;width:50%;"> ! <div id="toggle" style="position:absolute;top:0px:left:10px;font-family:sans-serif;font-size:smaller;"> </div> <div style="position:absolute;top:30px;left:5px;"> ! <div id="panel" style="height:90%;width:100%;"> </div> ! <div id="metapanel"></div> ! <div id="permalink"></div> ! <div id="printheader"></div> ! </div> </div> </div> ! </div> ! ! </body> </html> Index: db_xml_create.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/gmaps/db_xml_create.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** db_xml_create.php 8 Jun 2005 20:45:36 -0000 1.1 --- db_xml_create.php 8 Jun 2005 22:29:42 -0000 1.2 *************** *** 62,66 **** for ($i=0;$i<$rows;$i++) { ! fprintf($fh, "<location infoStyle=\"geocodeinfo_rfs.xsl\" id=\"%s\">\n", $ids[$i]) or perr("db_xml_create", "Cant fprintf"); $row = array_values(pg_fetch_row($stat,$i)) or perr("db_xml_create", "Cannot retrieve data"); foreach ($rows as $key => $value) { --- 62,66 ---- for ($i=0;$i<$rows;$i++) { ! fprintf($fh, "<location infoStyle=\"geocodeinfo_rfs.xsl\" id=\"%s\">\n", $ids[$i]) or perr("db_xml_create", "Can't fprintf"); $row = array_values(pg_fetch_row($stat,$i)) or perr("db_xml_create", "Cannot retrieve data"); foreach ($rows as $key => $value) { Index: geocodeinfo_rfs.xsl =================================================================== RCS file: /cvsroot/firebug/firebug/web/gmaps/geocodeinfo_rfs.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** geocodeinfo_rfs.xsl 8 Jun 2005 20:45:36 -0000 1.1 --- geocodeinfo_rfs.xsl 8 Jun 2005 22:29:42 -0000 1.2 *************** *** 2,9 **** --- 2,15 ---- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + <!-- TODO: Add comment describing function of + this template. --> <xsl:template match="/"> <xsl:apply-templates select="location"/> </xsl:template> + + <!-- TODO: Add comment describing function of + this template. --> <xsl:template match="location"> <div style="padding-right: 8px; margin-top: 2px"> *************** *** 12,15 **** --- 18,24 ---- </xsl:template> + + <!-- TODO: Add comment describing function of + this template. --> <xsl:template match="info"> *************** *** 22,26 **** </xsl:variable> ! <div style="font-weight: bold">Custom!</div> <div> --- 31,35 ---- </xsl:variable> ! <div style="font-weight: bold">FireBug --- personnel</div> <div> *************** *** 38,45 **** --- 47,61 ---- </xsl:template> + + + <!-- TODO: Add comment describing function of + this template. --> <xsl:template match="line"> <div style="margin-top: 2px"><xsl:value-of select="."/></div> </xsl:template> + + <!-- TODO: Add comment describing function of + this template. --> <xsl:template name="getSingleLineAddress"> <xsl:for-each select="address/line"> *************** *** 49,52 **** --- 65,69 ---- </xsl:template> + </xsl:stylesheet> |
From: David M. D. <do...@us...> - 2005-06-08 22:29:51
|
Update of /cvsroot/firebug/firebug/web/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18069/images Added Files: sensor.png Log Message: Fixed a mess of php db code. --- NEW FILE: sensor.png --- (This appears to be a binary file; contents omitted.) |
From: David M. D. <do...@us...> - 2005-06-08 22:29:51
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18069 Modified Files: google_map_rfs.html google_rfs.xml Log Message: Fixed a mess of php db code. Index: google_map_rfs.html =================================================================== RCS file: /cvsroot/firebug/firebug/web/google_map_rfs.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** google_map_rfs.html 8 Jun 2005 18:39:36 -0000 1.2 --- google_map_rfs.html 8 Jun 2005 22:29:42 -0000 1.3 *************** *** 142,146 **** </div> ! <!-- </body> --- 142,146 ---- </div> ! </body> Index: google_rfs.xml =================================================================== RCS file: /cvsroot/firebug/firebug/web/google_rfs.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** google_rfs.xml 8 Jun 2005 18:39:36 -0000 1.4 --- google_rfs.xml 8 Jun 2005 22:29:42 -0000 1.5 *************** *** 62,65 **** --- 62,81 ---- </location> + + <location infoStyle="geocodeinfo_rfs.xsl" id="D"> + <point lat="37.9174" lng="-122.3334"/> + <!-- <icon image="http://maps.google.com/mapfiles/marker.png" class="local"/> --> + <icon image="http://localhost/firebug/images/sensor.png" class="local"/> + <info> + <title xml:space="preserve">Sensor</title> + <address> + <line>Firebug Sensor</line> + </address> + <image> + http://localhost/firebug/images/sensor.png + </image> + </info> + </location> + </overlay> </page> \ No newline at end of file |
Update of /cvsroot/firebug/firebug/web/gmaps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26384 Added Files: config.php connect.php db_admin.php db_create.php db_drop.php db_dropdb.php db_gmap.php db_list.php db_list_databases.php db_render_xml.php db_select.php db_table_buttons.php db_table_select.php db_xml_create.php firebug.css geocodeinfo_rfs.xsl gmaps.html gmaps.xml gmaps_update.php hello.php main.css nav_footer.php Log Message: Added new dir for google maps. KAR. --- NEW FILE: db_dropdb.php --- <html> <head> <title>FireBug database utility script</title> <link rel="SHORTCUT ICON" href="./images/favicon.ico"> <link type="text/css" rel="stylesheet" href="firebug.css"> </head> <body> <h1>FireBug database dropped</h1> <?php $dbname = $HTTP_POST_VARS["db1"]; ?> <hr /> <?php include("connect.php"); $dbh= connect_postgres("task"); $statement = "DROP DATABASE $dbname"; $stat = @pg_exec($dbh,$statement); if (!$stat) { print "<strong>ERROR</strong>: Could not drop database <strong>".strtoupper($dbname)."</strong>."; } else { print "Database <strong>$dbname</strong> dropped."; } pg_close($dbh); ?> <br /> <hr /> <?php include("nav_footer.php"); ?> <hr /> </body> </html> --- NEW FILE: db_create.php --- <html> <head> <title>FireBug database utility script</title> <link rel="SHORTCUT ICON" href="./images/favicon.ico"> <link type="text/css" rel="stylesheet" href="firebug.css"> </head> <body> <h1>FireBug database created</h1> <?php include("connect.php"); /* Note: All database names are lower-case in postgresql.*/ $dbname = strtolower($HTTP_POST_VARS["dbname"]); $nummotes = $HTTP_POST_VARS["nummotes"]; /** Need php v4.2 for this to work. */ /* Check to make sure we have numbers intead of garbage.*/ /* if (!ctype_digit($nummotes)) { print "Must be digits.<br />"; } */ /* Check to see if database exists already. */ $dbh = connect_postgres("task"); $statement = "SELECT DATNAME FROM pg_database where not datname=$defaultdb"; $conn_stat = @pg_exec($dbh,$statement); if (!$conn_stat) { print "<strong>ERROR</strong>: Could not check to see if database <strong>".strtoupper($dbname)."</strong> exists."; pg_close($dbh); } else { $rows = pg_numrows($conn_stat); $flag=0; for ($i = 0; $i < $rows; $i++) { $data = pg_fetch_row($conn_stat, $i); if (strcmp(rtrim($data[0]),$dbname)==0) { $flag=1; } } pg_close($dbh); /* Creates the database if it does not exist yet.*/ if (!$flag) { $dbh = connect_postgres($defaultdb); $statement = "CREATE DATABASE $dbname"; $create_stat = @pg_exec($dbh,$statement); if (!$create_stat) { print "<strong>ERROR</strong>: Could not create database <strong>".strtoupper($dbname)."</strong>."; pg_close($dbh); } else { print "Database <strong>$dbname</strong> created."; print "<br />"; pg_close($dbh); $dbh = connect_postgres($dbname); /* 3 create table statements for firebug sensors. */ /* typedef struct GGAMsg { uint16_t mote_id uint8_t hours; uint8_t minutes; float dec_sec; uint8_t Lat_deg; float Lat_dec_min; uint8_t Long_deg; float Long_dec_min; uint8_t NSEWind; uint8_t num_sats; } GGAMsg; */ $sql = "CREATE TABLE location (mote_id SMALLINT, gps_hours SMALLINT, gps_minutes SMALLINT, gps_seconds REAL, lat_deg SMALLINT,"; $sql .= "lat_dec_min REAL, long_deg SMALLINT, long_dec_min REAL, nsew SMALLINT, numsats SMALLINT)"; $create_stat = @pg_exec($dbh, $sql); if (!$create_stat) { print "<strong>ERROR</strong>: Could not create table </strong>LOCATION</strong>."; } //$statement = "CREATE TABLE location (mote_id SMALLINT, gps_hours SMALLINT, gps_minutes SMALLINT, gps_seconds FLOAT, lat_deg SMALLINT,"; //$statement .= "lat_dec_min FLOAT, long_deg SMALLINT, long_dec_min FLOAT, nsew SMALLINT, numsats SMALLINT)"; /* typedef struct Firedata_msg { uint16_t mote_id; uint16_t cnt; float temp; float rel_hum; float baro_pres; float lux; } Firedata_msg; */ $sql = "CREATE TABLE current (mote_id SMALLINT, time TIMESTAMP, cnt SMALLINT, temp REAL, rel_hum REAL, baro_pres REAL, lux REAL)"; $create_stat = @pg_exec($dbh, $sql); if (!$create_stat) { print "<strong>ERROR</strong>: Could not create table <strong>CURRENT</strong>."; $current_flag=1; } //$statement = "CREATE TABLE current (mote_id SMALLINT, time TIMESTAMP, cnt SMALLINT, temp FLOAT, rel_hum FLOAT, baro_pres FLOAT, lux FLOAT)"; //mysql_query($statement) or die("Error: ".mysql_error()." in creating current atable"); $sql = "CREATE TABLE cumulative (mote_id SMALLINT, time TIMESTAMP, cnt SMALLINT, temp REAL, rel_hum REAL, baro_pres REAL, lux REAL)"; $create_stat = @pg_exec($dbh, $sql); if (!$create_stat) { print "<strong>ERROR</strong>: Could not create table <strong>CUMULATIVE</strong>."; } //$statement = "CREATE TABLE cumulative (mote_id SMALLINT, time TIMESTAMP, cnt SMALLINT, temp FLOAT, rel_hum FLOAT, baro_pres FLOAT, lux FLOAT)"; //mysql_query($statement) or die("Error: ".mysql_error()." in creating cumulative atable"); $sql = "CREATE TABLE range (mote_id SMALLINT, time TIMESTAMP, count INTEGER, rssi INTEGER, voltage REAL)"; $create_stat = @pg_exec($dbh, $sql); if (!$create_stat) { print "<strong>ERROR</strong>: Could not create table <strong>RANGE</strong>."; } //$statement = "CREATE TABLE range (mote_id SMALLINT, time TIMESTAMP, count INTEGER, rssi INTEGER, voltage FLOAT)"; //mysql_query($statement) or die("Error: ".mysql_error()." in creating range table"); } ?> <?php if (!$current_flag) { for ($i = 1; $i <= $nummotes; $i++) { $statement = "INSERT INTO current (mote_id) VALUES ($i)"; print "<br />"; $create_stat = @pg_exec($dbh, $statement); if (!$create_stat) { print "<strong>ERROR</strong>: Could not INSERT INTO <strong>CURRENT</strong> (mote_id) VALUES ($i)"; } else { print $statement; } } } pg_close($dbh); } else { echo("Database $dbname already created."); print "<br />"; echo("Please create another database."); print "<br />"; print("<a href=\"db_admin.php\">Create Another Database</a>"); } } ?> <br /> <hr /> <?php include("nav_footer.php"); ?> <hr /> </body> </html> --- NEW FILE: main.css --- BODY, TD, P { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #000000;} .black { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: #000000;} .grey { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: #676767;} .white { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #FFFFFF;} a.white { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight:bold; color: #FFFFFF;} .orange {color: #FF6600;} .titlered {color: #960707; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 18px; font-weight:bold;} .titleorange {color: #CC6633; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 18px; font-weight:bold;} .red { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: #990000;} .small {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; font-weight:normal;} a.nav-main { font-size: 10px; color: #FFFFFF; font-weight:bold; text-decoration:none; } a.nav-main:hover { font-size: 10px; color: #FFF; font-weight:bold; text-decoration:none; } a.nav-sub { font-size: 10px; color: #FFFFFF; text-decoration:none; } a.nav-sub:hover { font-size: 10px; color: #CCCCCC; text-decoration:none; } A { font-family: Verdana, Arial, Helvetica, sans-serif; color: #0066CC;} A:HOVER { color: #FF9900; text-decoration: underline;} A:HOVER.white { color: #FFFFDD; text-decoration: underline;} A:HOVER.black { color: #FF9900; text-decoration: underline;} A:HOVER.orange { color: #993300; text-decoration: underline;} A.small { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #0066CC;} .topnav { font-size: 10px;} .topnav_active {background-color:#FDCD85; color:#394D73; font-weight: bold; font-size: 10px;} a.topnav{font-weight: bold; text-decoration:none; color:#394D73;} a.topnav:hover{background-color:#FDCD85; color:#394D73; text-decoration:none;} .header { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 15px; color: #000000; font-weight: bold;} .headerwhite { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 15px; color: #FFFFFF; font-weight: bold;} .wl {font-family:verdana, Helvetica, Sans-Serif; font-size: 12px; font-weight:bold; color:#666633;} .wlt {font-family:verdana, Helvetica, Sans-Serif; font-size: 11px; color:#666633;} .blueh {font-family:verdana, Helvetica, Sans-Serif; font-size: 13px;font-weight:bold;color:#336699;} .bluet {font-family:verdana, Helvetica, Sans-Serif; font-size: 12px;color:#336699;} .bluetsml {font-family:verdana, Helvetica, Sans-Serif; font-size: 10px; color:#336699;} .bluetout {font-family:verdana, Helvetica, Sans-Serif; font-size: 10px;color:#336699;} .boldsmall {font-family:verdana, Helvetica, Sans-Serif; font-size: 10px;color:#000000; font-weight:bold} .spacer1p {margin-top:1px;} .spacer2p {margin-top:2px;} .spacer4p {margin-top:4px;} .spacer5p {margin-top:5px;} .spacer7p {margin-top:7px;} .spacer10p {margin-top:10px;} .spacer12p {margin-top:12px;} .spacer15p {margin-top:15px;} .spacer20p {margin-top:20px;} .spacer25p {margin-top:25px;} .navbox {margin-top:2px;} TR.NavRow TD { vertical-align: middle; border: 1px solid; border-color: #369 #003 #003; border-left: none; cursor: pointer; } .Nav { background-color: #384ccc; color: #fff; cursor: pointer; } .NavText, .NavHighlightText, .NavGroupText { font-family: verdana, arial, sans-serif; font-size: 10px; font-weight: bold; line-height: 14px; padding-left: 6px; text-decoration: none; } .Nav A:link, .Nav A:visited { color: #fff; Text-decoration: none;} .NavHilite { background-color: #5A6B94; color: #fff; } .NavHilite A:link, .NavHilite A:visited { color: #fff; } TR TD.NavHilite A:link, TR TD.NavHilite A:visited { text-decoration: none; } TR.NavHiliteRow TD { vertical-align: middle; border: 1px solid; border-color: #000 #5A6B94 #000; border-left: none; } --- NEW FILE: db_select.php --- <html> <head> <title>FireBug database utility script</title> <link rel="SHORTCUT ICON" href="./images/favicon.ico"> <link type="text/css" rel="stylesheet" href="firebug.css"> </head> <body> <form action="db_gmap.php" method="post"> <?php include("connect.php"); $db = $HTTP_POST_VARS["db1"]; $dbh = connect_postgres($db) or perr("db_select", "Unable to connect"); print("<h1>Database $db tables</h1>"); print("<center>\n"); print("<table class='db_schema'><tr><td>Table Name</td><td>Selected</td></tr>"); $statement = "SELECT TABLENAME FROM pg_tables WHERE NOT TABLENAME~'pg_.*' and not tablename~'sql_.*'"; //$statement = "SELECT TABLENAME FROM pg_tables"; $stat = @pg_exec($dbh,$statement); if (!$stat) { perr("db_select", "Could not access list of tables for database ".strtoupper($d). "."); } else { $rows = pg_numrows($stat); for ($i = 0; $i < $rows; $i++) { $data = pg_fetch_row($stat, $i); print ("<tr>"); print ("<td>"); print $data[0]; print ("</td>"); print ("<td>"); print ("<input type=radio name=tbl1 value=\"" . htmlspecialchars($data[0]) . "\">"); print ("</td>"); print ("</tr>"); } print ("</table>"); print ("<input type=hidden name=db1 value=\"$db\">"); print ("<input type=submit value=SUBMIT>"); } pg_close($dbh); ?> </form> </center> <br /> <hr /> <?php include("nav_footer.php"); ?> <hr /> </body> </html> --- NEW FILE: db_table_select.php --- <?php //session_start(); //session_register("dbname"); //session_register("tblname"); ?> <html> <head> <title>FireBug Client</title> <!-- <META HTTP-EQUIV="Refresh" CONTENT="30;URL=http://localhost/firebug/db_table_select.php"> --> <link rel="SHORTCUT ICON" href="./images/favicon.ico"> <link type="text/css" rel="stylesheet" href="firebug.css"> </head> <body> <hr /> <p> Sensor data last updated: <?php echo date ("l dS F Y h:i:s A"); ?> </p> <?php if ($HTTP_POST_VARS["tbl1"]!=Null){ $HTTP_SESSION_VARS["tblname"] = $HTTP_POST_VARS["tbl1"]; $HTTP_SESSION_VARS["dbname"] = $HTTP_POST_VARS["db1"]; } $dbname = $HTTP_SESSION_VARS["dbname"]; $tblname = $HTTP_SESSION_VARS["tblname"]; print("<h1>Mote activity: Database $dbname, table $tblname</h1>"); ?> <?php include("db_table_buttons.php"); ?> <center> <table class="db_schema"> <?php $dbh = connect_postgres($dbname); $statement = "SELECT a.attname FROM pg_attribute a,pg_class c where c.relname ='$tblname' and a.attrelid = c.oid and a.attnum > 0"; $stat = @pg_exec($dbh,$statement); if (!$stat) { print "<strong>ERROR</strong>: Could not retrieve table header column names for<strong>".strtoupper($tblname)."</strong>."; } else { // Build the table header column names. Make this into a function. print("<tr>\n"); $cols = pg_numrows($stat); for ($i=0 ; $i < $cols; $i++) { print ("<td style=\"border: solid\"><b><align=center><h2>"); $header = pg_fetch_row($stat,$i); print $header[0]; print ("<//h2></b></td>"); } print("</tr>\n"); $statement = "SELECT * FROM $tblname"; $stat = @pg_exec($dbh,$statement); if (!$stat) { print "<strong>ERROR</strong>: Could not access table <strong>".strtoupper($tblname)."</strong>."; } else { //Print the value for a row. function print_row($item2,$key) { print ("<td style=\"border-right: solid\" align=\"center\">\n"); echo "$item2\n"; print ("</td>\n"); } //Print every row. $rows = pg_numrows($stat); // for each row for ($i=0;$i<$rows;$i++) { print ("<tr>"); // For each column... $row = array_values(pg_fetch_row($stat,$i)); array_walk($row,'print_row'); print("</tr>"); } } pg_close($dbh); } ?> </table> </center> <hr /> <hr /> <?php include("nav_footer.php"); ?> <hr /> <p> Sensor data last updated: <?php echo date ("l dS F Y h:i:s A"); ?> </p> </body> </html> --- NEW FILE: db_render_xml.php --- <p> <?php include("connect.php"); /* if ($HTTP_POST_VARS["tbl1"]!=Null){ $HTTP_SESSION_VARS["tblname"] = $HTTP_POST_VARS["tbl1"]; $HTTP_SESSION_VARS["dbname"] = $HTTP_POST_VARS["db1"]; } $dbname = $HTTP_SESSION_VARS["dbname"]; $tblname = $HTTP_SESSION_VARS["tblname"]; */ print("<?xml version=\"1.0\"?>\n"); print("<page>\n"); print("<title>Richmond Field Station Demo</title>\n"); print("<query>Demo?</query>\n"); print("<request/>\n"); print("<center lat=\"37.9177\" lng=\"-122.332\"/>\n"); print("<!-- Original -->\n"); print("<!--\n"); print("<span lat=\"0.0179\" lng=\"0.027586\"/>\n"); print("-->\n"); print("<span lat=\"0.002\" lng=\"0.003\"/>\n"); print("<overlay panelStyle=\"sidepanel.xsl\">\n"); $dbname = "task"; $tblname = "gga_l"; $dbh = connect_postgres($dbname); $statement = "SELECT a.attname FROM pg_attribute a,pg_class c where c.relname ='$tblname' and a.attrelid = c.oid and a.attnum > 0"; $stat = @pg_exec($dbh,$statement); if(!stat) { die("Cannot select from database\n"); } $statement = "SELECT * FROM $tblname"; $stat = @pg_exec($dbh,$statement); if(!stat) { die("Cannot select from table\n"); } /*** * * ***** FIXME ********* * The field labels are hardcoded in here. * You have to change the labels for this to work. * ***/ $rows = pg_numrows($stat); /*** * * Setting up google maps specific stuff * * $ids contains the ten ids that you can associate * with locations * * $ imgs lists the image icons that you can have * ***/ $ids=array('A','B','C','D','E','F','G','H','I','J'); $imgs=array('http://libgmail.sourceforge.net/man.png', 'http://libgmail.sourceforge.net/spider.png'); for ($i=0;$i<$rows;$i++) { printf("<location infoStyle=\"geocodeinfo_rfs.xsl\" id=\"%s\">\n", $ids[$i]) or perr("db_xml_create", "Cant fprintf"); $row = array_values(pg_fetch_row($stat,$i)) or perr("db_xml_create", "Cannot retrieve data"); foreach ($rows as $key => $value) { switch($key) { case "latitudedegree": $latdeg=$value; break; case "latitudeminutes": $latmin=$value; break; case "longitudedegree": $longdeg=$value; break; case "longtudeminute": $longmin=$value; break; default: $disp[$key]=$value; } } $lat = $latdeg + ($latmin/60.0); $long = $longdeg + ($longmin/60.0); printf("<point lat=\"%f\" lng=\"%f\"/>\n", $lat, $long) or perr("db_xml_create", "1"); printf("<icon image=\"%s\" class=\"local\"/>\n", $imgs[0]); print("<info>") or perr("db_xml_create","4"); print("<title xml:space=\"preserve\" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\">\n") or perr("db_xml_create","5"); print("</title>\n") or perr("db_xml_create","6"); print("<address>\n") or perr("db_xml_create","8"); print("<line>Ms. Eva Green</line>\n") or perr("db_xml_create","9"); print("</address>\n") or perr("db_xml_create","10"); print("<image>\n") or perr("db_xml_create","11"); print("http://www.google.co.nz/images/logo_sm.gif\n") or perr("db_xml_create","12"); print("</image>\n") or perr("db_xml_create","13"); print("</info>\n") or perr("db_xml_create","14"); } pg_close($dbh); ?> </p> --- NEW FILE: config.php --- <?php $webroot='192.168.1.131'; $defaultdb='task'; $port=5432; $user='postgres'; ?> --- NEW FILE: db_gmap.php --- <html> <head> <title>Richmond Field Station Experiment</title> <script src="http://google.com/maps?file=js&hl=en" type="text/javascript"> </script> <script type="text/javascript"> _mSiteName = 'Richmond Field Station'; _mUsePrintLink=""; function initMap() { // // frb // myMapApp = new _MapsApplication(document.getElementById("container_frb"), document.getElementById("panel"), document.getElementById("metapanel"), document.getElementById("permalink"), document.getElementById("toggle"), document.getElementById("printheader")); myMapApp.loadMap(); /* Note: All XML & XSL files must be on same domain. */ _loadXmlFileFromURL("/firebug/web/gmaps/db_render_xml.php", myMapApp); } t.dump = function(a) {alert(a);} //debugging function _loadXmlFileFromURL(url, mapApp) { // // Loads the specified external XML file into the map view. // // frb // // NOTE: URL must be on same domain as page. var _getter = _XMLHttp.create(); _getter.open("GET", url); _getter.onreadystatechange=function() { if (_getter.readyState==4) { mapApp.loadXML(_getter.responseText); } } _getter.send(null); // Whoops, IE *needs* this to be last, Moz is lenient. } </script> <style type="text/css"> #panel table { border:solid 1px grey; width:50%; margin-bottom: 5px; } #panel table td:first-child { width: 24px; } .label { font-size:smaller; font-family:sans-serif; }; </style> </head> <body onload="initMap()"> <!----> <?php include("db_xml_create.php"); ?> <!-- Note: Map height always maximum? --> <div style="position:absolute;left:5px;top:10px;right:5px;border:solid thin grey;"> <div id="container_frb" style="float:right;width:35%;" > </div> <div style="float:left;position:relative;left:10px;width:60%"> <div style="position:absolute;left:0px;top:0px;width:50%;overflow:auto;"> <h1 style="font-family:sans-serif;font-size:medium;">Richmond Field Station Demo</h1> <p><dl> Sensor data last updated: </dl> </p> </div> <div style="position:absolute;left:50%;top:5px;width:50%;"> <div id="toggle" style="position:absolute;top:0px:left:10px;font-family:sans-serif;font-size:smaller;"> </div> <div style="position:absolute;top:30px;left:5px;"> <div id="panel" style="height:90%;width:100%;"> </div> <div id="metapanel">metapanel</div> <div id="permalink">permalink</div> <div id="printheader">header</div> </div> </div> </div> </div> <!-- </body> </html> --- NEW FILE: db_xml_create.php --- <?php if ($HTTP_POST_VARS["tbl1"]!=Null){ $HTTP_SESSION_VARS["tblname"] = $HTTP_POST_VARS["tbl1"]; $HTTP_SESSION_VARS["dbname"] = $HTTP_POST_VARS["db1"]; } $dbname = $HTTP_SESSION_VARS["dbname"]; $tblname = $HTTP_SESSION_VARS["tblname"]; // print("<h1>Mote activity: Database $dbname, table $tblname</h1>"); // include("db_table_buttons.php"); $dbh = connect_postgres($dbname); $statement = "SELECT a.attname FROM pg_attribute a,pg_class c where c.relname ='$tblname' and a.attrelid = c.oid and a.attnum > 0"; $stat = @pg_exec($dbh,$statement); if (!$stat) { print "<strong>ERROR</strong>: Could not retrieve table header column names for<strong>".strtoupper($tblname)."</strong>."; } else { $statement = "SELECT * FROM $tblname"; $stat = @pg_exec($dbh,$statement); if (!$stat) { print "<strong>ERROR</strong>: Could not access table <strong>".strtoupper($tblname)."</strong>."; } else { /* function print_row($item2,$key) { print ("<td style=\"border-right: solid\" align=\"center\">\n"); echo "$item2\n"; print ("</td>\n"); } */ /*** * * ***** FIXME ********* * The field labels are hardcoded in here. * You have to change the labels for this to work. * ***/ $rows = pg_numrows($stat); /*** * * Setting up google maps specific stuff * * $ids contains the ten ids that you can associate * with locations * * $ imgs lists the image icons that you can have * ***/ $ids=array('A','B','C','D','E','F','G','H','I','J'); $imgs=array('http://libgmail.sourceforge.net/man.png', 'http://libgmail.sourceforge.net/spider.png'); $fh=fopen("gmaps2.xml", "w") or perr("db_xml_create", "unable to create file"); for ($i=0;$i<$rows;$i++) { fprintf($fh, "<location infoStyle=\"geocodeinfo_rfs.xsl\" id=\"%s\">\n", $ids[$i]) or perr("db_xml_create", "Cant fprintf"); $row = array_values(pg_fetch_row($stat,$i)) or perr("db_xml_create", "Cannot retrieve data"); foreach ($rows as $key => $value) { switch($key) { case "latitudedegree": $latdeg=$value; break; case "latitudeminutes": $latmin=$value; break; case "longitudedegree": $longdeg=$value; break; case "longtudeminute": $longmin=$value; break; default: $disp[$key]=$value; } } $lat = $latdeg + ($latmin/60.0); $long = $longdeg + ($longmin/60.0); print("Now printing values into the xml file\n"); fprintf($fh, "<point lat=\"%f\" lng=\"%f\"/>\n", $lat, $long) or perr("db_xml_create", "1"); fprintf($fh, "<icon image=\"%s\" class=\"local\"/>\n", $imgs[0]); fprintf($fh, $str1) or perr("db_xml_create","3"); fprintf($fh, "<info>") or perr("db_xml_create","4"); fprintf($fh, "<title xml:space=\"preserve\" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\">\n") or perr("db_xml_create","5"); fprintf($fh, "</title>\n") or perr("db_xml_create","6"); print("Halfway done\n") or perr("db_xml_create","7"); fprintf($fh, "<address>\n") or perr("db_xml_create","8"); fprintf($fh, "<line>Ms. Eva Green</line>\n") or perr("db_xml_create","9"); fprintf($fh, "</address>\n") or perr("db_xml_create","10"); fprintf($fh, "<image>\n") or perr("db_xml_create","11"); fprintf($fh, "http://www.google.co.nz/images/logo_sm.gif\n") or perr("db_xml_create","12"); fprintf($fh, "</image>\n") or perr("db_xml_create","13"); fprintf($fh, "</info>\n") or perr("db_xml_create","14"); } } print("Done with all\n"); pg_close($dbh); fclose($fh); } ?> --- NEW FILE: gmaps.html --- <html> <head> <title>Demo Two for Unofficial Google Maps Embedding How To</title> <script src="http://google.com/maps?file=js&hl=en" type="text/javascript"> </script> <script type="text/javascript"> _mSiteName = 'Richmond Field Station'; _mUsePrintLink=""; function initMap() { // // frb // myMapApp = new _MapsApplication(document.getElementById("container_frb"), document.getElementById("panel"), document.getElementById("metapanel"), document.getElementById("permalink"), document.getElementById("toggle"), document.getElementById("printheader")); myMapApp.loadMap(); /* Note: All XML & XSL files must be on same domain. */ _loadXmlFileFromURL("gmaps.xml", myMapApp); } t.dump = function(a) {alert(a);} //debugging function _loadXmlFileFromURL(url, mapApp) { // // Loads the specified external XML file into the map view. // // frb // // NOTE: URL must be on same domain as page. var _getter = _XMLHttp.create(); _getter.open("GET", url); _getter.onreadystatechange=function() { if (_getter.readyState==4) { mapApp.loadXML(_getter.responseText); } } _getter.send(null); // Whoops, IE *needs* this to be last, Moz is lenient. } </script> <style type="text/css"> #panel table { border:solid 1px grey; width:50%; margin-bottom: 5px; } #panel table td:first-child { width: 24px; } .label { font-size:smaller; font-family:sans-serif; }; </style> </head> <body onload="initMap()"> <!----> <!-- Note: Map height always maximum? --> <div style="position:absolute;left:5px;top:10px;right:5px;border:solid thin grey;"> <div id="container_frb" style="float:right;width:35%;" ></div> <div style="float:left;position:relative;left:10px;width:60%"> <div style="position:absolute;left:0px;top:0px;width:50%;overflow:auto;"> <h1 style="font-family:sans-serif;font-size:medium;">Unofficial Google Maps Embedding How To : Demo Two</h1> <p><tt>_MapsApplication({container div}, {panel div}, {metapanel div}, {permalink div}, {toggle div} | null, {printheader div})</tt></p> <p><dl> <dt style="font-weight:bold;">Container div</dt> <dd>The <tt><div></tt> where the map should be displayed.</dd> <dt style="font-weight:bold;">Panel div</dt> <dd>The <tt><div></tt> where the "sidepanel" should be displayed.</dd> <dt style="font-weight:bold;">Metapanel div</dt> <dd>It appears Gmaps uses this to display error and other messages</dd> <dt style="font-weight:bold;">Permalink div</dt> <dd>It appears Gmaps uses this to display a permanent URL. (Now appears to be required.)</dd> <dt style="font-weight:bold;">Toggle div</dt> <dd>The <tt><div></tt> where the map specification toggle should be displayed. The toggle switches between different map specifications, e.g. Map view and Satellite view. </dd> <dt style="font-weight:bold;">Printheader div</dt> <dd>Presumably displayed at the head of a printed map.</dd> </dl> </p> <p style="font-size:x-small;">-- follower at rancidbacon.com <br /> (Original page: <a href="http://stuff.rancidbacon.com/google-maps-embed-how-to/demo2.html">http://stuff.rancidbacon.com/google-maps-embed-how-to/demo2.html</a>)</p> <p style="font-size:x-small;">26 May 2005<!--25 May 2005--></p> </div> <div style="position:absolute;left:50%;top:5px;width:50%;"> <div id="toggle" style="position:absolute;top:0px:left:10px;font-family:sans-serif;font-size:smaller;"> </div> <div style="position:absolute;top:30px;left:5px;"> <div id="panel" style="height:90%;width:100%;"> </div> <div id="metapanel"></div> <div id="permalink"></div> <div id="printheader"></div> </div> </div> </div> </div> <!-- </body> </html> --- NEW FILE: db_list_databases.php --- <table class="db_schema"> <tr> <td>Database</td> <td>Selected</td> </tr> <?php include("connect.php"); $dbh = connect_postgres("task") or die("Unable to connect to database"); $statement = "SELECT DATNAME FROM pg_database where not datname='template1' and not datname='template0'"; $stat = @pg_exec($dbh,$statement) or die("Unable to select database name"); if (!stat) { print "<strong>ERROR</strong>: Could not access list of existing databases."; } else { $rows = pg_numrows($stat); for ($i = 0; $i < $rows; $i++) { $data = pg_fetch_row($stat, $i) or perr("db_list_databases", "Could not fetch data"); print ("<tr><td>"); print $data[0]; print ("</td>"); print ("<td>"); print ("<input type=radio name=db1 value=\"$data[0]\">"); print ("</td>"); print ("</tr>"); } } pg_close($dbh) or perr("db_list_databases", "Could not close database"); ?> </table> --- NEW FILE: nav_footer.php --- <center> <a href="./index.html">[FireBug home]</a> <a href="./db_admin.php">[DB Admin]</a> <a href="./db_list.php">[DB List]</a> <a href="./db_drop.php">[DB Drop]</a> </center> --- NEW FILE: db_list.php --- <html> <head> <title>Example FireBug Client</title> <link rel="SHORTCUT ICON" href="./images/favicon.ico"> <link type="text/css" rel="stylesheet" href="firebug.css"> </head> <body> <h1>FireBug web client database selection</h1> <hr /> <center> <form action="db_select.php" method="post"> <!-- Make sure you include this inside the form action !> <!-- the variable scoping will get messed up otherwise; !> <?php include("db_list_databases.php"); ?> <input type="submit" value="Show tables"> </form> </center> <hr /> <?php include("nav_footer.php"); ?> <p> Database data last updated: <?php echo date ("l dS F Y h:i:s A"); ?> </p> </body> </html> --- NEW FILE: gmaps_update.php --- <?php --- NEW FILE: geocodeinfo_rfs.xsl --- <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:apply-templates select="location"/> </xsl:template> <xsl:template match="location"> <div style="padding-right: 8px; margin-top: 2px"> <xsl:apply-templates select="info"/> </div> </xsl:template> <xsl:template match="info"> <xsl:variable name="page" select="../@arg0"/> <xsl:variable name="address"> <xsl:for-each select="address/line"> <xsl:if test="position() > 1">, </xsl:if> <xsl:value-of select="."/> </xsl:for-each> </xsl:variable> <div style="font-weight: bold">Custom!</div> <div> <img> <xsl:attribute name="src"> <xsl:value-of select="image"/> </xsl:attribute> </img> </div> <div style="font-size: small; margin-top: 14px"> <xsl:apply-templates select="address/line"/> </div> </xsl:template> <xsl:template match="line"> <div style="margin-top: 2px"><xsl:value-of select="."/></div> </xsl:template> <xsl:template name="getSingleLineAddress"> <xsl:for-each select="address/line"> <xsl:if test="position() > 1">, </xsl:if> <xsl:value-of select="."/> </xsl:for-each> </xsl:template> </xsl:stylesheet> --- NEW FILE: db_drop.php --- <html> <head> <title>Example FireBug Client</title> <link rel="SHORTCUT ICON" href="./images/favicon.ico"> <link type="text/css" rel="stylesheet" href="firebug.css"> </head> <body> <h1>FireBug web client database selection</h1> <center> <form action="db_dropdb.php" method="post"> <table class="db_schema"> <tr> <td>DataBase Name</td> <td>Selected</td> </tr> <?php include("connect.php"); function print_dbname_row($dbname) { print ("<tr><td>"); print $dbname; print ("</td>"); print ("<td>"); print ("<input type=radio name=db1 value=\"$dbname\">"); print ("</td>"); print ("</tr>"); } /** Print only the non-system databases */ $dbh = connect_postgres($defaultdb); $statement = "SELECT DATNAME FROM pg_database where not datname=$defaultdb and not datname='template0'"; $stat = @pg_exec($dbh,$statement); if (!$stat) { print "<strong>ERROR</strong>: Could not access list of databases."; } else { $rows = pg_numrows($stat); for ($i = 0; $i < $rows; $i++) { $data = pg_fetch_row($stat, $i); print_dbname_row($data[0]); } } pg_close($dbh); ?> </table> <input type="submit" value="Drop database"> </form> </center> <hr /> <?php include("nav_footer.php"); ?> <hr /> <p> Database data last updated: <?php echo date ("l dS F Y h:i:s A"); ?> </p> </body> </html> --- NEW FILE: gmaps.xml --- <?xml version="1.0"?> <page> <title>Custom XSL Demo</title> <query>Why?</query> <request/> <center lat="37.9177" lng="-122.332"/> <!-- Original --> <!-- <span lat="0.0179" lng="0.027586"/> --> <span lat="0.002" lng="0.003"/> <overlay panelStyle="sidepanel.xsl"> <location infoStyle="geocodeinfo_rfs.xsl" id="A"> <point lat="37.91" lng="-122.33"/> <icon image="http://libgmail.sourceforge.net/man.png" class="local"/> <info> <title xml:space="preserve" xmlns:xml="http://www.w3.org/XML/1998/namespace"> </title> <address> <line>Mr G. Oogle</line> </address> <image> http://www.google.co.nz/images/logo_sm.gif </image> </info> </location> <location infoStyle="geocodeinfo_rfs.xsl" id="B"> <point lat="37.915" lng="-122.332"/> <icon image="http://maps.google.com/mapfiles/marker.png" class="local"/> <info> <title xml:space="preserve" xmlns:xml="http://www.w3.org/XML/1998/namespace"/> <address> <line>Here be spiders...</line> </address> <image> http://libgmail.sourceforge.net/spider.png </image> </info> </location> <location infoStyle="geocodeinfo_rfs.xsl" id="C"> <point lat="37.91862" lng="-122.3324"/> <icon image="http://maps.google.com/mapfiles/marker.png" class="local"/> <info> <title xml:space="preserve"/> <address> <line>Building 454, Room 124</line> </address> <image> http://libgmail.sourceforge.net/man.png </image> </info> </location> </overlay> </page> --- NEW FILE: firebug.css --- table.db_schema { background-color:#ffff66; border: 3px solid black; align: center; /* width:80%; font-size:75%; */ } h1 { background-color:#ffcc00; color:#ff3300; font-family:tahoma,helvetica,arial; font-size:150%; } h2 { background-color:#ffcc00; color:#ff3300; font-family:tahoma,helvetica,arial; font-size:100%; } h3 { color:#0E37D0; font-family:Georgia; font-weight:bold; font-size:200%; } h4 { /*background-color:#072285;*/ color:#5A7CFC; font-family:Courier New; font-style:normal; font-weight:bold; font-size:150%; } p.jazzy { color:#1841D8; font-family:Comic Sans MS; } p.nice { color:#465BAA; font-family:Lucida Console; } pre.code { background-color:#ffff66; } code.progname { font-weight:bold; } BODY { color:black; background-color:#FFFFF5; } SPAN.title {color:green} SPAN.author {color:purple;} SPAN.publication {color:green} SPAN.fortran { font-variant: small-caps; } span.invisible { color:#FFFFF5; } P.abstract {color:blue; margin-left: 10%; /* width: 80%; */ margin-right: auto; /* background-color: gray; */ } /* a:active { color:red; } a:visited { color:yellow; background-color:blue; } a:link { color:green; } a:hover { color:green; font:bold; } */ /* IMG.inlinemath { text-align: bottom } */ /************************************************/ body { margin:9px 9px 0 9px; padding:0; background-color:#ffffff; } #level0{ background-color:#ffcc00; } #level1 { margin-left:143px; padding-left:9px; background-color:#FFFFFF; } #level2 { background:#FFF3AC; position:relative; } #level3 { margin-right:143px; padding-right:9px; background:#FFFFFF; } #main { background:#fff3ac; } #topBar { background:#ffffff; } #advBar { background:#fff3ac; } #tipDay { float:right; width:175px; background:#FFF3AC; } #lftBar { position:absolute; width:143px; top:9px; left:9px; } #rgtBar { position:absolute; width:143px; top:0; right:0; } --- NEW FILE: hello.php --- <?php print("hello world\n"); ?> --- NEW FILE: db_table_buttons.php --- <form action="db_gmap.php" method="post"> <?php include ("connect.php"); print("Choose different table: "); print("<table class='db_schema'>"); $dbh = connect_postgres($dbname) or die("Unable to connect to database"); $statement = "SELECT TABLENAME FROM pg_tables WHERE NOT TABLENAME~'pg_.*' and not tablename~'sql_.*'"; $stat = @pg_exec($dbh,$statement); if (!$stat) { print "<strong>ERROR</strong>: Could not access list of tables for database <strong>".strtoupper($dbname)."</strong>."; } else { $rows = pg_numrows($stat); /* for ($i = 0; $i < $rows; $i++) { $data = pg_fetch_row($stat, $i); print ("<input type=hidden name=db1 value=\"$dbname\">"); print ("<input type=submit name=tbl1 value=\"" . $data[0] . "\">"); } */ print ("<input type=hidden name=db1 value=\"$dbname\">"); print ("<input type=submit value=GO>"); print("<select name=tbl1>"); for ($i = 0; $i < $rows; $i++) { $data = pg_fetch_row($stat, $i); print ("<option value=$data[0]> $data[0] </option>"); } print ("<\select>"); } pg_close($dbh); ?> </form> --- NEW FILE: connect.php --- <?php /** Function connect_postgres takes in a database name, and returns the * database handle. Note that the user, host, and port should be adjusted * to match those of the particular postmaster server being used. */ include("config.php"); function perr($fname, $err) { $pstring = "<strong>ERROR</strong>: ".$err. " in ".$fname; die($pstring); } function connect_postgres($db) { $connstr = "dbname=$db user=postgres host=192.168.1.131 port=5432"; if(!($dbh = @pg_connect($connstr))) { print("connect". "Could not connect to database\n"); } return $dbh; } ?> --- NEW FILE: db_admin.php --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>FireBug database utility script</title> <link rel="SHORTCUT ICON" href="./images/favicon.ico"> <link type="text/css" rel="stylesheet" href="firebug.css"> </head> <body> <h1>FireBug database administration</h1> FireBug logs to a sql database. Since the number of database operations necessary for logging are a limited subset of SQL, we wrap the database administration commands using <a href="http://www.php.net">PHP</a> with an <a href="http://www.apache.org">Apache</a> web server. <hr /> <form action="db_create.php" method="post"> NOTE: Database names are <strong>CASE-INSENSITIVE</strong>. Also, check below for a list of currently known database names that <strong>CANNOT</strong> be used. <br> Database name: <input type="text" name="dbname" /> <br /> Number of motes: <input type="text" name="nummotes"/> <br /> <input type="submit" value="Create database" /> </form> <hr /> <strong>Currently-Known Database Names that are NOT ALLOWED:</strong> <br> and <br> as <br> between <br> in <br> into <br> or <br> select <br> template0 <br> template1 <br> where <br /> <hr /> <?php //$string = system("D:\cygwin\bin\gnuplot.exe < test.gnu"); `D:\cygwin\bin\gnuplot.exe < test.gnu`; include("nav_footer.php"); ?> <!-- --> <img src="../imagetest/test.png"> <!-- --> <hr /> <p> Last Updated: $Date: 2005/06/08 20:45:36 $ by $Author: dantu $. </p> </body> </html> |
From: Karthik D. <da...@us...> - 2005-06-08 20:45:00
|
Update of /cvsroot/firebug/firebug/web/gmaps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26139/gmaps Log Message: Directory /cvsroot/firebug/firebug/web/gmaps added to the repository |
From: Karthik D. <da...@us...> - 2005-06-08 20:35:44
|
Update of /cvsroot/firebug/firebug/web/postgres In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20201 Modified Files: db_select.php db_table_buttons.php Added Files: db_gmap.php db_gmap.php~ db_render_xml.php db_render_xml.php~ db_xml_create.php db_xml_create.php~ geocodeinfo_rfs.xsl gmaps.html gmaps.xml gmaps_update.php hello.php Log Message: New code for working on gmaps. KAR. --- NEW FILE: db_gmap.php --- <html> <head> <title>Richmond Field Station Experiment</title> <script src="http://google.com/maps?file=js&hl=en" type="text/javascript"> </script> <script type="text/javascript"> _mSiteName = 'Richmond Field Station'; _mUsePrintLink=""; function initMap() { // // frb // myMapApp = new _MapsApplication(document.getElementById("container_frb"), document.getElementById("panel"), document.getElementById("metapanel"), document.getElementById("permalink"), document.getElementById("toggle"), document.getElementById("printheader")); myMapApp.loadMap(); /* Note: All XML & XSL files must be on same domain. */ _loadXmlFileFromURL("/firebug/web/gmaps/db_render_xml.php", myMapApp); } t.dump = function(a) {alert(a);} //debugging function _loadXmlFileFromURL(url, mapApp) { // // Loads the specified external XML file into the map view. // // frb // // NOTE: URL must be on same domain as page. var _getter = _XMLHttp.create(); _getter.open("GET", url); _getter.onreadystatechange=function() { if (_getter.readyState==4) { mapApp.loadXML(_getter.responseText); } } _getter.send(null); // Whoops, IE *needs* this to be last, Moz is lenient. } </script> <style type="text/css"> #panel table { border:solid 1px grey; width:50%; margin-bottom: 5px; } #panel table td:first-child { width: 24px; } .label { font-size:smaller; font-family:sans-serif; }; </style> </head> <body onload="initMap()"> <!----> <?php include("db_xml_create.php"); ?> <!-- Note: Map height always maximum? --> <div style="position:absolute;left:5px;top:10px;right:5px;border:solid thin grey;"> <div id="container_frb" style="float:right;width:35%;" > </div> <div style="float:left;position:relative;left:10px;width:60%"> <div style="position:absolute;left:0px;top:0px;width:50%;overflow:auto;"> <h1 style="font-family:sans-serif;font-size:medium;">Richmond Field Station Demo</h1> <p><dl> Sensor data last updated: </dl> </p> </div> <div style="position:absolute;left:50%;top:5px;width:50%;"> <div id="toggle" style="position:absolute;top:0px:left:10px;font-family:sans-serif;font-size:smaller;"> </div> <div style="position:absolute;top:30px;left:5px;"> <div id="panel" style="height:90%;width:100%;"> </div> <div id="metapanel">metapanel</div> <div id="permalink">permalink</div> <div id="printheader">header</div> </div> </div> </div> </div> <!-- </body> </html> --- NEW FILE: db_xml_create.php~ --- <?php if ($HTTP_POST_VARS["tbl1"]!=Null){ $HTTP_SESSION_VARS["tblname"] = $HTTP_POST_VARS["tbl1"]; $HTTP_SESSION_VARS["dbname"] = $HTTP_POST_VARS["db1"]; } $dbname = $HTTP_SESSION_VARS["dbname"]; $tblname = $HTTP_SESSION_VARS["tblname"]; print("<h1>Mote activity: Database $dbname, table $tblname</h1>"); include("db_table_buttons.php"); $dbh = connect_postgres($dbname); $statement = "SELECT a.attname FROM pg_attribute a,pg_class c where c.relname ='$tblname' and a.attrelid = c.oid and a.attnum > 0"; $stat = @pg_exec($dbh,$statement); if (!$stat) { print "<strong>ERROR</strong>: Could not retrieve table header column names for<strong>".strtoupper($tblname)."</strong>."; } else { $statement = "SELECT * FROM $tblname"; $stat = @pg_exec($dbh,$statement); if (!$stat) { print "<strong>ERROR</strong>: Could not access table <strong>".strtoupper($tblname)."</strong>."; } else { /* function print_row($item2,$key) { print ("<td style=\"border-right: solid\" align=\"center\">\n"); echo "$item2\n"; print ("</td>\n"); } */ /*** * * ***** FIXME ********* * The field labels are hardcoded in here. * You have to change the labels for this to work. * ***/ $rows = pg_numrows($stat); /*** * * Setting up google maps specific stuff * * $ids contains the ten ids that you can associate * with locations * * $ imgs lists the image icons that you can have * ***/ $ids=array('A','B','C','D','E','F','G','H','I','J'); $imgs=array('http://libgmail.sourceforge.net/man.png', 'http://libgmail.sourceforge.net/spider.png'); $fh=fopen("gmaps2.xml", "w") or perr("db_xml_create", "unable to create file"); for ($i=0;$i<$rows;$i++) { fprintf($fh, "<location infoStyle=\"geocodeinfo_rfs.xsl\" id=\"%s\">\n", $ids[$i]) or perr("db_xml_create", "Cant fprintf"); $row = array_values(pg_fetch_row($stat,$i)) or perr("db_xml_create", "Cannot retrieve data"); foreach ($rows as $key => $value) { switch($key) { case "latitudedegree": $latdeg=$value; break; case "latitudeminutes": $latmin=$value; break; case "longitudedegree": $longdeg=$value; break; case "longtudeminute": $longmin=$value; break; default: $disp[$key]=$value; } } $lat = $latdeg + ($latmin/60.0); $long = $longdeg + ($longmin/60.0); print("Now printing values into the xml file\n"); fprintf($fh, "<point lat=\"%f\" lng=\"%f\"/>\n", $lat, $long) or perr("db_xml_create", "1"); fprintf($fh, "<icon image=\"%s\" class=\"local\"/>\n", $imgs[0]); fprintf($fh, $str1) or perr("db_xml_create","3"); fprintf($fh, "<info>") or perr("db_xml_create","4"); fprintf($fh, "<title xml:space=\"preserve\" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\">\n") or perr("db_xml_create","5"); fprintf($fh, "</title>\n") or perr("db_xml_create","6"); print("Halfway done\n") or perr("db_xml_create","7"); fprintf($fh, "<address>\n") or perr("db_xml_create","8"); fprintf($fh, "<line>Ms. Eva Green</line>\n") or perr("db_xml_create","9"); fprintf($fh, "</address>\n") or perr("db_xml_create","10"); fprintf($fh, "<image>\n") or perr("db_xml_create","11"); fprintf($fh, "http://www.google.co.nz/images/logo_sm.gif\n") or perr("db_xml_create","12"); fprintf($fh, "</image>\n") or perr("db_xml_create","13"); fprintf($fh, "</info>\n") or perr("db_xml_create","14"); } } print("Done with all\n"); pg_close($dbh); fclose($fh); } ?> --- NEW FILE: gmaps_update.php --- <?php --- NEW FILE: geocodeinfo_rfs.xsl --- <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:apply-templates select="location"/> </xsl:template> <xsl:template match="location"> <div style="padding-right: 8px; margin-top: 2px"> <xsl:apply-templates select="info"/> </div> </xsl:template> <xsl:template match="info"> <xsl:variable name="page" select="../@arg0"/> <xsl:variable name="address"> <xsl:for-each select="address/line"> <xsl:if test="position() > 1">, </xsl:if> <xsl:value-of select="."/> </xsl:for-each> </xsl:variable> <div style="font-weight: bold">Custom!</div> <div> <img> <xsl:attribute name="src"> <xsl:value-of select="image"/> </xsl:attribute> </img> </div> <div style="font-size: small; margin-top: 14px"> <xsl:apply-templates select="address/line"/> </div> </xsl:template> <xsl:template match="line"> <div style="margin-top: 2px"><xsl:value-of select="."/></div> </xsl:template> <xsl:template name="getSingleLineAddress"> <xsl:for-each select="address/line"> <xsl:if test="position() > 1">, </xsl:if> <xsl:value-of select="."/> </xsl:for-each> </xsl:template> </xsl:stylesheet> Index: db_select.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/postgres/db_select.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** db_select.php 6 Jun 2005 19:23:19 -0000 1.3 --- db_select.php 8 Jun 2005 20:35:33 -0000 1.4 *************** *** 9,13 **** ! <form action="db_table_select.php" method="post"> <?php --- 9,13 ---- ! <form action="db_gmap.php" method="post"> <?php --- NEW FILE: db_render_xml.php~ --- <?php if ($HTTP_POST_VARS["tbl1"]!=Null){ $HTTP_SESSION_VARS["tblname"] = $HTTP_POST_VARS["tbl1"]; $HTTP_SESSION_VARS["dbname"] = $HTTP_POST_VARS["db1"]; } $dbname = $HTTP_SESSION_VARS["dbname"]; $tblname = $HTTP_SESSION_VARS["tblname"]; $dbh = connect_postgres($dbname); $statement = "SELECT a.attname FROM pg_attribute a,pg_class c where c.relname ='$tblname' and a.attrelid = c.oid and a.attnum > 0"; $stat = @pg_exec($dbh,$statement); $statement = "SELECT * FROM $tblname"; $stat = @pg_exec($dbh,$statement); /*** * * ***** FIXME ********* * The field labels are hardcoded in here. * You have to change the labels for this to work. * ***/ $rows = pg_numrows($stat); /*** * * Setting up google maps specific stuff * * $ids contains the ten ids that you can associate * with locations * * $ imgs lists the image icons that you can have * ***/ $ids=array('A','B','C','D','E','F','G','H','I','J'); $imgs=array('http://libgmail.sourceforge.net/man.png', 'http://libgmail.sourceforge.net/spider.png'); for ($i=0;$i<$rows;$i++) { printf("<location infoStyle=\"geocodeinfo_rfs.xsl\" id=\"%s\">\n", $ids[$i]) or perr("db_xml_create", "Cant fprintf"); $row = array_values(pg_fetch_row($stat,$i)) or perr("db_xml_create", "Cannot retrieve data"); foreach ($rows as $key => $value) { switch($key) { case "latitudedegree": $latdeg=$value; break; case "latitudeminutes": $latmin=$value; break; case "longitudedegree": $longdeg=$value; break; case "longtudeminute": $longmin=$value; break; default: $disp[$key]=$value; } } $lat = $latdeg + ($latmin/60.0); $long = $longdeg + ($longmin/60.0); printf("<point lat=\"%f\" lng=\"%f\"/>\n", $lat, $long) or perr("db_xml_create", "1"); printf("<icon image=\"%s\" class=\"local\"/>\n", $imgs[0]); print("<info>") or perr("db_xml_create","4"); print("<title xml:space=\"preserve\" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\">\n") or perr("db_xml_create","5"); print("</title>\n") or perr("db_xml_create","6"); print("<address>\n") or perr("db_xml_create","8"); print("<line>Ms. Eva Green</line>\n") or perr("db_xml_create","9"); print("</address>\n") or perr("db_xml_create","10"); print("<image>\n") or perr("db_xml_create","11"); print("http://www.google.co.nz/images/logo_sm.gif\n") or perr("db_xml_create","12"); print("</image>\n") or perr("db_xml_create","13"); print("</info>\n") or perr("db_xml_create","14"); } pg_close($dbh); ?> --- NEW FILE: db_render_xml.php --- <p> <?php include("connect.php"); /* if ($HTTP_POST_VARS["tbl1"]!=Null){ $HTTP_SESSION_VARS["tblname"] = $HTTP_POST_VARS["tbl1"]; $HTTP_SESSION_VARS["dbname"] = $HTTP_POST_VARS["db1"]; } $dbname = $HTTP_SESSION_VARS["dbname"]; $tblname = $HTTP_SESSION_VARS["tblname"]; */ print("<?xml version=\"1.0\"?>\n"); print("<page>\n"); print("<title>Richmond Field Station Demo</title>\n"); print("<query>Demo?</query>\n"); print("<request/>\n"); print("<center lat=\"37.9177\" lng=\"-122.332\"/>\n"); print("<!-- Original -->\n"); print("<!--\n"); print("<span lat=\"0.0179\" lng=\"0.027586\"/>\n"); print("-->\n"); print("<span lat=\"0.002\" lng=\"0.003\"/>\n"); print("<overlay panelStyle=\"sidepanel.xsl\">\n"); $dbname = "task"; $tblname = "gga_l"; $dbh = connect_postgres($dbname); $statement = "SELECT a.attname FROM pg_attribute a,pg_class c where c.relname ='$tblname' and a.attrelid = c.oid and a.attnum > 0"; $stat = @pg_exec($dbh,$statement); if(!stat) { die("Cannot select from database\n"); } $statement = "SELECT * FROM $tblname"; $stat = @pg_exec($dbh,$statement); if(!stat) { die("Cannot select from table\n"); } /*** * * ***** FIXME ********* * The field labels are hardcoded in here. * You have to change the labels for this to work. * ***/ $rows = pg_numrows($stat); /*** * * Setting up google maps specific stuff * * $ids contains the ten ids that you can associate * with locations * * $ imgs lists the image icons that you can have * ***/ $ids=array('A','B','C','D','E','F','G','H','I','J'); $imgs=array('http://libgmail.sourceforge.net/man.png', 'http://libgmail.sourceforge.net/spider.png'); for ($i=0;$i<$rows;$i++) { printf("<location infoStyle=\"geocodeinfo_rfs.xsl\" id=\"%s\">\n", $ids[$i]) or perr("db_xml_create", "Cant fprintf"); $row = array_values(pg_fetch_row($stat,$i)) or perr("db_xml_create", "Cannot retrieve data"); foreach ($rows as $key => $value) { switch($key) { case "latitudedegree": $latdeg=$value; break; case "latitudeminutes": $latmin=$value; break; case "longitudedegree": $longdeg=$value; break; case "longtudeminute": $longmin=$value; break; default: $disp[$key]=$value; } } $lat = $latdeg + ($latmin/60.0); $long = $longdeg + ($longmin/60.0); printf("<point lat=\"%f\" lng=\"%f\"/>\n", $lat, $long) or perr("db_xml_create", "1"); printf("<icon image=\"%s\" class=\"local\"/>\n", $imgs[0]); print("<info>") or perr("db_xml_create","4"); print("<title xml:space=\"preserve\" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\">\n") or perr("db_xml_create","5"); print("</title>\n") or perr("db_xml_create","6"); print("<address>\n") or perr("db_xml_create","8"); print("<line>Ms. Eva Green</line>\n") or perr("db_xml_create","9"); print("</address>\n") or perr("db_xml_create","10"); print("<image>\n") or perr("db_xml_create","11"); print("http://www.google.co.nz/images/logo_sm.gif\n") or perr("db_xml_create","12"); print("</image>\n") or perr("db_xml_create","13"); print("</info>\n") or perr("db_xml_create","14"); } pg_close($dbh); ?> </p> --- NEW FILE: gmaps.xml --- <?xml version="1.0"?> <page> <title>Custom XSL Demo</title> <query>Why?</query> <request/> <center lat="37.9177" lng="-122.332"/> <!-- Original --> <!-- <span lat="0.0179" lng="0.027586"/> --> <span lat="0.002" lng="0.003"/> <overlay panelStyle="sidepanel.xsl"> <location infoStyle="geocodeinfo_rfs.xsl" id="A"> <point lat="37.91" lng="-122.33"/> <icon image="http://libgmail.sourceforge.net/man.png" class="local"/> <info> <title xml:space="preserve" xmlns:xml="http://www.w3.org/XML/1998/namespace"> </title> <address> <line>Mr G. Oogle</line> </address> <image> http://www.google.co.nz/images/logo_sm.gif </image> </info> </location> <location infoStyle="geocodeinfo_rfs.xsl" id="B"> <point lat="37.915" lng="-122.332"/> <icon image="http://maps.google.com/mapfiles/marker.png" class="local"/> <info> <title xml:space="preserve" xmlns:xml="http://www.w3.org/XML/1998/namespace"/> <address> <line>Here be spiders...</line> </address> <image> http://libgmail.sourceforge.net/spider.png </image> </info> </location> <location infoStyle="geocodeinfo_rfs.xsl" id="C"> <point lat="37.91862" lng="-122.3324"/> <icon image="http://maps.google.com/mapfiles/marker.png" class="local"/> <info> <title xml:space="preserve"/> <address> <line>Building 454, Room 124</line> </address> <image> http://libgmail.sourceforge.net/man.png </image> </info> </location> </overlay> </page> Index: db_table_buttons.php =================================================================== RCS file: /cvsroot/firebug/firebug/web/postgres/db_table_buttons.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** db_table_buttons.php 7 Jun 2005 00:43:19 -0000 1.4 --- db_table_buttons.php 8 Jun 2005 20:35:33 -0000 1.5 *************** *** 1,5 **** ! <form action="db_table_select.php" method="post"> <?php --- 1,5 ---- ! <form action="db_gmap.php" method="post"> <?php --- NEW FILE: db_xml_create.php --- <?php if ($HTTP_POST_VARS["tbl1"]!=Null){ $HTTP_SESSION_VARS["tblname"] = $HTTP_POST_VARS["tbl1"]; $HTTP_SESSION_VARS["dbname"] = $HTTP_POST_VARS["db1"]; } $dbname = $HTTP_SESSION_VARS["dbname"]; $tblname = $HTTP_SESSION_VARS["tblname"]; // print("<h1>Mote activity: Database $dbname, table $tblname</h1>"); // include("db_table_buttons.php"); $dbh = connect_postgres($dbname); $statement = "SELECT a.attname FROM pg_attribute a,pg_class c where c.relname ='$tblname' and a.attrelid = c.oid and a.attnum > 0"; $stat = @pg_exec($dbh,$statement); if (!$stat) { print "<strong>ERROR</strong>: Could not retrieve table header column names for<strong>".strtoupper($tblname)."</strong>."; } else { $statement = "SELECT * FROM $tblname"; $stat = @pg_exec($dbh,$statement); if (!$stat) { print "<strong>ERROR</strong>: Could not access table <strong>".strtoupper($tblname)."</strong>."; } else { /* function print_row($item2,$key) { print ("<td style=\"border-right: solid\" align=\"center\">\n"); echo "$item2\n"; print ("</td>\n"); } */ /*** * * ***** FIXME ********* * The field labels are hardcoded in here. * You have to change the labels for this to work. * ***/ $rows = pg_numrows($stat); /*** * * Setting up google maps specific stuff * * $ids contains the ten ids that you can associate * with locations * * $ imgs lists the image icons that you can have * ***/ $ids=array('A','B','C','D','E','F','G','H','I','J'); $imgs=array('http://libgmail.sourceforge.net/man.png', 'http://libgmail.sourceforge.net/spider.png'); $fh=fopen("gmaps2.xml", "w") or perr("db_xml_create", "unable to create file"); for ($i=0;$i<$rows;$i++) { fprintf($fh, "<location infoStyle=\"geocodeinfo_rfs.xsl\" id=\"%s\">\n", $ids[$i]) or perr("db_xml_create", "Cant fprintf"); $row = array_values(pg_fetch_row($stat,$i)) or perr("db_xml_create", "Cannot retrieve data"); foreach ($rows as $key => $value) { switch($key) { case "latitudedegree": $latdeg=$value; break; case "latitudeminutes": $latmin=$value; break; case "longitudedegree": $longdeg=$value; break; case "longtudeminute": $longmin=$value; break; default: $disp[$key]=$value; } } $lat = $latdeg + ($latmin/60.0); $long = $longdeg + ($longmin/60.0); print("Now printing values into the xml file\n"); fprintf($fh, "<point lat=\"%f\" lng=\"%f\"/>\n", $lat, $long) or perr("db_xml_create", "1"); fprintf($fh, "<icon image=\"%s\" class=\"local\"/>\n", $imgs[0]); fprintf($fh, $str1) or perr("db_xml_create","3"); fprintf($fh, "<info>") or perr("db_xml_create","4"); fprintf($fh, "<title xml:space=\"preserve\" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\">\n") or perr("db_xml_create","5"); fprintf($fh, "</title>\n") or perr("db_xml_create","6"); print("Halfway done\n") or perr("db_xml_create","7"); fprintf($fh, "<address>\n") or perr("db_xml_create","8"); fprintf($fh, "<line>Ms. Eva Green</line>\n") or perr("db_xml_create","9"); fprintf($fh, "</address>\n") or perr("db_xml_create","10"); fprintf($fh, "<image>\n") or perr("db_xml_create","11"); fprintf($fh, "http://www.google.co.nz/images/logo_sm.gif\n") or perr("db_xml_create","12"); fprintf($fh, "</image>\n") or perr("db_xml_create","13"); fprintf($fh, "</info>\n") or perr("db_xml_create","14"); } } print("Done with all\n"); pg_close($dbh); fclose($fh); } ?> --- NEW FILE: gmaps.html --- <html> <head> <title>Demo Two for Unofficial Google Maps Embedding How To</title> <script src="http://google.com/maps?file=js&hl=en" type="text/javascript"> </script> <script type="text/javascript"> _mSiteName = 'Richmond Field Station'; _mUsePrintLink=""; function initMap() { // // frb // myMapApp = new _MapsApplication(document.getElementById("container_frb"), document.getElementById("panel"), document.getElementById("metapanel"), document.getElementById("permalink"), document.getElementById("toggle"), document.getElementById("printheader")); myMapApp.loadMap(); /* Note: All XML & XSL files must be on same domain. */ _loadXmlFileFromURL("gmaps.xml", myMapApp); } t.dump = function(a) {alert(a);} //debugging function _loadXmlFileFromURL(url, mapApp) { // // Loads the specified external XML file into the map view. // // frb // // NOTE: URL must be on same domain as page. var _getter = _XMLHttp.create(); _getter.open("GET", url); _getter.onreadystatechange=function() { if (_getter.readyState==4) { mapApp.loadXML(_getter.responseText); } } _getter.send(null); // Whoops, IE *needs* this to be last, Moz is lenient. } </script> <style type="text/css"> #panel table { border:solid 1px grey; width:50%; margin-bottom: 5px; } #panel table td:first-child { width: 24px; } .label { font-size:smaller; font-family:sans-serif; }; </style> </head> <body onload="initMap()"> <!----> <!-- Note: Map height always maximum? --> <div style="position:absolute;left:5px;top:10px;right:5px;border:solid thin grey;"> <div id="container_frb" style="float:right;width:35%;" ></div> <div style="float:left;position:relative;left:10px;width:60%"> <div style="position:absolute;left:0px;top:0px;width:50%;overflow:auto;"> <h1 style="font-family:sans-serif;font-size:medium;">Unofficial Google Maps Embedding How To : Demo Two</h1> <p><tt>_MapsApplication({container div}, {panel div}, {metapanel div}, {permalink div}, {toggle div} | null, {printheader div})</tt></p> <p><dl> <dt style="font-weight:bold;">Container div</dt> <dd>The <tt><div></tt> where the map should be displayed.</dd> <dt style="font-weight:bold;">Panel div</dt> <dd>The <tt><div></tt> where the "sidepanel" should be displayed.</dd> <dt style="font-weight:bold;">Metapanel div</dt> <dd>It appears Gmaps uses this to display error and other messages</dd> <dt style="font-weight:bold;">Permalink div</dt> <dd>It appears Gmaps uses this to display a permanent URL. (Now appears to be required.)</dd> <dt style="font-weight:bold;">Toggle div</dt> <dd>The <tt><div></tt> where the map specification toggle should be displayed. The toggle switches between different map specifications, e.g. Map view and Satellite view. </dd> <dt style="font-weight:bold;">Printheader div</dt> <dd>Presumably displayed at the head of a printed map.</dd> </dl> </p> <p style="font-size:x-small;">-- follower at rancidbacon.com <br /> (Original page: <a href="http://stuff.rancidbacon.com/google-maps-embed-how-to/demo2.html">http://stuff.rancidbacon.com/google-maps-embed-how-to/demo2.html</a>)</p> <p style="font-size:x-small;">26 May 2005<!--25 May 2005--></p> </div> <div style="position:absolute;left:50%;top:5px;width:50%;"> <div id="toggle" style="position:absolute;top:0px:left:10px;font-family:sans-serif;font-size:smaller;"> </div> <div style="position:absolute;top:30px;left:5px;"> <div id="panel" style="height:90%;width:100%;"> </div> <div id="metapanel"></div> <div id="permalink"></div> <div id="printheader"></div> </div> </div> </div> </div> <!-- </body> </html> --- NEW FILE: db_gmap.php~ --- <html> <head> <title>Richmond Field Station Experiment</title> <script src="http://google.com/maps?file=js&hl=en" type="text/javascript"> </script> <script type="text/javascript"> _mSiteName = 'Richmond Field Station'; _mUsePrintLink=""; function initMap() { // // frb // myMapApp = new _MapsApplication(document.getElementById("container_frb"), document.getElementById("panel"), document.getElementById("metapanel"), document.getElementById("permalink"), document.getElementById("toggle"), document.getElementById("printheader")); myMapApp.loadMap(); /* Note: All XML & XSL files must be on same domain. */ _loadXmlFileFromURL("gmaps.xml", myMapApp); } t.dump = function(a) {alert(a);} //debugging function _loadXmlFileFromURL(url, mapApp) { // // Loads the specified external XML file into the map view. // // frb // // NOTE: URL must be on same domain as page. var _getter = _XMLHttp.create(); _getter.open("GET", url); _getter.onreadystatechange=function() { if (_getter.readyState==4) { mapApp.loadXML(_getter.responseText); } } _getter.send(null); // Whoops, IE *needs* this to be last, Moz is lenient. } </script> <style type="text/css"> #panel table { border:solid 1px grey; width:50%; margin-bottom: 5px; } #panel table td:first-child { width: 24px; } .label { font-size:smaller; font-family:sans-serif; }; </style> </head> <body onload="initMap()"> <!----> <?php include("db_xml_create.php"); ?> <!-- Note: Map height always maximum? --> <div style="position:absolute;left:5px;top:10px;right:5px;border:solid thin grey;"> <div id="container_frb" style="float:right;width:35%;" > </div> <div style="float:left;position:relative;left:10px;width:60%"> <div style="position:absolute;left:0px;top:0px;width:50%;overflow:auto;"> <h1 style="font-family:sans-serif;font-size:medium;">Richmond Field Station Demo</h1> <p><dl> Sensor data last updated: </dl> </p> </div> <div style="position:absolute;left:50%;top:5px;width:50%;"> <div id="toggle" style="position:absolute;top:0px:left:10px;font-family:sans-serif;font-size:smaller;"> </div> <div style="position:absolute;top:30px;left:5px;"> <div id="panel" style="height:90%;width:100%;"> </div> <div id="metapanel">metapanel</div> <div id="permalink">permalink</div> <div id="printheader">header</div> </div> </div> </div> </div> <!-- </body> </html> --- NEW FILE: hello.php --- <?php print("hello world\n"); ?> |
From: David M. D. <do...@us...> - 2005-06-08 18:39:49
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29505 Modified Files: geocodeinfo_rfs.xsl google_map_rfs.html google_rfs.xml sidepanel.xsl Log Message: Removed left info pane from map display web page. Index: google_map_rfs.html =================================================================== RCS file: /cvsroot/firebug/firebug/web/google_map_rfs.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** google_map_rfs.html 7 Jun 2005 00:44:33 -0000 1.1 --- google_map_rfs.html 8 Jun 2005 18:39:36 -0000 1.2 *************** *** 87,95 **** --- 87,102 ---- <div id="container_frb" style="float:right;width:35%;" ></div> <div style="float:left;position:relative;left:10px;width:60%"> + + <!-- <div style="position:absolute;left:0px;top:0px;width:50%;overflow:auto;"> + + + + <h1 style="font-family:sans-serif;font-size:medium;">Unofficial Google Maps Embedding How To : Demo Two</h1> <p><tt>_MapsApplication({container div}, {panel div}, {metapanel div}, {permalink div}, {toggle div} | null, {printheader div})</tt></p> + <p><dl> <dt style="font-weight:bold;">Container div</dt> *************** *** 116,122 **** <p style="font-size:x-small;">-- follower at rancidbacon.com <br /> (Original page: <a href="http://stuff.rancidbacon.com/google-maps-embed-how-to/demo2.html">http://stuff.rancidbacon.com/google-maps-embed-how-to/demo2.html</a>)</p> ! <p style="font-size:x-small;">26 May 2005<!--25 May 2005--></p> </div> <div style="position:absolute;left:50%;top:5px;width:50%;"> <div id="toggle" style="position:absolute;top:0px:left:10px;font-family:sans-serif;font-size:smaller;"> </div> --- 123,131 ---- <p style="font-size:x-small;">-- follower at rancidbacon.com <br /> (Original page: <a href="http://stuff.rancidbacon.com/google-maps-embed-how-to/demo2.html">http://stuff.rancidbacon.com/google-maps-embed-how-to/demo2.html</a>)</p> ! <p style="font-size:x-small;">26 May 2005</p> </div> + --> + <div style="position:absolute;left:50%;top:5px;width:50%;"> <div id="toggle" style="position:absolute;top:0px:left:10px;font-family:sans-serif;font-size:smaller;"> </div> *************** *** 126,130 **** <div id="metapanel"></div> <div id="permalink"></div> ! <div id="printheader"></div> </div> </div> --- 135,139 ---- <div id="metapanel"></div> <div id="permalink"></div> ! <div id="printheader"></div> </div> </div> Index: sidepanel.xsl =================================================================== RCS file: /cvsroot/firebug/firebug/web/sidepanel.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sidepanel.xsl 7 Jun 2005 00:44:33 -0000 1.1 --- sidepanel.xsl 8 Jun 2005 18:39:36 -0000 1.2 *************** *** 1,7 **** --- 1,9 ---- <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:template match="/"> <xsl:apply-templates select="location"/> </xsl:template> + <xsl:template match="location"> <table> *************** *** 48,51 **** --- 50,54 ---- </table> </xsl:template> + <xsl:template match="line"> <div> *************** *** 53,55 **** --- 56,59 ---- </div> </xsl:template> + </xsl:stylesheet> \ No newline at end of file Index: google_rfs.xml =================================================================== RCS file: /cvsroot/firebug/firebug/web/google_rfs.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** google_rfs.xml 8 Jun 2005 02:31:04 -0000 1.3 --- google_rfs.xml 8 Jun 2005 18:39:36 -0000 1.4 *************** *** 15,19 **** <location infoStyle="geocodeinfo_rfs.xsl" id="A"> ! <point lat="37.91" lng="-122.33"/> <!-- <icon image="http://libgmail.sourceforge.net/man.png" class="local"/> --> <icon image="http://localhost/firebug/images/greenman.png" class="local"/> --- 15,19 ---- <location infoStyle="geocodeinfo_rfs.xsl" id="A"> ! <point lat="37.91860" lng="-122.3328"/> <!-- <icon image="http://libgmail.sourceforge.net/man.png" class="local"/> --> <icon image="http://localhost/firebug/images/greenman.png" class="local"/> *************** *** 29,39 **** </info> </location> <location infoStyle="geocodeinfo_rfs.xsl" id="B"> ! <point lat="37.915" lng="-122.332"/> ! <icon image="http://maps.google.com/mapfiles/marker.png" class="local"/> <info> <title xml:space="preserve" xmlns:xml="http://www.w3.org/XML/1998/namespace"/> <address> <line>Here be spiders...</line> </address> <image> --- 29,43 ---- </info> </location> + + <location infoStyle="geocodeinfo_rfs.xsl" id="B"> ! <point lat="37.918128" lng="-122.33185"/> ! <!-- <icon image="http://maps.google.com/mapfiles/marker.png" class="local"/> --> ! <icon image="http://localhost/firebug/images/redman.png" class="local"/> <info> <title xml:space="preserve" xmlns:xml="http://www.w3.org/XML/1998/namespace"/> <address> <line>Here be spiders...</line> + <line>Nick's office: building 451, Room 1</line> </address> <image> *************** *** 47,52 **** <icon image="http://maps.google.com/mapfiles/marker.png" class="local"/> <info> ! <title xml:space="preserve"/> <address> <line>Building 454, Room 124</line> </address> --- 51,57 ---- <icon image="http://maps.google.com/mapfiles/marker.png" class="local"/> <info> ! <title xml:space="preserve">Dave and Karthik</title> <address> + <line>Dave and Karthik</line> <line>Building 454, Room 124</line> </address> Index: geocodeinfo_rfs.xsl =================================================================== RCS file: /cvsroot/firebug/firebug/web/geocodeinfo_rfs.xsl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** geocodeinfo_rfs.xsl 7 Jun 2005 01:26:06 -0000 1.2 --- geocodeinfo_rfs.xsl 8 Jun 2005 18:39:36 -0000 1.3 *************** *** 2,9 **** --- 2,15 ---- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + <!-- TODO: Add comment describing function of + this template. --> <xsl:template match="/"> <xsl:apply-templates select="location"/> </xsl:template> + + <!-- TODO: Add comment describing function of + this template. --> <xsl:template match="location"> <div style="padding-right: 8px; margin-top: 2px"> *************** *** 12,15 **** --- 18,24 ---- </xsl:template> + + <!-- TODO: Add comment describing function of + this template. --> <xsl:template match="info"> *************** *** 22,26 **** </xsl:variable> ! <div style="font-weight: bold">Custom!</div> <div> --- 31,35 ---- </xsl:variable> ! <div style="font-weight: bold">FireBug --- personnel</div> <div> *************** *** 38,45 **** --- 47,61 ---- </xsl:template> + + + <!-- TODO: Add comment describing function of + this template. --> <xsl:template match="line"> <div style="margin-top: 2px"><xsl:value-of select="."/></div> </xsl:template> + + <!-- TODO: Add comment describing function of + this template. --> <xsl:template name="getSingleLineAddress"> <xsl:for-each select="address/line"> *************** *** 49,52 **** --- 65,69 ---- </xsl:template> + </xsl:stylesheet> |
From: David M. D. <do...@us...> - 2005-06-08 02:31:14
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17081 Modified Files: google_rfs.xml Log Message: Fixed transparency in the pngs, using greenman for demo. Index: google_rfs.xml =================================================================== RCS file: /cvsroot/firebug/firebug/web/google_rfs.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** google_rfs.xml 7 Jun 2005 01:26:06 -0000 1.2 --- google_rfs.xml 8 Jun 2005 02:31:04 -0000 1.3 *************** *** 16,20 **** <location infoStyle="geocodeinfo_rfs.xsl" id="A"> <point lat="37.91" lng="-122.33"/> ! <icon image="http://libgmail.sourceforge.net/man.png" class="local"/> <info> <title xml:space="preserve" xmlns:xml="http://www.w3.org/XML/1998/namespace"> --- 16,21 ---- <location infoStyle="geocodeinfo_rfs.xsl" id="A"> <point lat="37.91" lng="-122.33"/> ! <!-- <icon image="http://libgmail.sourceforge.net/man.png" class="local"/> --> ! <icon image="http://localhost/firebug/images/greenman.png" class="local"/> <info> <title xml:space="preserve" xmlns:xml="http://www.w3.org/XML/1998/namespace"> *************** *** 51,55 **** </address> <image> ! http://libgmail.sourceforge.net/man.png </image> </info> --- 52,56 ---- </address> <image> ! http://localhost/firebug/images/greenman.png </image> </info> |
From: David M. D. <do...@us...> - 2005-06-08 02:31:04
|
Update of /cvsroot/firebug/firebug/web/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16976 Modified Files: greenman.png redman.png yellowman.png Log Message: Fixed transparency in the pngs, using greenman for demo. Index: greenman.png =================================================================== RCS file: /cvsroot/firebug/firebug/web/images/greenman.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvs51Z5XS and /tmp/cvsCLSJEs differ Index: redman.png =================================================================== RCS file: /cvsroot/firebug/firebug/web/images/redman.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsBIEDaX and /tmp/cvsNjTZTw differ Index: yellowman.png =================================================================== RCS file: /cvsroot/firebug/firebug/web/images/yellowman.png,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsIprpCY and /tmp/cvsy0Jfoy differ |
From: David M. D. <do...@us...> - 2005-06-08 01:52:51
|
Update of /cvsroot/firebug/firebug/web/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30258 Added Files: greenman.png man.png redman.png yellowman.png Log Message: Added some little man pngs. --- NEW FILE: greenman.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: man.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: redman.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: yellowman.png --- (This appears to be a binary file; contents omitted.) |
From: David M. D. <do...@us...> - 2005-06-07 22:10:38
|
Update of /cvsroot/firebug/fireboard/beta/tools/src/xlisten/boards In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25752/boards Modified Files: pg_test.c Log Message: Tables no longer dropped from database when xlisten starts. Index: pg_test.c =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/tools/src/xlisten/boards/pg_test.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pg_test.c 1 Jun 2005 23:34:20 -0000 1.5 --- pg_test.c 7 Jun 2005 22:10:30 -0000 1.6 *************** *** 63,66 **** --- 63,70 ---- const char * table = "xbow_weather"; + if (xdb_table_exists((char*)table)) { + return; + } + sprintf(pg_statement, fb_pg_weather_schema, table, ""); xdb_execute(pg_statement); *************** *** 77,80 **** --- 81,88 ---- const char * table = "gga"; + + if (xdb_table_exists((char*)table)) { + return; + } sprintf(pg_statement, fb_pg_gga_schema, table, ""); *************** *** 130,134 **** fb_pg_recreate_tables(void) { ! fb_pg_delete_tables(); fb_pg_create_tables(); } --- 138,142 ---- fb_pg_recreate_tables(void) { ! //fb_pg_delete_tables(); fb_pg_create_tables(); } |