Set OSM tile User-Agent
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
43b4ae7763
commit
7c626efccf
2 changed files with 8 additions and 1 deletions
|
|
@ -2,6 +2,12 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
|
||||||
|
## [1.0.8-rc38] - unstable
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
* [PostIt] Set a custom OpenStreetMap User-Agent for the address editor map tiles to satisfy the OSM tile usage policy.
|
||||||
|
|
||||||
## [1.0.8-rc37] - unstable
|
## [1.0.8-rc37] - unstable
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ public partial class AddressEditorPage : ContentPage
|
||||||
private const double DefaultLongitude = 2.3522;
|
private const double DefaultLongitude = 2.3522;
|
||||||
private const int DefaultZoomLevel = 4;
|
private const int DefaultZoomLevel = 4;
|
||||||
private const int SelectedZoomLevel = 13;
|
private const int SelectedZoomLevel = 13;
|
||||||
|
private const string OpenStreetMapUserAgent = "PostIt/1.1 (+https://github.com/pazof/yavsc)";
|
||||||
|
|
||||||
private MapControl? _locationMap;
|
private MapControl? _locationMap;
|
||||||
private MemoryLayer? _selectionLayer;
|
private MemoryLayer? _selectionLayer;
|
||||||
|
|
@ -45,7 +46,7 @@ public partial class AddressEditorPage : ContentPage
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var map = new Map();
|
var map = new Map();
|
||||||
map.Layers.Add(OpenStreetMap.CreateTileLayer());
|
map.Layers.Add(OpenStreetMap.CreateTileLayer(OpenStreetMapUserAgent));
|
||||||
_selectionLayer = CreateSelectionLayer();
|
_selectionLayer = CreateSelectionLayer();
|
||||||
map.Layers.Add(_selectionLayer);
|
map.Layers.Add(_selectionLayer);
|
||||||
_locationMap.Map = map;
|
_locationMap.Map = map;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue