This is what you were talking about?
GDownloadUrl("results.xml", function(data) {
var xml = GXml.parse(data);
var markers =
xml.documentElement.getElementsByTagName("item")[0];
for (var i = 0; i < markers.length; i++) {
var name =
GXml.value(markers[i].getElementsByTagName("name")[0]);
var address =
GXml.value(markers[i].getElementsByTagName("address")[0]);
var type =
GXml.value(markers[i].getElementsByTagName("type")[0]);
var point = new
GXml.value(parseFloat(markers[i].getElementsByTagName("lat")[0]),
parseFloat(markers[i].getElementsByTagName("lng")[0]));
var marker = createMarker(point, name, address, type);
map.addOverlay(marker);
}
The above doesnt work. I've searched the group looking for something
similar but can't find anything.
On Sep 25, 12:51 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> On Sep 25, 9:18 am, racinnation <[EMAIL PROTECTED]> wrote:
>
> > My map is here:http://www.racinnation.com/sandbox/app/map.php
>
> > My xml file is here:http://www.racinnation.com/sandbox/app/results.xml
>
> That xml feed format is entirely different from the one your code is
> looking for. It has the data in elements that are children of item
> elements. Your code getting the attributes of the item elements.
>
> I would suggest you investigate xml parsing.
>
> you will need to change these:
> var name = markers[i].getAttribute("name");
> to:
> var name = GXml.value(markers[i].getElementsByTagName("name")[0]);
>
> -- Larry
>
>
>
>
>
> > This is what my DB looks like:
>
> > CREATE TABLE `markers` (
> > `id` int(11) NOT NULL auto_increment,
> > `name` varchar(60) NOT NULL default '',
> > `address` varchar(80) NOT NULL default '',
> > `lat` float(10,6) NOT NULL default '0.000000',
> > `lng` float(10,6) NOT NULL default '0.000000',
> > `type` varchar(30) NOT NULL default '',
> > `url` varchar(240) NOT NULL default '',
> > PRIMARY KEY (`id`)
> > ) TYPE=MyISAM AUTO_INCREMENT=25 ;
>
> > Any idea what's going on here, I'm not getting any errors.- Hide quoted
> > text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---