Beispiel #1
0
        private void cbContrib_CheckedChanged(object sender, EventArgs e)
        {
            DataTable dtMapPin = new DataTable();

            BusinessLayer.MapPin MapList = new BusinessLayer.MapPin();

            int t = 1;

            dtMapPin = MapList.getMapPinByType(t);

            GMapOverlay mark = new GMapOverlay(gMapControl1, "mark");

            if (cbContrib.Checked)
            {
                for (int j = 0; j < dtMapPin.Rows.Count; j++)
                {
                    int m = Convert.ToInt32(dtMapPin.Rows[j]["CategoryID"]);

                    if (m == 2)
                    {
                        double x = Convert.ToDouble(dtMapPin.Rows[j]["XLOC"]);
                        double y = Convert.ToDouble(dtMapPin.Rows[j]["YLOC"]);
                        mark.Markers.Add(new GMap.NET.WindowsForms.Markers.GMapMarkerGoogleRed(new PointLatLng(x, y)));
                    }

                    //tell the map to add the overlay
                    gMapControl1.Overlays.Add(mark);
                }
            }
            else
            {
                gMapControl1.Overlays.Clear();

            }
        }
Beispiel #2
0
        private void cbContrib_CheckedChanged(object sender, EventArgs e)
        {
            DataTable dtMapPin = new DataTable();

            BusinessLayer.MapPin MapList = new BusinessLayer.MapPin();

            int t = 1;

            dtMapPin = MapList.getMapPinByType(t);

            GMapOverlay mark = new GMapOverlay(gMapControl1, "mark");

            if (cbContrib.Checked)
            {
                for (int j = 0; j < dtMapPin.Rows.Count; j++)
                {
                    int m = Convert.ToInt32(dtMapPin.Rows[j]["CategoryID"]);

                    if (m == 2)
                    {
                        double x = Convert.ToDouble(dtMapPin.Rows[j]["XLOC"]);
                        double y = Convert.ToDouble(dtMapPin.Rows[j]["YLOC"]);
                        mark.Markers.Add(new GMap.NET.WindowsForms.Markers.GMapMarkerGoogleRed(new PointLatLng(x, y)));
                    }

                    //tell the map to add the overlay
                    gMapControl1.Overlays.Add(mark);
                }
            }
            else
            {
                gMapControl1.Overlays.Clear();
            }
        }