Get the content of that XML element into a string. Note that with the "cap" namespace you will have to write browser independent code (different browsers treat that differently).
split the string on spaces (""):
var coordinates = polygonElemStr.split("");
split each set of coordinates on the comma (","), create a google.maps.LatLng from the two numbers and push it onto an array:
var path = [];for (var i=0; i<coordinates.length; i++) { var coord = coordinates[i].split(","); path.push(new google.maps.LatLng(parseFloat(coord[0]), parseFloat(coord[1])));}
use that array of coordinates to create your polygon.
↧
Answer by geocodezip for Parse coordinates out of XML feed
↧