I am trying to create some tabbed windows and I am lost in my xml
tree.
XML looks like
<markers>
<marker lat="51.50543" lng="-0.18093" created_by_id="1"
sample_id="1">
<tab>
<label>Soil</label>
<contents>
<entered_attribute attribute_name="site"
attribute_value="parkland"/>
<entered_attribute attribute_name="pH" attribute_value="pH6"/>
<entered_attribute attribute_name="texture"
attribute_value="sandy_loam"/>
</contents>
</tab>
<tab>
<label>Worms</label>
<contents>
<entered_attribute attribute_name="1" attribute_value="Black
worm"/>
<entered_attribute attribute_name="1" attribute_value="Green worm"/
>
</contents>
</tab>
</marker>
<marker>
...etc
</marker>
</markers>
I can get the points correctly, and the tabs and labels to show up but
can't for the life of me get the tab contents into the tabs. The code
I have which 1/2 works is as follows
<code>
for (var i = 0; i < markers.length; i++) {
var point = new GLatLng(parseFloat(markers[i].getAttribute
("lat")),parseFloat(markers[i].getAttribute("lng")));
tabInfo = markers[i].getElementsByTagName("tab");
tabs = new Array();
for (var j = 0; j < tabInfo.length; j++) {
var tabLabel = GXml.value(tabInfo[j].getElementsByTagName("label")
[0]);
var tabHtml = GXml.value(tabInfo[j].getElementsByTagName
("contents")[0]);
tabs.push(new GInfoWindowTab(tabLabel,tabHtml));
}
</code>
even
var tabHtml = GXml.value(tabInfo[j].getAttribute
("entered_attribute"));
doesn't seem to work
thanks
Sorry I can't post map for viewing yet cause its behind a firewall.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---