[OpenLayers-Dev] Developement of an external vector symbol library

Barbara Philippot barbara.philippot at camptocamp.com
Thu Oct 18 11:29:21 EDT 2007


We are trying to improve vector rendering for points geometry, allowing
users to display symbols such as a square, a triangle, a plane, a church
and so on instead of just a circle.

At present, we have a library in SVG (using the <symbol> element) and a
library in VML (using the <shapetype> element). Symbols are loaded when
the root element <svg> (or <div> in VML) is created, and when the
drawPoint function is called with a specific style for the point, it
references the specified symbol with <use href=#symbol> in SVG and
<shape type=#symbol> in VML.


We are thinking about creating a single library, in order to be generic
and so that people can add their own symbols in one file and not both
SVG and VML.

Problems we meet are :

- We  would need to draw complex symbols. SVG <symbol> element allows it
since several <path> or predefined <shape> can be included inside but in
VML, the <shapetype> element isn't so permissive since we can't include
several shapes or groups of elements inside. So only simple symbols (one
shape, color, stroke-width, etc) would be allowed...

- which language is better to write the single library : SVG since SVG
symbols are quite spread on the web (with problem above in mind) or
javascript to have a generic way to encode symbols, or another language?

- A single library involves to develop a way to transform SVG into VML
or a certain language into SVG and VML, and there are significant
differences between the two (shapetype vs symbol, path element accepting
decimal numbers in SVG and not in VML, etc)

Any ideas about these problems?

So do you think it's worth it or offering predefined symbols and letting
people adding their code into SVG library and VML library would be



More information about the Dev mailing list