[Firebug-cvs] firebug/web/gmaps db_render_xml.php,1.5,1.6
Brought to you by:
doolin
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); } |