[OpenLayers-Users] Not change the size o polygons with zoom change

Jose A. C. joscalv at gmail.com
Mon Aug 4 12:18:07 EDT 2008


Hi!

This solution is perfect, but I need to rotate the polygons around their own
center, since the rotate function doesn´t change their inclination, it just
change their position.

The code is:

            features[4].geometry.rotate(30,new
OpenLayers.Geometry.Point(map.maxExtent.left + (4 * slot) + (slot / 2), 0));
            features[4].layer.drawFeature(features[4]);

            features[1].geometry.rotate(30,new
OpenLayers.Geometry.Point(5,5));
            features[1].layer.drawFeature(features[1]);

where features array comes from the example
http://openlayers.org/dev/examples/graphic-name.html.

Thanks!!!

2008/8/1 Christopher Schmidt <crschmidt at metacarta.com>

> On Fri, Aug 01, 2008 at 08:39:54AM +0200, Jose A. C. wrote:
> > I'm making a map, and I need to create polygons on it that don´t change
> its
> > size when the zoom of the map change. I don´t use a mark because I need
> to
> > rotate it.
>
> Sounds like you want this:
>
> http://openlayers.org/dev/examples/graphic-name.html
>
> There's a set of constants in OpenLayers.Renderer.symbol  in
> OpenLayers.Renderer.Elements which you could extend.
>
>
> > I have another problem:  I draw different layers with different units and
> > when it is draw the size of the figure is the same in spite of  having
> > different measures unit (Km and inches). The code is:
>
> The units of the layer have no control over anything. Your units you are
> providing are *map* units -- and the *name* you give to those units is
> irrelevant. What you want to do is change the size of the units. If you
> want to create something that's a different size, you need to provide
> the correct size in current map units. (Your map is probably in
> degrees.)
>
> Regards,
> --
> Christopher Schmidt
> MetaCarta
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080804/042f9b6f/attachment.html


More information about the Users mailing list