Hi!
Thank you for the quick and good pointers. First of all, i hereby post the current result, so i can help people with the same question.
But i am still not 100% happy with the current rotation, since the fov marker (currently 2 lines), still dance around the rotation point(don't stay at the same point), and i would like to make a circle at the end of the line's to give a better impression of a view port. Since i really want to use the viewport angle, i don't know how a image can help me with this.
Please let me know if someone has some good thoughts about this,...
<code>
Init:
// fov
_fovlayer = new FeatureLayer("Fov");
_fovlayer.projection = new ProjProjection("EPSG:4326");
_fovlayer.generateResolutions(19);
_fovlayer.style = Style.getDefaultPointStyle();
var location:Location = new Location(5.916667, 51.983333,new ProjProjection("EPSG:4326"));
_fovMarker = new Sprite();
_fovMarker.graphics.lineStyle(2.0, 0x00FF00, 0.0);
_fovMarker.graphics.drawRect(0.0, 0.0, 40.0, 40.0);
_fov = CustomMarker.createDisplayObjectMarker(_fovMarker, location);
_fovlayer.addFeature(_fov);
_map.addLayer(_fovlayer, false, true);
Rotation / Zoom:
var lonlat:Location = new Location(MY_LONGITUDE, MY_LATITUDE, new ProjProjection("EPSG:4326"));
var mappoint:Location = lonlat.reprojectTo(_map.baseLayer.projection);
_fovMarker.graphics.clear();
_fovMarker.graphics.lineStyle(2.0, 0xFF0000, 1.0);
var fov:Number = MY_FOV;
var yaw:Number = MY_YAW;
var startAngle:Number = yaw + 90 + (180 - fov / 2);
var endAngle:Number = yaw + 90 + (180 + fov / 2);
var size:Number = 20;
var startX:Number = 20 + size * Math.cos(Math.PI * startAngle / 180.0);
var startY:Number = 20 + size * Math.sin(Math.PI * startAngle / 180.0);
var endX:Number = 20 + size * Math.cos(Math.PI * endAngle / 180.0);
var endY:Number = 20 + size * Math.sin(Math.PI * endAngle / 180.0);
_fovMarker.graphics.moveTo(20, 20);
_fovMarker.graphics.lineTo(startX, startY);
_fovMarker.graphics.moveTo(20, 20);
_fovMarker.graphics.lineTo(endX, endY);
_fov.point.x = mappoint.x;
_fov.point.y = mappoint.y;
_fovlayer.redraw(true);
</code>
Regards,
Eduard