Draw a circle
Comments
-
In the SDK you just have to do the math yourself to generate a list of XY coordinate values to form the ellipse or circle, then create a new line or area feature based on those and add it to your custom vector layer.
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com -
Thanks. The pseudocode is as follows
for(i = 0 to 49)
Take x = (i / 50) * radius
Compute y value ( y = sqrt(r*r - x*x)
Add (x,y) 1st Quadrant
Add (y,-x) 2nd Quadrant
Add (-x,-y) 3rd Quadrant
Add(-y, x) 4th Quadrant
next i
Offset all points by centre -
Hi Mike,
I am working on a project that creates a number of rings with a same center point and move the rings around the map all the time.
I am using the similar method that Osei suggested to create the rings. I calculate the coordinate of all the points on the rings and draw the rings, and recalculate the entire coordinate of points when move the rings.
Is there any SDK function which is similar to the ‘Create Range Ring(s)…” function in the Global Mapper application?
The SDK function takes 4 parameters, number of Range Rings, Range Ring Radius, the unit of the Range Ring Radius, and the center point of the ring(s) to draw the rings with the same center point. Also the scale of those rings can fit to the projection of map when they move.
Cheers
Dilys -
Dilys,
While there is not currently a method like you describe to create a range ring, you could easily generate your own range ring by using the GM_CalcProjectedLocation function. Just call that function for a series of bearing values (say every 1 degree around a circle) to get a list of points forming your range ring, then create the area or line feature with the GM_AddAreaToVectorLayer or GM_AddLineToVectorLayer functions.
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com
Categories
- 12.7K All Categories
- 5.6K Features Discussion
- 342 Downloading Imagery
- 1.3K Elevation Data
- 380 Georeferencing Imagery Discussion
- 628 GM Script Language
- 53 User Scripts
- 113 GPS Features
- 414 Projection Questions
- 819 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 177 Announcement and News
- 908 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 562 Other Discussion
- 129 GIS Data Sources
- 27 Global Mapper Showcase
- 233 How I use Global Mapper
- 107 Global Mapper Forum Website