Quantcast
Channel: Google Map Api v3 and XML feed - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Answer by geocodezip for Google Map Api v3 and XML feed

$
0
0

The Google Maps Javascript API v3 does not contain any XML parsing. But you can parse XML with javascript and display the results on a Google Maps Javascript API v3 map.

Your code currently parses XML of this format:

<Deal Latitude="38.989869999999996" Longitude="-110.13261" Deal_ID="201090531" Price="9.50" />

function from geoxml3 that returns the text content of an element (like <lat>):

//nodeValue: Extract the text value of a DOM node, with leading and trailing whitespace trimmedgeoXML3.nodeValue = function(node, defVal) {  var retStr="";  if (!node) {    return (typeof defVal === 'undefined' || defVal === null) ? '' : defVal;  }   if(node.nodeType==3||node.nodeType==4||node.nodeType==2){      retStr+=node.nodeValue;   }else if(node.nodeType==1||node.nodeType==9||node.nodeType==11){      for(var i=0;i<node.childNodes.length;++i){         retStr+=arguments.callee(node.childNodes[i]);      }   }   return retStr;};

relevant discussion from the Google Maps Javascript API v2 group (but v3 doesn't have the GXml functionality).

another relevant discussion


Viewing all articles
Browse latest Browse all 2

Trending Articles