private void addLabelPointBus(GMapMarker theMarker, Bus theMioBus) { Line ruta = ((Line)(laVentana.theMio.lineInfo[theMioBus.lineId])); if (ruta != null) { Operational TheOp = ((Operational)(laVentana.theMio.operationalInfo[theMioBus.busId + " " + theMioBus.tripId])); if (TheOp != null) { int time = TheOp.desviationTime; theMarker.ToolTipText = $"ID: {theMioBus.busId}, \nRuta: {ruta.shortName}, \nDesc: {ruta.description}, \nTiempo de Desviación: {laVentana.theMio.getTimeDeviation(time)}"; } else { var rand = new Random(); int num = rand.Next(-20, 20); theMarker.ToolTipText = $"ID: {theMioBus.busId}, \nRuta: {ruta.shortName}, \nDesc: {ruta.description}, \nTiempo de Desviación: {laVentana.theMio.getTimeDeviation(num)}"; } } else { theMarker.ToolTipText = $"ID: {theMioBus.busId}"; } GMapToolTip theTip = new GMapToolTip(theMarker); theTip.Fill = new SolidBrush(Color.White); theTip.Foreground = new SolidBrush(Color.Blue); theMarker.ToolTip = theTip; }
public AddSkladiste(int id) { InitializeComponent(); this.AutoValidate = AutoValidate.Disable; HttpResponseMessage response = skladisteService.GetResponseID(id); skladiste = response.Content.ReadAsAsync <Skladista>().Result; map.DragButton = MouseButtons.Left; map.MapProvider = GMapProviders.GoogleMap; map.Position = new PointLatLng(Convert.ToDouble(skladiste.Longitude), Convert.ToDouble(skladiste.Latitude)); map.MinZoom = 3; map.MaxZoom = 95; map.Zoom = 15; skladisteID = id; if (response.IsSuccessStatusCode) { HttpResponseMessage response1 = skladisteService.GetResponse(); List <Skladista> skladiste1 = response1.Content.ReadAsAsync <List <Skladista> >().Result; if (response1.IsSuccessStatusCode) { marrkers = new GMapOverlay("Markeri"); foreach (var x in skladiste1) { PointLatLng novi = new PointLatLng(Convert.ToDouble(x.Longitude), Convert.ToDouble(x.Latitude)); GMarkerGoogle marker = new GMarkerGoogle(novi, GMarkerGoogleType.blue_dot); marker.ToolTipText = $"Naziv skladišta: {x.Adresa}, \n " + $"Longitude: {x.Latitude}, \n " + $"Latitude: {x.Longitude}, "; var tooltip = new GMapToolTip(marker); tooltip.Fill = new SolidBrush(Color.DarkBlue); tooltip.Foreground = new SolidBrush(Color.White); tooltip.Offset = new Point(40, -20); tooltip.Stroke = new Pen(new SolidBrush(Color.Red)); marker.ToolTip = tooltip; if (x.SkladisteID == id) { selektovaniMarker = marker; } marrkers.Markers.Add(marker); } map.Overlays.Add(marrkers); } else { } brojacKlik++; LoadDate(); } else { MessageBox.Show("Error code : " + response.StatusCode + Environment.NewLine + "Message " + response.ReasonPhrase); } }
private void addLabelPoint(GMapMarker theMarker, Stop theStop) { theMarker.ToolTipText = $"Nombre: {theStop.longName}, \nNombre corto: {theStop.shortName}"; GMapToolTip theTip = new GMapToolTip(theMarker); theTip.Fill = new SolidBrush(Color.Gray); theTip.Foreground = new SolidBrush(Color.Black); theMarker.ToolTip = theTip; }
public virtual void Dispose() { if (!disposed) { disposed = true; Tag = null; if (ToolTip != null) { toolTipText = null; ToolTip.Dispose(); ToolTip = null; } } }
private void ToolTip(PointLatLng pointtoadd, GMarkerGoogleType markertype = GMarkerGoogleType.blue_dot) { marker = new GMarkerGoogle(pointtoadd, markertype); markers.Markers.Remove(marker); marker.ToolTipText = "-------------------------------------\nTime : " + time + "\n \n Water Level : " + inn + "\n \n Status : " + status + "\n-------------------------------------"; //adding tootltip var tooltip = new GMapToolTip(marker) { Fill = new SolidBrush(Color.DarkBlue), Foreground = new SolidBrush(Color.White), Offset = new Point(10, -80), Stroke = new Pen(new SolidBrush(Color.Black)), }; marker.ToolTip = tooltip; markers.Markers.Add(marker); }
/// <summary> /// Initializes a new instance of the <see cref="GMapMarker"/> class. /// </summary> /// <param name="info">The info.</param> /// <param name="context">The context.</param> protected GMapMarker(SerializationInfo info, StreamingContext context) { this.Position = Extensions.GetStruct <PointLatLng>(info, "Position", PointLatLng.Empty); this.Tag = Extensions.GetValue <object>(info, "Tag", null); this.Offset = Extensions.GetStruct <Point>(info, "Offset", Point.Empty); this.area = Extensions.GetStruct <Rectangle>(info, "Area", Rectangle.Empty); this.ToolTip = Extensions.GetValue <GMapToolTip>(info, "ToolTip", null); if (this.ToolTip != null) { this.ToolTip.Marker = this; } this.ToolTipMode = Extensions.GetStruct <MarkerTooltipMode>(info, "ToolTipMode", MarkerTooltipMode.OnMouseOver); this.ToolTipText = info.GetString("ToolTipText"); this.IsVisible = info.GetBoolean("Visible"); this.DisableRegionCheck = info.GetBoolean("DisableregionCheck"); this.IsHitTestVisible = info.GetBoolean("IsHitTestVisible"); }
private void dataMarkerBus(GMapMarker marck, int busId, int lineId, int tripId) { Line line = ((Line)(MetroCa.Lines[lineId])); String state = ""; if (line != null) { OperationalData stateOperationalDates = ((OperationalData)(MetroCa.StateBusOperation[busId + "" + tripId])); if (stateOperationalDates != null) { int time = stateOperationalDates.DesviationTime; marck.ToolTipText = $"Ruta: {line.ShortName}, \nEstado de Operacion: {MetroCa.stateTimeBus(time)}"; state = MetroCa.stateTimeBus(time); } else { var rand = new Random(); int num = rand.Next(-20, 20); marck.ToolTipText = $"Ruta: {line.ShortName}, \nEstado de Operacion: {MetroCa.stateTimeBus(num)}"; state = MetroCa.stateTimeBus(num); } } else { marck.ToolTipText = $"ID: {busId}"; } GMapToolTip toolTipMarK = new GMapToolTip(marck); if (state.Contains("Adelantado")) { toolTipMarK.Fill = new SolidBrush(Color.Green); toolTipMarK.Foreground = new SolidBrush(Color.Black); } else { toolTipMarK.Fill = new SolidBrush(Color.Red); toolTipMarK.Foreground = new SolidBrush(Color.Black); } marck.ToolTip = toolTipMarK; }
private void AddMarkerWithTooltip(GMapControl map, PointLatLng point, string toolTipText, GMarkerGoogleType markerType = GMarkerGoogleType.black_small) { var markers = new GMapOverlay("markers"); var marker = new GMarkerGoogle(point, markerType) { ToolTipText = toolTipText }; var toolTip = new GMapToolTip(marker) { Fill = new SolidBrush(Color.Transparent), Foreground = new SolidBrush(Color.Black), Offset = new Point(8, -20), Stroke = new Pen(new SolidBrush(Color.White)) }; marker.ToolTip = toolTip; markers.Markers.Add(marker); map.Overlays.Add(markers); }
private void AddMarker(PointLatLng pointtoadd, GMarkerGoogleType markertype = GMarkerGoogleType.blue_dot) { var markers = new GMapOverlay("markers"); var marker = new GMarkerGoogle(pointtoadd, markertype) { ToolTipText = $"Latitude : {Math.Round(mMap.Position.Lat, 3)},\nLongitude: {Math.Round(mMap.Position.Lng, 3)}" }; //adding tootltip var tooltip = new GMapToolTip(marker) { Fill = new SolidBrush(Color.DarkBlue), Foreground = new SolidBrush(Color.White), Offset = new Point(10, -80), Stroke = new Pen(new SolidBrush(Color.Black)), }; marker.ToolTip = tooltip; markers.Markers.Add(marker); mMap.Overlays.Add(markers); }
public AddSkladiste() { InitializeComponent(); this.AutoValidate = AutoValidate.Disable; map.DragButton = MouseButtons.Left; map.MapProvider = GMapProviders.GoogleMap; map.Position = new PointLatLng(43.343815, 17.807964); map.MinZoom = 3; map.MaxZoom = 95; map.Zoom = 15; HttpResponseMessage response = skladisteService.GetResponse(); List <Skladista> skladiste = response.Content.ReadAsAsync <List <Skladista> >().Result; if (response.IsSuccessStatusCode) { marrkers = new GMapOverlay("Markeri"); foreach (var x in skladiste) { PointLatLng novi = new PointLatLng(Convert.ToDouble(x.Longitude), Convert.ToDouble(x.Latitude)); GMarkerGoogle marker = new GMarkerGoogle(novi, GMarkerGoogleType.blue_dot); marker.ToolTipText = $"Naziv skladišta: {x.Adresa}, \n " + $"Longitude: {x.Latitude}, \n " + $"Latitude: {x.Longitude}, "; var tooltip = new GMapToolTip(marker); tooltip.Fill = new SolidBrush(Color.DarkBlue); tooltip.Foreground = new SolidBrush(Color.White); tooltip.Offset = new Point(40, -20); tooltip.Stroke = new Pen(new SolidBrush(Color.Red)); marker.ToolTip = tooltip; marrkers.Markers.Add(marker); } map.Overlays.Add(marrkers); } else { } }
private void bunifuFlatButton6_Click(object sender, EventArgs e) { bunifuCards6.Show(); if (harti == false) { points.Clear(); gmap.MapProvider = GMapProviders.GoogleMap; gmap.DragButton = MouseButtons.Left; gmap.ShowCenter = false; //centru bucuresti; gmap.Position = new GMap.NET.PointLatLng(44.429865, 26.102081); foreach (Asigurare asig in listaBD) { points.Add(new PointLatLng(asig.Client.Lat, asig.Client.Lng)); } int i = 0; foreach (PointLatLng point in points) { GMapMarker marker = new GMarkerGoogle(point, GMarkerGoogleType.red_dot); GMapOverlay markers = new GMapOverlay("markers"); marker.ToolTipText = $"{listaBD[i].ToString()}"; i++; GMapToolTip mapToolTip = new GMapToolTip(marker) { Fill = new SolidBrush(Color.FromArgb(33, 32, 77)), Foreground = new SolidBrush(Color.White), Stroke = new Pen(new SolidBrush(Color.Red)) }; marker.ToolTip = mapToolTip; markers.Markers.Add(marker); gmap.Overlays.Add(markers); } gmap.MinZoom = 5; gmap.MaxZoom = 100; gmap.Zoom = 13; } harti = true; }
/// <summary> /// Initializes a new instance of the <see cref="GMapMarker"/> class. /// </summary> /// <param name="info">The info.</param> /// <param name="context">The context.</param> protected GMapMarker(SerializationInfo info, StreamingContext context) { this.Position = info.GetStruct<PointLatLng>("Position", PointLatLng.Empty); this.Tag = info.GetValue<object>("Tag", null); this.Offset = info.GetStruct<Point>("Offset", Point.Empty); this.area = info.GetStruct<Rectangle>("Area", Rectangle.Empty); this.ToolTip = info.GetValue<GMapToolTip>("ToolTip", null); this.ToolTipMode = info.GetStruct<MarkerTooltipMode>("ToolTipMode", MarkerTooltipMode.OnMouseOver); this.ToolTipText = info.GetString("ToolTipText"); this.IsVisible = info.GetBoolean("Visible"); this.DisableRegionCheck = info.GetBoolean("DisableregionCheck"); this.IsHitTestVisible = info.GetBoolean("IsHitTestVisible"); }
public virtual void Dispose() { if(!disposed) { disposed = true; Tag = null; if(ToolTip != null) { toolTipText = null; ToolTip.Dispose(); ToolTip = null; } } }
public DetailsForm(esp_Narudzbe_SelectAktivne_Result narudzba) { InitializeComponent(); GMapProviders.GoogleMap.ApiKey = @"AIzaSyCiLq7oFsOeQAhlmf6KxhsIAwDUDbJ-W0M"; if (narudzba != null) { this.narudzba = narudzba; } _points = new List <PointLatLng>(); HttpResponseMessage response2 = narudzbeServices.GetResponseID(narudzba.NarudzbaID); if (response2.IsSuccessStatusCode) { AktivnaNarudzba = response2.Content.ReadAsAsync <Narudzbe>().Result; HttpResponseMessage response1 = skladisteService.GetResponseID(AktivnaNarudzba.SkladisteID); if (response1.IsSuccessStatusCode) { NarucenoSkladiste = response1.Content.ReadAsAsync <Skladista>().Result; _points.Add(new PointLatLng(Convert.ToDouble(NarucenoSkladiste.Longitude), Convert.ToDouble(NarucenoSkladiste.Latitude))); _points.Add(new PointLatLng(Convert.ToDouble(AktivnaNarudzba.Latitude), Convert.ToDouble(AktivnaNarudzba.Longitude))); } } map.DragButton = MouseButtons.Left; map.MapProvider = GMapProviders.GoogleMap; map.Position = new PointLatLng(Convert.ToDouble(NarucenoSkladiste.Longitude), Convert.ToDouble(NarucenoSkladiste.Latitude)); map.MinZoom = 3; map.MaxZoom = 95; map.Zoom = 15; HttpResponseMessage response = skladisteService.GetResponse(); List <Skladista> skladiste = response.Content.ReadAsAsync <List <Skladista> >().Result; if (response.IsSuccessStatusCode) { marrkers = new GMapOverlay("Markeri"); foreach (var x in skladiste) { if (x.SkladisteID == NarucenoSkladiste.SkladisteID) { PointLatLng novi2 = new PointLatLng(Convert.ToDouble(_points[0].Lat), Convert.ToDouble(_points[0].Lng)); GMarkerGoogle marker2 = new GMarkerGoogle(novi2, GMarkerGoogleType.red_pushpin); marker2.ToolTipText = $"Odabrano Skladiste: , \n " + $"Longitude: {_points[0].Lat}, \n " + $"Latitude: {_points[0].Lng}, "; var tooltip2 = new GMapToolTip(marker2); tooltip2.Fill = new SolidBrush(Color.LightGoldenrodYellow); tooltip2.Foreground = new SolidBrush(Color.Black); tooltip2.Offset = new Point(50, -25); tooltip2.Stroke = new Pen(new SolidBrush(Color.Black)); marker2.ToolTip = tooltip2; marrkers.Markers.Add(marker2); } else { PointLatLng novi = new PointLatLng(Convert.ToDouble(x.Longitude), Convert.ToDouble(x.Latitude)); GMarkerGoogle marker = new GMarkerGoogle(novi, GMarkerGoogleType.blue_dot); marker.ToolTipText = $"Naziv skladišta: {x.Adresa}, \n " + $"Longitude: {x.Latitude}, \n " + $"Latitude: {x.Longitude}, "; var tooltip = new GMapToolTip(marker); tooltip.Fill = new SolidBrush(Color.DarkBlue); tooltip.Foreground = new SolidBrush(Color.White); tooltip.Offset = new Point(40, -20); tooltip.Stroke = new Pen(new SolidBrush(Color.Red)); marker.ToolTip = tooltip; marrkers.Markers.Add(marker); } } PointLatLng novi3 = new PointLatLng(Convert.ToDouble(_points[1].Lat), Convert.ToDouble(_points[1].Lng)); GMarkerGoogle marker3 = new GMarkerGoogle(novi3, GMarkerGoogleType.red_pushpin); marker3.ToolTipText = $"Korisnik: , \n " + $"Longitude: {_points[1].Lat}, \n " + $"Latitude: {_points[1].Lng}, "; var tooltip3 = new GMapToolTip(marker3); tooltip3.Fill = new SolidBrush(Color.LightGoldenrodYellow); tooltip3.Foreground = new SolidBrush(Color.Black); tooltip3.Offset = new Point(50, -25); tooltip3.Stroke = new Pen(new SolidBrush(Color.Black)); marker3.ToolTip = tooltip3; marrkers.Markers.Add(marker3); map.Overlays.Add(marrkers); } else { } }