Re: drop-down menu and Google Map
**Functions**
function myOpener(i)
{
markers[i].openInfoWindowHtml(infoHtmls[i]);
}
function makeOpenerCaller(i)
{
return function() { myOpener(i); };
}
var listbox = "<form blah blah><select blah blah onChange =
'myOpener(this.value)';>";//create the form's header
**XML connection**{
loop{i=0; i< total data points; i++)
{
markername[i] = respective marker name from xml file;
infoHtmls[i] = "<table><tr><td>markername[i]...etc...";//Create
bubble's contents
listbox += "<option value = 'i'>markername[i]";//add option values for
each marker
GEvent.addListener(markers[i],'click',makeOpenerCaller(i));
map.addOverlay(markers[i]);
}
close .xml connection
}
listbox += "</option></select></form>"; //add the *one* footer to the
form.
document.getElementById('panel').innerHTML = listbox;//adds your final
compiled list box to your map's control panel.
Study the following map to fill in the blanks:
http://www.keepingyouwell.com/map.asp
Hope this leads you on the right track, and keep me informed.
0 Comments:
Yorum Gönder
<< Home