I would like to rotate externalGraphic using mouse something like this URL.
In this URL polygon is used to rotate it but I want an image to be rotated using external graphics tag.
Any help is appreciated.
graphopenlayers-2
I would like to rotate externalGraphic using mouse something like this URL.
In this URL polygon is used to rotate it but I want an image to be rotated using external graphics tag.
Any help is appreciated.
Best Answer
Maybe this one is a better example, and I'm afraid
transformFeature
control is not the right tool to do this job because it can only change the geometry of the feature butexternalGraphic
is a style property, which can only apply to a point feature. And another style property you need to use isrotation
. So you have to write your own logic by using javascript, probably creating a new custom openlayers control. However, the logic is quite straightforward so you won't need to write a lot of codes. You will need a custom control like the following one, note this code is not guaranteed to work in your application, you may improve it at some point to make it work with your application.