esegece.sgcMaps.Avalonia.Community 2.0.0

dotnet add package esegece.sgcMaps.Avalonia.Community --version 2.0.0
                    
NuGet\Install-Package esegece.sgcMaps.Avalonia.Community -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="esegece.sgcMaps.Avalonia.Community" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="esegece.sgcMaps.Avalonia.Community" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="esegece.sgcMaps.Avalonia.Community" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add esegece.sgcMaps.Avalonia.Community --version 2.0.0
                    
#r "nuget: esegece.sgcMaps.Avalonia.Community, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package esegece.sgcMaps.Avalonia.Community@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=esegece.sgcMaps.Avalonia.Community&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=esegece.sgcMaps.Avalonia.Community&version=2.0.0
                    
Install as a Cake Tool

sgcMaps for .NET

sgcMaps is a mapping toolkit for .NET: an offline maps model and geometry engine, a SkiaSharp rendering engine with headless PNG export, a Windows Forms map control, and offline routing / geocoding built from OpenStreetMap and GeoNames data. It mirrors the Delphi sgcMaps library, so tile caches, .sgcgraph route graphs and GeoNames indexes are file-compatible between the two.

Packages

Package Description
esegece.sgcMaps Core model: tile math, geometry, map items (markers, polylines, polygons, layers), tile sources (folder, MBTiles, HTTP), the tile downloader, GeoJSON / GPX / KML import and export, and the Geocoder / Directions online services.
esegece.sgcMaps.Rendering Framework-agnostic MapView: draws tiles, overlays, clusters, heatmaps and popups with SkiaSharp, including headless PNG export for server-side rendering.
esegece.sgcMaps.WinForms SgcMapControl, a Windows Forms control hosting the MapView engine with mouse, wheel and keyboard input.
esegece.sgcMaps.Offline Offline services: a streaming OpenStreetMap reader (.osm.pbf and .osm XML), a route graph builder and OfflineRouter, and a GeoNames index builder with OfflineGeocoder.

Quick start

MapView: headless render to PNG

using esegece.sgcMaps;
using esegece.sgcMaps.Rendering;

var map = new MapView();
map.SetSize(800, 600);
map.Options.ShowZoomControls = false;

Layer layer = map.Layers.Add();
layer.Name = "osm";
layer.Provider = TileProvider.OpenStreetMap;
MapProviders.ApplyProvider(layer);
layer.CacheFolder = "tile_cache";

map.SetCenter(40.4168, -3.7038); // Madrid
map.Zoom = 13;
map.AddMarker(40.4168, -3.7038, "Madrid");

map.RenderToPng("madrid.png", 800, 600, tileTimeout: TimeSpan.FromSeconds(30));

SgcMapControl on a form

using esegece.sgcMaps;
using esegece.sgcMaps.WinForms;

var control = new SgcMapControl { Dock = DockStyle.Fill };

Layer layer = control.Layers.Add();
layer.Provider = TileProvider.OpenStreetMap;
MapProviders.ApplyProvider(layer);
layer.CacheFolder = "tile_cache";

control.CenterLatitude = 40.4168;
control.CenterLongitude = -3.7038;
control.Zoom = 13;

Marker marker = control.Markers.Add();
marker.Latitude = 40.4168;
marker.Longitude = -3.7038;
marker.PopupText = "Madrid";

var form = new Form();
form.Controls.Add(control);
Application.Run(form);

Geocoder (online, Nominatim by default)

using esegece.sgcMaps.Services;

var geocoder = new Geocoder();
IReadOnlyList<GeocodingResult> results = await geocoder.GeocodeAsync("Madrid, Spain");
foreach (GeocodingResult r in results)
    Console.WriteLine($"{r.DisplayName}: {r.Latitude}, {r.Longitude}");

Directions (online, OSRM by default)

using esegece.sgcMaps;
using esegece.sgcMaps.Services;

var directions = new Directions(); // OSRM by default
var waypoints = new[]
{
    new MapCoord(40.4168, -3.7038),
    new MapCoord(40.4153, -3.6844)
};
IReadOnlyList<Route> routes = await directions.GetRouteAsync(waypoints);
Route route = routes[0];
Console.WriteLine($"{route.Distance / 1000:F2} km, {route.Duration / 60:F0} min");

OfflineRouter (no network, built from a .osm.pbf extract)

using esegece.sgcMaps;
using esegece.sgcMaps.Offline;
using esegece.sgcMaps.Services;

// build the graph once, offline, from a .osm.pbf extract
var builder = new RouteGraphBuilder();
builder.Build("andorra-latest.osm.pbf", "andorra.sgcgraph");

using var router = new OfflineRouter("andorra.sgcgraph");
router.Profile = OfflineRouterProfile.Car;
router.Open();

var route = new Route();
bool ok = router.GetRoute(route, new MapCoord(42.5063, 1.5218), new MapCoord(42.5350, 1.5807));
Console.WriteLine(ok
    ? $"{route.Distance / 1000:F2} km, {route.Duration / 60:F0} min"
    : router.LastError);

Editions

Every package ships in two editions. The Registered packages use the ids above. The free Community edition uses the same ids with a .Community suffix (esegece.sgcMaps.Community, esegece.sgcMaps.Rendering.Community, esegece.sgcMaps.WinForms.Community) and does not include the offline pack: the tile downloader, the MBTiles tile source (raster and vector MBTiles) and the esegece.sgcMaps.Offline package, which has no Community package.

License

Registered edition: commercial license, see LICENSE.txt. Community edition: see LICENSE-Community.txt. More at https://www.esegece.com

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 85 10/15/2026