mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-04 22:18:56 +00:00
Removed default User-Agent header.
Using a library's default User-Agent violates OpenStreetMap's tile usage policy: https://operations.osmfoundation.org/policies/tiles/
This commit is contained in:
parent
8124d5714a
commit
66a51906ef
10 changed files with 67 additions and 30 deletions
|
|
@ -210,7 +210,7 @@
|
|||
</tools:MapLayerMenuItem>
|
||||
<tools:MapLayerMenuItem Text="OpenStreetMap WMS">
|
||||
<map:WmsImageLayer
|
||||
ServiceUri="http://ows.terrestris.de/osm/service"
|
||||
ServiceUri="https://ows.terrestris.de/osm/service"
|
||||
Description="© [terrestris GmbH & Co. KG](http://ows.terrestris.de/) © [OpenStreetMap contributors](http://www.openstreetmap.org/copyright)"/>
|
||||
</tools:MapLayerMenuItem>
|
||||
|
||||
|
|
|
|||
|
|
@ -16,12 +16,14 @@ namespace SampleApplication
|
|||
{
|
||||
public MainPage()
|
||||
{
|
||||
ImageLoader.HttpClient.DefaultRequestHeaders.Add("User-Agent", "XAML Map Control UWP Sample Application");
|
||||
|
||||
var loggerFactory = LoggerFactory.Create(builder => builder.AddDebug().SetMinimumLevel(LogLevel.Information));
|
||||
ImageLoader.LoggerFactory = loggerFactory;
|
||||
|
||||
//var tileCache = new MapControl.Caching.ImageFileCache(TileImageLoader.DefaultCacheFolder, loggerFactory);
|
||||
//TileImageLoader.Cache = tileCache;
|
||||
//Unloaded += (s, e) => tileCache.Dispose();
|
||||
var tileCache = new MapControl.Caching.ImageFileCache(TileImageLoader.DefaultCacheFolder, loggerFactory);
|
||||
TileImageLoader.Cache = tileCache;
|
||||
Unloaded += (s, e) => tileCache.Dispose();
|
||||
|
||||
InitializeComponent();
|
||||
AddTestLayers();
|
||||
|
|
@ -93,7 +95,7 @@ namespace SampleApplication
|
|||
|
||||
if (start != null)
|
||||
{
|
||||
measurementLine.Locations = LocationCollection.OrthodromeLocations(start, location);
|
||||
measurementLine.Locations = LocationCollection.GeodesicLocations(start, location);
|
||||
mouseLocation.Text += GetDistanceText(location.GetDistance(start));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue