XAML Map Control Library
Find a file
2026-01-22 07:37:47 +01:00
Caches Updated PackageReferences 2026-01-15 21:58:30 +01:00
MapControl Removed default User-Agent header. 2026-01-21 22:33:05 +01:00
MapProjections Updated azimuthal projections 2026-01-21 12:08:12 +01:00
MapUiTools Updated PackageReferences 2026-01-15 21:58:30 +01:00
MBTiles Updated PackageReferences 2026-01-15 21:58:30 +01:00
SampleApps Update MainWindow.xaml.cs 2026-01-22 07:37:41 +01:00
.gitignore Reverted commit 2026-01-12 11:58:26 +01:00
Directory.Build.props Update Directory.Build.props 2026-01-22 07:37:47 +01:00
LICENSE Renamed license file 2025-02-27 08:27:53 +01:00
MapControl.sln .NET 9, including UWP 2025-09-14 21:02:21 +02:00
MapControl.snk Version 1.7.0. Signed assemblies, marked Location as serializable, simplified LocationCollection. 2013-11-05 18:00:03 +01:00
MapControlExtended.sln .NET 9, including UWP 2025-09-14 21:02:21 +02:00
README.md Update README.md 2026-01-21 22:58:54 +01:00

XAML Map Control

A set of controls for WPF, UWP, WinUI and Avalonia UI for rendering raster maps from different providers and various types of map overlays.

Map providers can easily be added by specifying a template string for their map tile URLs. Map overlay layers allow to draw and interact with graphical objects and pushpins on the map. The Map Control API is similar to the Microsoft Bing Maps Control for WPF, except that no API key is required.

The project includes sample applications for all platforms, which demonstrate the features of XAML Map Control.

Map Control supports multiple map projections. However, the MapTileLayer class only works with WebMercatorProjection. For other projections, an appropriate WmtsTileLayer or WmsImageLayer could be used.


Main classes are

  • MapBase: The core map control. Provides properties like Center, ZoomLevel and Heading, which define the currently displayed map viewport.

  • Map: MapBase with basic mouse and touch input handling for zoom, pan, and rotation.

  • MapTileLayer: Provides tiled map content (e.g. from OpenStreetMap) by means of a TileSource.

  • WmtsTileLayer: Provides tiled map content from a Web Map Tile Service (WMTS).

  • MapImageLayer, WmsImageLayer: Provides single image map content, e.g. from a Web Map Service (WMS).

  • MapItemsControl: Displays a collection of MapItem objects (with a geographic location).


In order to use OpenStreetMap tile servers in accordance with their Tile Usage Policy, your application must set a unique HTTP User-Agent request header. This value can be set via the DefaultRequestHeaders property of the HttpClient held by the static ImageLoader.HttpClient property. See the sample applications for details. The OpenStreetMap tile usage policy also requires that an application caches map tiles locally.

The TileImageLoader class uses IDistributedCache for optional caching of map tile bitmaps. By default, the cache is a MemoryDistributedCache instance with all default options.

Map Control provides three minimal IDistributedCache implementations for persistent caching:

  • ImageFileCache, an implementation that stores each cached map tile as a single image file, in the original file format delivered by the map provider (typically PNG or JPG). ImageFileCache is part of the MapControl library.
  • FileDbCache, based on EzTools FileDb, a simple file based No-SQL database, in a separate library FileDbCache.
  • SQLiteCache, based on System.Data.SQLite, in a separate library SQLiteCache.

You can of course also use a full-featured cache like RedisCache.

To try the sample applications with FileDbCache or SQLiteCache, add an appropriate package reference to their Visual Studio projects and modify the TileImageLoader.Cache assignment accordingly in MainWindow.xaml.cs.


XAML Map Control is available on NuGet, as a set of framework-specific packages with Package Ids

There are also packages for an extension library with additional map projections, based on ProjNET4GeoAPI, with Package Ids

and a library for MBTiles support, with Package Ids

FileDbCache and SQLiteCache are available with Package Ids


The project is not open for contributions. Pull requests will not be accepted.