Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
... private static void MapOnInfo(object? sender, MapInfoEventArgs e) { var calloutStyle = e.MapInfo?.Feature?.Styles.Where(s => s is CalloutStyle).Cast().FirstOrDefault(); if (calloutStyle != null) { calloutlist.Add(calloutStyle); foreach (var callout in calloutlist) { callout.Enabled = false; } calloutStyle.Enabled = !calloutStyle.Enabled; e.MapInfo?.Layer?.DataHasChanged(); // To trigger a refresh of graphics. } if (calloutlist.Count > 1) calloutlist.RemoveRange(0, calloutlist.Count - 1); } private MemoryLayer CreatePointLayer() { return new MemoryLayer { Name = "Points", IsMapInfoLayer = true, Features = new Mapsui.Providers.MemoryProvider(GetPlacesFromList()).Features, Style = SymbolStyles.CreatePinStyle() //<- Reference for custom marker: https://github.com/Mapsui/Mapsui/blob/master/Samples/Mapsui.Samples.Common/Maps/Callouts/CustomCalloutSample.cs#L64 }; } ... private static CalloutStyle CreateCalloutStyle(string? name) { return new CalloutStyle { Title = name, TitleFont = { FontFamily = null, Size = 12, Italic = false, Bold = true }, TitleFontColor = Color.Violet, MaxWidth = 120, RectRadius = 10, ShadowWidth = 4, Enabled = false, SymbolOffset = new Offset(0, SymbolStyle.DefaultHeight * 0.3f) }; }