[OpenLayers-Dev] #736 (external graphic as style for vector points)

Pierre GIRAUD bluecarto at gmail.com
Fri Jun 1 03:06:13 EDT 2007


This sounds really interresting.
Wouldn't it be nice to have it in a sandbox ? If you don't mind, and
if I find time, I can easily put it in the camptocamp one to see it
working live.

A further step would consist in creating real vector graphics for
point features. Some customers already asked for it.

Regards


On 5/31/07, Andreas Hocevar <andreas.hocevar at gmail.com> wrote:
> Hi,
>
> I have been thinking about how to implement an aspect of OGC Styled
> Layer Descriptors with OpenLayers vector renderers: using an external
> graphic as style for a point.
>
> I came up with a quite simple solution, for which I created a patch
> and an extended vector-features.html example. For now, I only
> implemented it for the SVG renderer, where PNG, JPEG and SVG files can
> be used as external graphic.
>
> The patch is at http://trac.openlayers.org/ticket/736
>
> How it works:
> The setStyle method of the renderer checks for a style property
> "externalGraphic", which contains an URI to a bitmap. If this property
> is set, the original "circle" node is removed from the root node, and
> a new "image" node with the same properties and the required
> attributes is created.
>
> As in the SLD specification, only a size for the bitmap can be
> specified. So external graphics will always be rendered with same
> width and height. For width and height, the existing pointRadius
> property is used.
>
> I would appreciate your comments, and I will gladly implement it for
> VML, too. But I would like to know if the way I did it is the way to
> go, or if there are proposals for a different way.
>
> Regards,
> Andreas Hocevar.
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>



More information about the Dev mailing list