/// <summary> /// Adds an overlay item /// </summary> /// <param name="item"></param> public void AddOverlayItem(OverlayItem item) { if (item == null) { return; } overlayItems.Add(item); renderMap(); }
private void button1_Click_1(object sender, EventArgs e) { OverlayItem item = new OverlayItem(); item.Coord = new PointF(float.Parse(tbClickedLng.Text), float.Parse(tbClickedLat.Text)); Bitmap b = new Bitmap(64, 64); Graphics g = Graphics.FromImage(b); Pen pen = new Pen(Color.Black, 3.0f); g.Clear(BackColor); g.DrawLine(pen, new Point(1, 1), new Point(62, 1)); g.DrawLine(pen, new Point(1, 1), new Point(31, 62)); g.DrawLine(pen, new Point(62, 1), new Point(31, 62)); g.Dispose(); item.Icon = b; item.Offset = new Point(31,64); item.ToolTip = "Test"; item.Transparent = BackColor; openStreetMapViewer1.AddOverlayItem(item); }
/// <summary> /// Removes the given overlay item /// </summary> /// <param name="item"></param> /// <returns></returns> public bool RemoveOverlayItem(OverlayItem item) { return overlayItems.Remove(item); }
/// <summary> /// Adds an overlay item /// </summary> /// <param name="item"></param> public void AddOverlayItem(OverlayItem item) { if (item == null) return; overlayItems.Add(item); renderMap(); }
/// <summary> /// Removes the given overlay item /// </summary> /// <param name="item"></param> /// <returns></returns> public bool RemoveOverlayItem(OverlayItem item) { return(overlayItems.Remove(item)); }