I'm trying to make a map that has a large text box for multiple
address entry. The user clicks submit then the map loads the correct
points. I want a clickable side bar to be created under the map with
the addresses that the user put in.
I used the code from Mike Williams. It works fine if the i have the
points hard coded. I feel like its something were the page needs to
refresh or something along those lines?
//steps through user input for geocoder
function showAddressList(address) {
var rows = address.split("\n");
for (i = 0; i < rows.length; ++i) {
showAddress(rows[i]);
}
}
//geocode
function showAddress(address) {
if (geocoder) {
geocoder.getLatLng(address, function(point) {
if
(!point) {
alert(address + " not found");
} else {
createMarker(point, address,
address);
}
});
}
}
// plots the marker
function createMarker(point,name,html) {
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
map.addOverlay(marker);
marker.openInfoWindowHtml(html);
gmarkers.push(marker);
side_bar_html += '<a href="javascript:myclick(' +
(gmarkers.length-1) + ')">' + name + '<\/a><br>';
return marker;
}
//supposed to create the side bar
document.getElementById("side_bar").innerHTML = side_bar_html;
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---