| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- using System.Windows;
- using Comal.Classes;
- using Syncfusion.UI.Xaml.Maps;
- namespace PRSDesktop;
- public class LiveMapsImageryLayer : ImageryLayer
- {
-
- static readonly DependencyProperty StyleProperty =
- DependencyProperty.Register(
- nameof(Style),
- typeof(LiveMapStyle),
- typeof(MapViewModel),
- new PropertyMetadata(LiveMapStyle.OSM)
- );
- public LiveMapStyle Style
- {
- get => (LiveMapStyle)GetValue(StyleProperty);
- set
- {
- SetValue(StyleProperty, value);
- LayerType = Style == LiveMapStyle.OSM
- ? LayerType.OSM
- : LayerType.Bing;
- BingMapStyle = Style == LiveMapStyle.BingStandard
- ? BingMapStyle.Road
- : Style == LiveMapStyle.BingTerrain
- ? BingMapStyle.Aerial
- : BingMapStyle.AerialWithLabels;
- }
- }
-
- protected override string GetUri(int X, int Y, int Scale)
- {
- return Style == LiveMapStyle.GoogleStandard
- ? $"http://mt1.google.com/vt/lyrs=m&x={X}&y={Y}&z={Scale}"
- : Style == LiveMapStyle.GoogleTerrain
- ? $"http://mt1.google.com/vt/lyrs=s&x={X}&y={Y}&z={Scale}"
- : Style == LiveMapStyle.GoogleTerrainWithLabels
- ? $"http://mt1.google.com/vt/lyrs=y&x={X}&y={Y}&z={Scale}"
- : base.GetUri(X,Y,Scale);
- }
- }
|