/// <summary> /// adds marker using geocoder /// </summary> /// <param name="place"></param> public void AddLocationMarker(string place) { GeocoderStatusCode status; PointLatLng? pos = GMapProviders.GoogleMap.GetPoint(place, out status); if (pos != null && status == GeocoderStatusCode.Success) { var m = new GMarkerIcon(pos.Value, GMarkerIconType.green); m.ToolTipText = place; m.ToolTipMode = MarkerTooltipMode.Always; fObjects.Markers.Add(m); } }
public void AddMarker(PointLatLng position, GMarkerIconType iconType, MarkerTooltipMode tooltipMode, string toolTip = "") { var m = new GMarkerIcon(position, iconType); // GMarkerIconType.green m.ToolTipMode = tooltipMode; // MarkerTooltipMode.OnMouseOver if (!string.IsNullOrEmpty(toolTip)) { m.ToolTipText = toolTip; } else { Placemark? p = null; GeocoderStatusCode status; var ret = GMapProviders.GoogleMap.GetPlacemark(position, out status); if (status == GeocoderStatusCode.Success && ret != null) { p = ret; } m.ToolTipText = (p != null) ? p.Value.Address : position.ToString(); } fObjects.Markers.Add(m); }