[OpenLayers-Users] VML renderer to do labels as divs not VML rect + textbox

Andreas Hocevar ahocevar at opengeo.org
Thu Jul 28 09:01:24 EDT 2011


Hi,

labels in HTML instead of VML would require some substantial changes. Currently the DOM structure is

layer.div (HTML)
    root (VML)
        geometries (VML)
        text (VML)

For HTML labels, it would have to be

layer.div (HTML)
    geometries (VML)
    text (HTML)

The problem is that the above structure is defined in Renderer.Elements, which is also inherited by the SVG renderers.

Also, drawing labels in HTML means that we will never be able to do text curves and other fancy formatting that VML and SVG allows us.

Andreas.

On Jul 28, 2011, at 14:51 , Janis Elmeris wrote:

> Hello!
> 
> I'm adding Geometry.Points to the map with "label" property in order to display numbers. However, my IE7 cannot deal with more than 100-200 such numbers without slowing down considerably and eventually crashing (whereas FF can do all right even with 3000: using both SVG or Canvas renderer).
> 
> How hard would it be to make the VML renderer to do these label points as "div" elements? Currently they are rendered as VML "textbox" within "rect", which IE apparently process slowly. "div" elements would surely be faster, right?
> 
> I tried to simply replace the "rect" and "textbox" in "drawText" to "div" and "span", but that didn't work: the numbers were positioned oddly while moving the map. In the original VML renderer it seems that "rect" is not changed while moving the map (and I cannot understand why these "rect" are needed at all), but "textbox" changes its margins. I cannot find what is changing them though.
> 
> Regards,
> Janis
> 
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users



-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.



More information about the Users mailing list