From: <sk...@us...> - 2008-02-17 10:11:54
|
Revision: 587 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=587&view=rev Author: sknappe Date: 2008-02-17 02:11:48 -0800 (Sun, 17 Feb 2008) Log Message: ----------- changed the map and map link a bit, link now toggles the map Modified Paths: -------------- trunk/src/dbpedia-navigator/ajaxfunctions.php trunk/src/dbpedia-navigator/index.php Modified: trunk/src/dbpedia-navigator/ajaxfunctions.php =================================================================== --- trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-17 10:08:08 UTC (rev 586) +++ trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-17 10:11:48 UTC (rev 587) @@ -110,9 +110,10 @@ $content .= '<li><a href="'.$reference.'">'.$reference.'</a></li>'; $content .= '</ul></p>'; } + //display a Google Map if Geo-koordinates are available if (isset($triples['http://www.w3.org/2003/01/geo/wgs84_pos#long'])&&isset($triples['http://www.w3.org/2003/01/geo/wgs84_pos#lat'])){ - $content.="<br/><img src=\"".$_GET['path']."images/mobmaps_googlemapsicon.jpg\" alt=\"Google Maps\" style=\"max-width:30px;\" /> <a href=\"\" onClick=\"loadGoogleMap(".$triples['http://www.w3.org/2003/01/geo/wgs84_pos#lat'][0].",".$triples['http://www.w3.org/2003/01/geo/wgs84_pos#long'][0].",'".$triples['http://www.w3.org/2000/01/rdf-schema#label'][0]."');return false;\">a map of the location</a><div id=\"map\" style=\"width: 500px; height: 300px;display:none;\"></div>"; + $content.="<br/><img src=\"".$_GET['path']."images/mobmaps_googlemapsicon.jpg\" alt=\"Google Maps\" style=\"max-width:30px;\" /> <a href=\"\" onClick=\"loadGoogleMap(".$triples['http://www.w3.org/2003/01/geo/wgs84_pos#lat'][0].",".$triples['http://www.w3.org/2003/01/geo/wgs84_pos#long'][0].",'".$triples['http://www.w3.org/2000/01/rdf-schema#label'][0]."');return false;\">Toggle a map of the location</a><br/><br/><div id=\"map\" style=\"width: 500px; height: 300px;display:none;\"></div>"; } Modified: trunk/src/dbpedia-navigator/index.php =================================================================== --- trunk/src/dbpedia-navigator/index.php 2008-02-17 10:08:08 UTC (rev 586) +++ trunk/src/dbpedia-navigator/index.php 2008-02-17 10:11:48 UTC (rev 587) @@ -61,19 +61,24 @@ } function loadGoogleMap(Lat,Lng,Label) { - document.getElementById("map").style.display='block'; - if (GBrowserIsCompatible()) { - // Create and Center a Map - var map = new GMap2(document.getElementById("map")); - map.setCenter(new GLatLng(Lat, Lng), 12); - map.addControl(new GLargeMapControl()); - map.addControl(new GMapTypeControl()); - var marker=new GMarker(new GLatLng(Lat, Lng)); - GEvent.addListener(marker, "click", function() { - marker.openInfoWindowHtml(Label); - }); - map.addOverlay(marker); - } + if (document.getElementById("map").style.display=="none"){ + document.getElementById("map").style.display='block'; + if (GBrowserIsCompatible()) { + // Create and Center a Map + var map = new GMap2(document.getElementById("map")); + map.setCenter(new GLatLng(Lat, Lng), 12); + map.addControl(new GLargeMapControl()); + map.addControl(new GMapTypeControl()); + var marker=new GMarker(new GLatLng(Lat, Lng)); + GEvent.addListener(marker, "click", function() { + marker.openInfoWindowHtml(Label); + }); + map.addOverlay(marker); + } + } + else { + document.getElementById("map").style.display='none'; + } } </script> </head> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |