I'm a green javascript newbie, but I have passion:-) I am trying to get the values of my ListView elements into an array. The values cam e from my database. I feel that I'm almost there. This is what I have so far;
var locationDB;
var locationAry = [];
var startRectangle;
var viewBoundaries;
//clear sidebar entries
sbar.innerHTML = '';
if (data.documentElement == null) {
clearMap('No results found. Please try widening your search area.');
return;
}
// fetch locations returned by database
locationDB = data.documentElement.getElementsByTagName('marker');
if (locationDB.length == 0) {
clearMap('No results found. Please try widening your search area.');
return;
}
// loop through found locations in the database
for (var i = 0; i < locationDB.length; i++) {
var locationid = locationDB[i].getAttribute('LocationId');
var healthCenterName = locationDB[i].getAttribute('CenterName');
var typeofCenter = locationDB[i].getAttribute('TypeofCenter');
var address = locationDB[i].getAttribute('Address');
var city = locationDB[i].getAttribute('City');
var state = locationDB[i].getAttribute('State');
var zipCode = locationDB[i].getAttribute('ZipCode');
var phone = locationDB[i].getAttribute('PhoneNumber');
var url = locationDB[i].getAttribute('Website');
var services = locationDB[i].getAttribute('PatientServices');
var srid = locationDB[i].getAttribute('SRID');
var distance = parseFloat(locationDB[i].getAttribute('DistanceMiles'));
var location = new Microsoft.Maps.Location(parseFloat(locationDB[i].getAttribute('Lat')), parseFloat(locationDB[i].getAttribute('Long')));
// push location to array for later use for map viewing
locationAry.push(location);