logic in my sidebar code is off
hey folks,
i've implemented a sidebar up on http://www.HomePricemaps.com (use the
zipcode of 19111 to see what i'm talking about).
In any event you will see that the sidebar uses the same address text
instead of the appropriate unique address text for each individual
marker.
here is the code i use to create the marker and info for sidebar
// A function to create the marker and set up the event window
function createMarker(point,number,html) {
var marker = new GMarker(point, icon);
var html = number;
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
// save the info we need to use later for the sidebar
gmarkers[i] = marker;
htmls[i] = html;
// add a line to the sidebar html
//sidebar_html += '<a href="javascript:myclick(' + i + ')">' +
' <?php echo($lat1);?> ' + '</a><br>';
sidebar_html += '<a href="javascript:myclick(' + i + ')">' + '<img
src="http://labs.google.com/ridefinder/images/mm_20_red.png">' + <?php
echo($address3);?> + '</a><br>';
i++;
return marker;
}
// This function picks up the click and opens the corresponding info
window
function myclick(i) {
gmarkers[i].openInfoWindowHtml(htmls[i]);
}
and here is the code i use to get $address3:
if (!$result3) {
$address3 = 'Enter a zipcode to start';
}
else {
$address3=mysql_result($result3,$i,"address");
}
any idea what i'm doing wrong?
0 Comments:
Yorum Gönder
<< Home