Re: Sidebar Html
Ah, you want to add the stuff to the sidebar first. Not only when you
click on a marker. I think? I'm still not sure what "make it
clickable" means. What does the _it_ refer to (the marker or the text
in the sidebar?
Substitute this code into your program, note I have only added three
lines (one at the beginning, end, one in between) plus a couple
comments. This will get your text in the sidebar, which is at least a
start.
var MarkerSideHtml = "";
for (var i=0; i < markers.length; i++) {
var color= markers[i].getAttribute("icon");
addMarker(parseFloat(markers[i].getAttribute("lng")),
parseFloat(markers[i].getAttribute("lat")),
markers[i].getAttribute("title"), color);
// append title and line break to string
MarkerSideHtml
MarkerSideHtml += markers[i].getAttribute("title")
+ "<br />";
// since all the markers are loaded by default, make sure all the
boxes are checked
document.getElementById(color).checked=true;
}
// now write the data to the sidebar.
document.getElementById("sidebar").innerHtml= MarkerSideHtml;
0 Comments:
Yorum Gönder
<< Home