[OpenLayers-Dev] [OpenLayers-Trac] [OpenLayers] #736: external graphic as style for vector points

Andreas Hocevar andreas.hocevar at gmail.com
Thu Jun 7 05:18:24 EDT 2007


Hi,

On 6/7/07, Andreas Hocevar <andreas.hocevar at gmail.com> wrote:
> On 6/7/07, Christopher Schmidt <crschmidt at metacarta.com> wrote:
> > On Wed, Jun 06, 2007 at 11:35:17PM -0400, Stephen Woodbridge wrote:

> > I kind of liked 'image' until I realized it could actually be an svg
> > file, at which point graphicWidth/graphicHeight seemed to make more
> > sense.

Yes, the only sad thing about it is that svg files will only work on
browsers that have svg vector rendering.

> > > If one is set then the other
> > > is computed based on the apsect ratio, if both are set then the image is
> > > stretched to fit.
>
> That is exactly what I implemented now.

Well, not exactly. There is no easy way to determine the original
width and height of the image on the client. This means that the
bounding rectangle of the image will never be larger than the
specified height or width.

So setting just graphicWidth or graphicHeight is the same as setting
pointRadius, only that pointRadius is multiplied by 2 to determine the
size.

> > I'm not sure that this is possible, but it does seem like the best
> > possibility. Andreas, can you comment on the technical feasability of
> > this? I assume like an <img /> tag that the graphic will scale to fit if
> > it's marked with a size in one direction.

Yes, it will scale to fit into a square bounding box with the size
specified by graphicWidth or graphicHeight.

Regards,
Andreas.



More information about the Dev mailing list