# Add a pin with lattitude and longitude values

**URL:** <https://mapwindow.discourse.group/t/add-a-pin-with-lattitude-and-longitude-values/1679>\
**Category:** Uncategorized\
**Created:** [December 4, 2023, 5:03pm UTC](https://mapwindow.discourse.group/t/add-a-pin-with-lattitude-and-longitude-values/1679 "2023-12-04T17:03:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![clemguid](https://avatars.discourse-cdn.com/v4/letter/c/73ab20/32.png) [@clemguid](https://mapwindow.discourse.group/u/clemguid)\
**Post date:** [December 4, 2023, 5:03pm UTC](https://mapwindow.discourse.group/t/add-a-pin-with-lattitude-and-longitude-values/1679/1 "2023-12-04T17:03:52Z")

</div>

Hi,

I want to add a pin when clicking on a button from gps coordinates. And I want this pin to stay even if I zoom on the map.  
Unfortunately, I tried lots of methods and it 's not working.  
Could you help me please 🙂

Here is my whole code :  
namespace InterfaceProjetBateau  
{  
public partial class Form1 : Form  
{  
private System.Windows.Forms.Timer timer;

```
    public Form1()
    {
        InitializeComponent();

        // Timer 1s (pour maj date)
        timer = new System.Windows.Forms.Timer();
        timer.Interval = 1000;
        timer.Tick += Timer_Tick;
        timer.Start();
    }

    private void Timer_Tick(object sender, EventArgs e)
    {
        // À chaque tic du minuteur, mettez à jour la date
        Afficher_date();
    }

    private void Afficher_date()
    {
        // Obtenez la date actuelle
        DateTime currentDate = DateTime.Now;

        // Formattez la date selon votre besoin
        string date = currentDate.ToString("dddd d MMMM yyyy H'h'mm'm'ss's'");

        // Mettez à jour le texte de textBox_date
        textBox_date.Text = date;
    }

    private void button1_Click(object sender, EventArgs e)
    {
    
    }

    private void textBox1_TextChanged(object sender, EventArgs e)
    {
        
    }

    private void button1_Click_1(object sender, EventArgs e)
    {

    }

    private void button_alert_page_Click(object sender, EventArgs e)
    {
        Alertes Defauts_form = new Alertes();
        Defauts_form.Show();
    }

    private void gMapControl1_Load(object sender, EventArgs e)
    {
        

    }

    private void Form1_Load(object sender, EventArgs e)
    {
        axMap1.Latitude = 47.2535f;
        axMap1.Longitude = -1.372f;
        axMap1.CurrentZoom = 17;
    }

    private void axMap1_MouseDownEvent(object sender, AxMapWinGIS._DMapEvents_MouseDownEvent e)
    {

    }

    private void button1_Click_2(object sender, EventArgs e)
    {
        axMap1.Latitude = 47.2535f;
        axMap1.Longitude = -1.372f;
        axMap1.CurrentZoom = 17;
      
    }

    private void pictureBox2_Click(object sender, EventArgs e)
    {

    }

    private void button1_Click_3(object sender, EventArgs e)
    {
        axMap1.Latitude = 47.24837422208973f;
        axMap1.Longitude = -1.5496057119673134f;
        axMap1.CurrentZoom = 18;
        
    }

    private void button2_Click(object sender, EventArgs e)
    {
       //Add a pin at : lattitude = 47.25, longitude = -1.55

    }
}

```

}
