[OpenLayers-Users] Re: My SVG tags don't display in FF; VML's fine in IE

myOpenLayersUName joanne.mcgraw at SYMPATICO.CA
Tue Apr 12 12:56:30 EDT 2011


Here's what I've learned so far about this...sorry if I'm not saying this
correctly; it's all new to me.

SVG cannot be written as HTML and displayed in a browser that does not
support XHTML without an xhtml extension. Unfortunately, that includes FF3,
which is one of the browsers we are obliged to support and the one where my
example page above is failing (I didn't realize that was important when I
posted previously). I tried changing my test page's extension to xhtml,
after encompassing the contents of the script tag with the CDATA tags as
described at https://developer.mozilla.org/en/Writing_JavaScript_for_XHTML,
to deal with the special XML characters (like < in a for loop). It worked
fine in FF3; so that's definitely the problem I'm having.

So, now I have a different question. 

Instead of putting the SVG tags, etc. into the ExtJs panel's HTML as I was
doing in my example, I'm thinking I could just add a DIV with a unique id
there instead. Then, after that panel has been rendered, I could create the
ExtJs panel that actually contains the legend icon (with the OpenLayers
Renderer, etc.). Finally, I could use getElementById to get the DIV that is
in the rendered HTML and appendChild the panel I just built with the legend
icon in it. 

My question is, how do I do that last part? Or even, can I do that last
part?

Assuming the previously supplied example, after the mainWestPanel.doLayout()
line, if I have something like:


var div = document.getElementById(uniqueId);
var p = this.addLegendItem(0);


How do I get the contents of p into div? I can't just div.appendChild(p);
and I can't div.appendChild(p.getEl()); because the object's just been
initialized. Does anyone know how I would go about this last part?


--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/My-SVG-tags-don-t-display-in-FF-VML-s-fine-in-IE-tp6251814p6265889.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list