[OpenLayers-Users] Rotation in style causes error

Andreas Hocevar ahocevar at opengeo.org
Fri Apr 8 14:03:49 EDT 2011


What version of OpenLayers are you using? This issue should be fixed in
trunk.

Regards,
Andreas.

On Apr 8, 2011 5:16 PM, "Chris Foulston" <chris at onebrightspace.com> wrote:

Hi all,

I'm using a style with a rotation as my hover effect for features on my map
but am having some problems with IE7.

If I do not declare a rotation in my default style IE errors when the hover
ends after rotating the pin. Therefore I put a "rotation: 0" in the default
style which fixes this issue. Now unfortunately my other geometries (lines,
polygons) error with any mention of rotation. I thought rotation was only
meant to affect points but this does not seem to be the case with IE7. Any
ideas to get round this and still use rotation.

To get around this I was going to write a style rule based on the features
geometry type but after looking at various tickets I'm not sure this is
possible?

Here's my offending code - any suggestions much appreciated.

new OpenLayers.StyleMap({
            "default": new OpenLayers.Style(OpenLayers.Util.applyDefaults({
                externalGraphic: "/resources/images/icons/${icon}.png",
                graphicWidth: 26,
                graphicHeight: 32,
                graphicOpacity: 1,
                graphicXOffset: -13,
                graphicYOffset: -32,
                fillColor: "#6CD0C7",
                strokeColor: "#264396",
                strokeWidth: 3,
                rotation: 0
            }, OpenLayers.Feature.Vector.style["default"])),
            "select": new OpenLayers.Style(OpenLayers.Util.applyDefaults({
                rotation: 10
            }, OpenLayers.Feature.Vector.style["select"]))
        });


Thanks,
Chris

_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110408/788255e8/attachment-0001.html


More information about the Users mailing list