Re: logic in my sidebar code is off
It is because the createMarker function has php inside of it. You want
to pass the address in by the call. There is only one create marker
call, and if you look at the resulting page (below) it has "644 EARP"
hard coded into it.
I'm not sure I understand the createMarker function, you pass point,
number and html in to it, then overwrite html with number...
-- Larry
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 + ')">' +
'<img src="http://labs.google.com/ridefinder/images/mm_20_red.png">' +
'644 EARP' + '</a><br>';
i++;
return marker;
}
0 Comments:
Yorum Gönder
<< Home