Hello! Tell me, please, what I am doing wrong. If I specify a marker with manually entered coordinates, it is displayed on the map, and if I receive from the database, nothing is displayed. It does not matter how many markers are created, one or many.

GMapOverlay markers=new GMapOverlay("markers"); DateTime dnow = DateTime.Now.AddSeconds(-30); System.Data.DataTable dt = cb.GetData(dnow); Bitmap imag = Bitmap.FromFile(Application.StartupPath + @"\marker_red.png") as Bitmap; //for (int i=0;i<dt.Rows.Count;i++) //{ double lat = double.Parse(dt.Rows[i].ItemArray[1].ToString()); double lng = double.Parse(dt.Rows[i].ItemArray[2].ToString()); GMap.NET.WindowsForms.Markers.GMarkerGoogle mar = new GMap.NET.WindowsForms.Markers.GMarkerGoogle(new GMap.NET.PointLatLng(49.9920, 36.23122), imag); //GMap.NET.WindowsForms.Markers.GMarkerGoogle markerG = new GMap.NET.WindowsForms.Markers.GMarkerGoogle(new GMap.NET.PointLatLng(lat, lng), imag); markers.Markers.Add(mar); //} gMapControl1.Overlays.Add(markers); 

Closed due to the fact that off-topic participants Grundy , Vadim Ovchinnikov , user194374, αλεχολυτ , fori1ton Jan 18 '17 at 14:48 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - Grundy, Vadim Ovchinnikov, Community spirit, αλεχολυτ, fori1ton
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • 3
    And can you see in the debugger what you get in the lat and lng front after double.Parse and let us know? - koks_rs

1 answer 1

The question is removed. The problem is incorrect data from the database.

  • So delete the question, since the reason is not related to the source data in question. - Vadim Ovchinnikov