On Aug 3, 8:07 am, Great Lakes Science Center Webmaster
<[email protected]> wrote:
> Yes it is! And I didn't realize that Ralph meant that I could use
> that technique in the xml file. That's what I'm doing now. In fact,
> found an example on Mike Williams' page that describes the use of an
> <infowindow> tag with CDATA to hold the html. This is really what I
> wanted to do in the first place but, I was under the impression that I
> couldn't. I'm still having a problem getting the sidebar to display.
> The map is the same as given above.
>
> My xml is now of the form:
>
> <marker lable"*" icontype"*" lat"*" lng"*">
> <infowindow><![CDATA[html stuff for the infowindow]]></infowindow>
> </maker>
This is a typo, should be
</marker>
(it has to match the start tag)
Also, I don't see a top level element in the xml (usually <markers>)
-- Larry
>
> This is how I'm reading the data:
>
> var request = GXmlHttp.create();
> request.open("GET", "../_text/test56.xml", true);
> request.onreadystatechange = function() {
> if (request.readyState == 4) {
> var xmlDoc = GXml.parse(request.responseText);
> // obtain the array of markers and loop through it
> var markers = xmlDoc.documentElement.getElementsByTagName
> ("marker");
>
> for (var i = 0; i < markers.length; i++) {
> // obtain the attribues of each marker
> var lat = parseFloat(markers[i].getAttribute("lat"));
> var lng = parseFloat(markers[i].getAttribute("lng"));
> var point = new GLatLng(lat,lng);
> var html = GXml.value(markers[i].getElementsByTagName
> ("infowindow")[0]);
> var label = markers[i].getAttribute("label");
> var icontype = markers[i].getAttribute("icontype");
> // create the marker
> var marker = createMarker(point,label,html,icontype);
> map.addOverlay(marker);
> }
>
> I end up getting a 'documentElement is null or not an object' when I
> load the page. I suspect the line that reads the infowindow tags is
> the problem but I don't know why.
>
> On Jul 31, 4:38 pm, Garthan <[email protected]> wrote:
>
>
>
> > CDATA are life savers.... encoding html and similar any other way is
> > just painful.
>
> > On Jul 31, 1:03 pm, Ralph Ames <[email protected]> wrote:
>
> > > It's also possible to put your HTML in a tag
> > > <html><![CDATA[......................]]></html>
>
> > > Ralph- Hide quoted text -
>
> > - Show quoted text -- 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
-~----------~----~----~----~------~----~------~--~---