• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to get all attributes of a tag in an XML document using javascript?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have an xml file of the form:

etc...

I already have my program (mixture of JSP and javascript/ajax) able to retrieve all the latitude and longitude points from the XML file:


I've written other code using the Google Maps API to use these points to plot "polylines" onto the map. My question is how would I be able to only colour in, say, the points for bumper1 or bumper2? But not all. So when I call the GPolyline function for bumper1 or bumper2 etc, it will only plot the points for the intended tag. Currently it plots a Polyline for all the co-ordinates in a single colour.

I would need to store the lat/long points for these in some sort of an array and simply pass it to map.addOverlay(new GPolyline([b]pts,colour,width));[/b] is my understanding (Like: new GPolyline(some statement corresponding to all the points for bumper1, colour, width) ). Can someone please shed some light on this for me?

Thanks!
 
No. No. No. No. Changed my mind. Wanna come down. To see this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic