How to draw a circle in MapwinGIS

Hi, I am using MapwinGIS version 5. I tried very hard to draw a circle but I could not. Can anyone help me draw a circle?

Dear mr.x,

here is a form post about it. But since you gave very few details, (like for example the programming language you are using or, what you tried to do till this point), it is quite hard to help you for now.

Kind regards,

Rem

The language I use is C #
My problem was solved, but now I have another problem because the circle is always at the top of the map
I want a circle like shape that is in a fixed position

is there any code to change the circle settings?
Untitled

Dear mr.x,

sorry, I see I did not post the link in my last message, so here you go:
Link

To get the circle at a fixed position it is an option to use *** DrawCircleEx*** which gives you an option to add coordinates.
Another option is to draw a point on a drawing layer (you might need a shapefile for this. Not sure, never tried it without one). This way you can call the “axMap1.DrawCircle” again and let it draw a circle with the right attributes there. Make sure you call the layer handle of the drawing layer and then the “axMap1.DrawCircle”.

As you see the second one is a bit more ambitious but depending on your needs it might be better to draw points first at fixed positions.

Hope this helps you a bit. If you need some help with the code then let me know. Atm im not able to quicky fetch something. But later this week I can :slight_smile:

Kind regards,

Rem

        private void axMap1_MouseDownEvent(object sender, _DMapEvents_MouseDownEvent e)
        {
            int draw_hndl;
            draw_hndl = axMap1.NewDrawing(tkDrawReferenceList.dlScreenReferencedList);
            axMap1.DrawCircleEx(draw_hndl, e.x, e.y, 50, Convert.ToUInt32(ColorTranslator.ToOle(Color.Red)), true);

        }

I used DrawCircleEx but it did not change, did I write the code I used? Is there a problem?
You can see the result of the above codes below them

Form1 2021-06-12 13-41-43_Trim

Hello
I want to calculate the distance between the two icons on the map, without drawing a line. Please help me in this regard.
Untitled

Hello
I want to show the angle between two icons by drawing a line on the map. It is exactly like the map ruler, but instead of calculating the kilometer, show us the angle. Thank you.
Untitled

Hello
I want to show me a message box when I click on the icon on the map.
Thank you.

Hello
I want to display the offline map of a city or country like google map in the application. Please help me to implement the offline map.

Dear mr. x,

sorry for my late reply. I havn’t catched up for a while for reasons.

Please tell me what you could get work and what you are still working on/need help with. Please add details so I can help you from there on.

In the first issue/question I see you do not get a red circle all the time, correct? As far as I can see at the moment the code looks good.
Maybe the map does not redraw asap after the function is finished. So you could try to force a redraw. This can be done by adding it into a button function as shown in this example:

private void Function_Click(object sender, EventArgs e) //called via a button.
{
AxMap.Redraw2
}

Another question that raised within me was how the _MouseDownEvent is handled when using it directly in a function (like a private void). It should not matter as far as I see. But maybe MapWinGis handles “_MouseDownEvent” a little different so worth trying.

I normally call those functions via a delegate.
Example:

axMap1.MouseDownEvent += FunctionToBeCalled.

 public void FunctionToBeCalled(object sender, AxMapWinGIS._DMapEvents_MouseDownEvent e)
{
//code
}

Via your way of directly calling the function I cannot seem to use the _MouseDownEvent to call a function. So maybe you can try via a delegate to neglect the possibility of that this is the potential error?

I’m also not 100% sure at this point in time or the parameter of “axMap1.NewDrawing( this )” is correct to use the DrawReferenceList.dlScreenReferencedList.

More questions then answers maybe. But please try and see or one of the above two options could cause the error. If not we might have to check or “dlScreenReferencedList” is the correct parameter to call.

Kind regards,

Rem