From: <sk...@us...> - 2008-02-16 14:10:14
|
Revision: 583 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=583&view=rev Author: sknappe Date: 2008-02-16 06:10:01 -0800 (Sat, 16 Feb 2008) Log Message: ----------- added a marker on the google 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-16 13:45:26 UTC (rev 582) +++ trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-16 14:10:01 UTC (rev 583) @@ -112,7 +112,7 @@ } //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].");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;\">a map of the location</a><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-16 13:45:26 UTC (rev 582) +++ trunk/src/dbpedia-navigator/index.php 2008-02-16 14:10:01 UTC (rev 583) @@ -60,7 +60,7 @@ document.getElementById(id).style.display='none'; } - function loadGoogleMap(Lat,Lng) { + function loadGoogleMap(Lat,Lng,Label) { document.getElementById("map").style.display='block'; if (GBrowserIsCompatible()) { // Create and Center a Map @@ -68,8 +68,13 @@ 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); } - } + } </script> </head> <body <?php print $onLoad;?>> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |