2017-06-25 23:05:48 +02:00
|
|
|
# XAML Map Control
|
|
|
|
|
|
2021-07-07 16:13:37 +02:00
|
|
|
A set of controls for WPF, UWP and WinUI for rendering digital maps from different providers and various types of map overlays.
|
2017-04-01 19:04:31 +02:00
|
|
|
|
2021-02-05 21:58:49 +01:00
|
|
|
Map providers can easily be added by specifying a template string for their map tile URLs.
|
2017-06-25 23:05:48 +02:00
|
|
|
Map overlay layers allow to draw and interact with graphical objects and pushpins on the map.
|
2021-02-05 21:58:49 +01:00
|
|
|
The Map Control API is similar to the Microsoft Bing Maps Control for WPF, except that no API key is required.
|
2017-04-01 19:04:31 +02:00
|
|
|
|
2017-08-04 23:06:14 +02:00
|
|
|
The project includes sample applications for both platforms, which demonstrate the features of XAML Map Control.
|
2017-04-01 19:04:31 +02:00
|
|
|
|
2017-08-04 23:06:14 +02:00
|
|
|
Map Control supports multiple map projections. However, the MapTileLayer class only works with WebMercatorProjection.
|
2021-02-05 21:58:49 +01:00
|
|
|
For other projections, an appropriate WmtsTileLayer or WmsImageLayer could be used.
|
2017-06-25 23:05:48 +02:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
Main classes are
|
|
|
|
|
|
2020-03-20 18:58:58 +01:00
|
|
|
- **MapBase**: The core map control. Provides properties like Center, ZoomLevel and Heading,
|
|
|
|
|
which define the currently displayed map viewport.
|
2017-06-25 23:05:48 +02:00
|
|
|
|
|
|
|
|
- **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**.
|
|
|
|
|
|
2020-04-25 15:31:26 +02:00
|
|
|
- **MapImageLayer**, **WmsImageLayer**: Provides single image map content, e.g. from a Web Map Service (WMS).
|
2020-03-20 18:58:58 +01:00
|
|
|
|
|
|
|
|
- **WmtsTileLayer**: Provides tiled map content from a Web Map Tile Service (WMTS).
|
2017-06-25 23:05:48 +02:00
|
|
|
|
|
|
|
|
- **MapItemsControl**: Displays a collection of **MapItem** objects (with a geographic **Location**).
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2024-02-05 10:38:29 +01:00
|
|
|
The **TileImageLoader** class uses
|
2024-02-05 10:30:30 +01:00
|
|
|
[IDistributedCache](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.caching.distributed.idistributedcache?view=dotnet-plat-ext-8.0)
|
2024-02-05 10:38:29 +01:00
|
|
|
for optional caching of map tile bitmaps. By default, the cache is a
|
2024-02-05 10:39:45 +01:00
|
|
|
[MemoryDistributedCache](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.caching.distributed.memorydistributedcache?view=dotnet-plat-ext-8.0)
|
2024-02-05 10:38:29 +01:00
|
|
|
instance with all default options.
|
2024-02-03 21:46:17 +01:00
|
|
|
|
2024-02-07 07:57:07 +01:00
|
|
|
Map Control provides three minimal IDistributedCache implementations for persistent caching:
|
2024-02-05 10:44:11 +01:00
|
|
|
* 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](https://github.com/eztools-software/FileDb),
|
|
|
|
|
a simple file based No-SQL database, in a separate library FileDbCache.
|
|
|
|
|
* SQLiteCache, based on [System.Data.SQLite](https://system.data.sqlite.org/index.html/doc/trunk/www/index.wiki),
|
2024-02-03 21:48:41 +01:00
|
|
|
in a separate library SQLiteCache.
|
2017-06-25 23:05:48 +02:00
|
|
|
|
2024-02-07 07:57:07 +01:00
|
|
|
You can of course also use a full-featured cache like
|
|
|
|
|
[RedisCache](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.caching.stackexchangeredis.rediscache?view=dotnet-plat-ext-3.1&viewFallbackFrom=dotnet-plat-ext-8.0).
|
|
|
|
|
|
|
|
|
|
To try the sample application with persistent caching, add an appropriate package reference to its Visual Studio project
|
|
|
|
|
and uncomment the respective TileImageLoader.Cache assignment in MainWindow.xaml.cs.
|
|
|
|
|
|
|
|
|
|
Please note that some map providers may not allow persistent caching of their map data.
|
2017-06-25 23:05:48 +02:00
|
|
|
|
2017-08-04 23:29:05 +02:00
|
|
|
---
|
|
|
|
|
|
2017-08-06 12:58:23 +02:00
|
|
|
XAML Map Control is available on NuGet, with Package Id [XAML.MapControl](https://www.nuget.org/packages/XAML.MapControl/).
|
2017-04-01 19:04:31 +02:00
|
|
|
|
2017-06-25 23:05:48 +02:00
|
|
|
---
|
2017-04-01 19:04:31 +02:00
|
|
|
|
2017-06-25 23:05:48 +02:00
|
|
|
The project is not open for contributions. Pull requests will not be accepted.
|