My issue is more an issue with getting the data out of my data base into
the correct format for the API.
This is the example code I have been trying to modify.:
http://www.bradwedell.com/phpgooglemapapi/demos/advanced_marker_opene...
Here is my output:
http://www.gojapango.com/travel/japanese_castles_map_test.html
Here is the code:
<?php
include_once("../includes/GoogleMap.php");
include_once("../includes/JSMin.php");
require ("../includes/databaseconnect.inc");
mysql_select_db("gojapan_hotel",$db);
// ************************* DEFINE MAP ****************
$marker_web_location = "http://www.gojapango.com/images/map_icons/";
$marker_count = '0';
if (($parent_poi_category_id==19) OR ($parent_poi_category_id==22) OR
($parent_poi_category_id==23))
{$zoom_level='12';}
else {$zoom_level='15';}
$MAP_OBJECT = new GoogleMapAPI();
$MAP_OBJECT->_minify_js = isset($_REQUEST["min"])?FALSE:TRUE;
$MAP_OBJECT->type_controls_style="DROPDOWN_MENU";
$MAP_OBJECT->width="470px";
$MAP_OBJECT->height="640px";
$MAP_OBJECT->zoom="$zoom_level";
$MAP_OBJECT->disableSidebar();
$SIDEBAR_HTML = "";
// Selects all the rows in the POI table.
$query = 'SELECT * FROM poi Inner Join poi_subcategory ON
poi.POI_sub_cat_ID = poi_subcategory.POI_sub_cat_ID WHERE
poi.POI_category_ID = 25 AND poi.POI_sub_cat_ID <> 1';
$result = mysql_query($query);
if (!$result)
{
die('Invalid query: ' . mysql_error());
}
// Iterates through the MySQL results, creating one Placemark for each row.
while ($row = @mysql_fetch_assoc($result))
{
$marker_count = $marker_count + 1;
$map_icon = $marker_web_location.$row['Subcategory_map_icon'];
$DescriptionHTML = '<table
width="220"><tbody><tr><td>'.$row['Description'].'</td></tr></tbody></table >';
$marker_id =
$MAP_OBJECT->addMarkerByCoords($row['Longitude'],$row['Latitude'],$row['Tit le'],$DescriptionHTML,$tooltip="",$map_icon);
//create an id to be used for the marker opener
$opener_id = "opener_".$marker_id;
//append li item to sidebar html
$SIDEBAR_HTML .= '<li id="$opener_id"><a
href="#">'.$row['Title'].'</a></li>';
//add marker opener id to map object
$MAP_OBJECT->addMarkerOpener($marker_id, $opener_id);
}
// ************************* FILE HEADER *******************************
echo ("
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' '
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<title>JAPANESE CASTLES MAP</title>
<meta name='description' content='Japanese Castles Map shows the location
of $marker_count of the current and former Japanese Castles. This Japanese
Castles Map provides details, links to more information and in some cases
pictures of Japanese Castles' />
<meta name='keywords' content='JAPANESE CASTLES MAP' />
<link href='../templates/gojapango_std.css' rel='stylesheet'
type='text/css' />
<!-- GOOGLE ANALYTICS-->
<script type='text/javascript'>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-199931-6']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : '
http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>");
echo $MAP_OBJECT->getHeaderJS();
echo $MAP_OBJECT->getMapJS();
echo ("<style type='text/css'>
.sidebar, #map{
float:left;
}
.sidebar{
width:470px;
border:1px #000 solid;
margin-left:5px;
}
h5{
margin:0px;
padding:5px;
background-color:#F00;
color:#fff;
}
ul, li{
list-style:none;
margin:0px;
padding:0px;
}
li{
border-bottom:1px #000 solid;
display:block;
}
li a{
display:block;
padding:5px;
background-color:#CCC;
}
li a:hover{
background-color:#999;
}
li p{
padding:5px;
}
</style>
</head>");
// ************************* BODY *******************************
echo ("<body class='thrColAbsHdr'>
<div id='container'>
<div id='header'>
<!-- end #header --></div>");
// ****************** MAIN CONTENT *********************
echo (" <div id='mainContent'>
<h1>JAPANESE CASTLES MAP</h1>
<p class='style3'>Japanese Castles Map shows the location of
$marker_count of the current and former Japanese Castles. This Japanese
Castles Map provides details, links to more information and in some cases
pictures of Japanese Castles</p>
");
//********* DISPLAY MAP ***************************************
echo $MAP_OBJECT->printOnLoad();
echo $MAP_OBJECT->printMap();
echo ("<div class='sidebar'>
<h5>Japanese Castle Sidebar</h5>
<ul>");
echo $SIDEBAR_HTML;
echo ("</ul>
</div>");
echo (" <br />
<p class='style3'><a href='japanese_castles_map.kml'>Japanese
Castle Map</a> data in the form of Google KML format which allows you to
load these Japanese Castles onto your GPS or Smart phone to assist with
directions.</p>
<img src='images/DSC05901.jpg' border='0' width='470' height='352'
alt='Japanese Castle' />
<p class='style_picture'><a href='himeji_castle.html'>Himeji
Castle</a> - the best example of a Japanese Castle</p>
<!-- end #mainContent --></div> ");
// ********* END MAIN CONTENT ***************************************
// ****************** LEFT SIDE BAR ********************* -->
echo (" <div id='sidebar1'>
<div align='center'><a href='http://www.gojapango.com'>
<img src='../images/gojapango_logo_141x100.png' width='160'
height='113' border='0' alt='Japan' /></a>
</div>
<a style='text-decoration:none'
href='japanese_castles.html'><h2>JAPANESE CASTLES</h2></a>
<p class='MenuOn'>
<a href='japanese_castles_map.html'>Japanese Castles Map</a><br/>
<a href='japanese_castles_world_heritage.html'>Japanese Castles
World Heritage</a><br/>
<a href='japanese_castles_list.html'>List of Japanese Castles</a><br/>
<a href='japanese_castles_history.html'>Japanese Castles
History</a><br/>
<a href='japanese_castles_region.html'>Japanese Castles by
Region</a><br/>
<a href='kansai_castles.htm'>Kansai Castles</a><br/>
<a href='japanese_castles_architecture.html'>Japanese Castles
Architecture</a><br/>
<br/>
<strong>Featured Japanese Castles</strong><br/>
<a href='shiga_hikone_castle.htm'>Hikone Castle</a><br/>
<a href='himeji_castle.html'>Himeji Castle</a><br/>
<a href='kyoto_nijo_castle.htm'>Nijo Castle</a><br/>
<a href='osaka_castle.htm'>Osaka Castle</a><br/>
</p>
<div id='sidebar1_footer'>
<p class='MenuOn'>
<a href='traveltojapan.html'><strong>OTHER JAPAN
DESTINATIONS</strong></a><br/>
<a href='../tokyo/'>Tokyo</a><br/>
<a href='osaka.htm'>Osaka</a><br/>
<a href='kyoto.htm'>Kyoto</a><br/>
</p>
</div>
<!-- end #sidebar1 --></div>");
// ****************** RIGHT SIDE BAR ********************* -->
echo (" <div id='sidebar2'>
<!-- GOOGLE SITE SEARCH -->
<div id='cse-search-form' style='width: 100%;'>Loading</div>
<script src='http://www.google.com/jsapi' type='text/javascript'></script>
<script type='text/javascript'>
google.load('search', '1', {language : 'en'});
google.setOnLoadCallback(function() {
var customSearchOptions = {};
var imageSearchOptions = {};
imageSearchOptions['layout'] = google.search.ImageSearch.LAYOUT_POPUP;
customSearchOptions['enableImageSearch'] = true;
customSearchOptions['imageSearchOptions'] = imageSearchOptions;
customSearchOptions['adoptions'] = {'layout': 'noTop'};
var customSearchControl = new google.search.CustomSearchControl(
'008091552920632978614:yl12fes0l-0', customSearchOptions);
customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESU LTSET);
var options = new google.search.DrawOptions();
options.enableSearchboxOnly('
http://www.gojapango.com/includes/search.htm');
customSearchControl.draw('cse-search-form', options);
}, true);
</script>
<!-- AddThis Button BEGIN -->
<div class='addthis_toolbox addthis_default_style '>
<a class='addthis_button_facebook_like' fb:like:layout='button_count'></a>
<a class='addthis_button_tweet'></a>
<a class='addthis_counter addthis_pill_style'></a><br />
<p>Follow GoJapanGo for Daily Pictures, Tips
<a class='addthis_button_facebook_follow'
addthis:userid='japaneselifestyle'></a></p>
</div>
<script type='text/javascript' src='
http://s7.addthis.com/js/250/addthis_widget.js#pubid=mimarket'></script>
<!-- AddThis Button END -->
<br />
<a href='../travel/japan_hotels.htm'><img
src='../advert/hotels_300x250.gif' alt='Japan Hotels' width='300'
height='250' border='0' /></a><br /><br />");
echo (" <!-- end #sidebar2 --></div>");
// ****************** FOOTER *********************
echo (" <div id='footer'>
<table width='90%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<th valign='top' scope='col'>
<p class='MenuSmallOn'>
<a href='../culture/culture.html'>Japanese Culture</a><br/>
<a href='../japan_picture/index.php'>Japan Pictures</a><br/>
<a href='map_of_japan.html'>Japan Map</a><br/>
<a href='../japanese_friends/japanese_girls.html'>Japanese
Girls</a><br/>
<a href='../japanese_friends/japanese_dating.htm'>Japanese
Dating</a><br/></p>
</th>
<th valign='top' scope='col'>
<p class='MenuSmallOn'>
<a
...
read more »