Topic: How to Rotate Drawings??

Hi, I wanted to know if I can rotate my drawings. I have made an Ellipse and wanted to rotate it in any degree, is there any tools in OnlineMaps for that function??

For now I tried using this code but it didn't work as intended

        for(int i = 0; i < segments; i++)
        {
            var heading = (step * i) * OnlineMapsUtils.Deg2Rad;
            var px = (r * Math.Cos(heading)) + tx1;
            var py = (r / 2 * Math.Sin(heading)) + ty1;

            var ang = angle * OnlineMapsUtils.Deg2Rad;
            var cos = Math.Cos(ang);
            var sin = Math.Sin(ang);

            px = (px * cos) - (py * sin);
            py = (px * sin) + (py * cos);
            
            map.projection.TileToCoordinates(px, py, 20, out lng, out lat);
            points.Add(new Vector2((float)lng, (float)lat));
        }

Re: How to Rotate Drawings??

Hello.

var heading = (step * i + someDegreeOffset) * OnlineMapsUtils.Deg2Rad;
Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

3 (edited by moonflow123 2022-08-04 02:00:36)

Re: How to Rotate Drawings??

Thanks! One more thing, is there any way to adjust the drawings height??

For now I am using the transform.position. But if there is a way to adjust the height via Onlinemaps, I'll be happy to listen!!


*Update: it didn't change the angle of the drawing in any way. if i also use the

 var ang, var cos, var sin 

it will teleport outside the map and also became a line

Re: How to Rotate Drawings??

There is no way to adjust the height here.
You can work around this by taking a drawing container or drawing instance and increasing transform.position.y.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.