Version 4.1.0

This commit is contained in:
ClemensF 2017-10-07 17:43:28 +02:00
parent 078f3173da
commit 6efad6df0f
23 changed files with 549 additions and 76 deletions

View file

@ -24,60 +24,33 @@ namespace ViewModel
MapTileLayer.OpenStreetMapTileLayer
},
{
"OpenStreetMap German Style",
"OpenStreetMap German",
new MapTileLayer
{
SourceName = "OpenStreetMap German",
Description = "© [OpenStreetMap Contributors](http://www.openstreetmap.org/copyright)",
Description = "© [OpenStreetMap contributors](http://www.openstreetmap.org/copyright)",
TileSource = new TileSource { UriFormat = "http://{c}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png" },
MaxZoomLevel = 19
}
},
{
"Thunderforest OpenCycleMap",
"Stamen Terrain",
new MapTileLayer
{
SourceName = "Thunderforest OpenCycleMap",
Description = "Maps © [Thunderforest](http://www.thunderforest.com/), Data © [OpenStreetMap Contributors](http://www.openstreetmap.org/copyright)",
TileSource = new TileSource { UriFormat = "http://{c}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png" }
SourceName = "Stamen Terrain",
Description = "Map tiles by [Stamen Design](http://stamen.com/), under [CC BY 3.0](http://creativecommons.org/licenses/by/3.0). Data by OpenStreetMap, under [ODbL](http://www.openstreetmap.org/copyright)",
TileSource = new TileSource { UriFormat = "http://tile.stamen.com/terrain/{z}/{x}/{y}.png" },
MaxZoomLevel = 17
}
},
{
"Thunderforest Landscape",
"Stamen Toner Light",
new MapTileLayer
{
SourceName = "Thunderforest Landscape",
Description = "Maps © [Thunderforest](http://www.thunderforest.com/), Data © [OpenStreetMap Contributors](http://www.openstreetmap.org/copyright)",
TileSource = new TileSource { UriFormat = "http://{c}.tile.thunderforest.com/landscape/{z}/{x}/{y}.png" }
}
},
{
"Thunderforest Outdoors",
new MapTileLayer
{
SourceName = "Thunderforest Outdoors",
Description = "Maps © [Thunderforest](http://www.thunderforest.com/), Data © [OpenStreetMap Contributors](http://www.openstreetmap.org/copyright)",
TileSource = new TileSource { UriFormat = "http://{c}.tile.thunderforest.com/outdoors/{z}/{x}/{y}.png" }
}
},
{
"Thunderforest Transport",
new MapTileLayer
{
SourceName = "Thunderforest Transport",
Description = "Maps © [Thunderforest](http://www.thunderforest.com/), Data © [OpenStreetMap Contributors](http://www.openstreetmap.org/copyright)",
TileSource = new TileSource { UriFormat = "http://{c}.tile.thunderforest.com/transport/{z}/{x}/{y}.png" }
}
},
{
"Thunderforest Transport Dark",
new MapTileLayer
{
SourceName = "Thunderforest Transport Dark",
Description = "Maps © [Thunderforest](http://www.thunderforest.com/), Data © [OpenStreetMap Contributors](http://www.openstreetmap.org/copyright)",
TileSource = new TileSource { UriFormat = "http://{c}.tile.thunderforest.com/transport-dark/{z}/{x}/{y}.png" },
MapForeground = new SolidColorBrush(Colors.White),
MapBackground = new SolidColorBrush(Colors.Black)
SourceName = "Stamen Toner Light",
Description = "Map tiles by [Stamen Design](http://stamen.com/), under [CC BY 3.0](http://creativecommons.org/licenses/by/3.0). Data by OpenStreetMap, under [ODbL](http://www.openstreetmap.org/copyright)",
TileSource = new TileSource { UriFormat = "http://tile.stamen.com/toner-lite/{z}/{x}/{y}.png" },
MaxZoomLevel = 18
}
},
{
@ -172,12 +145,9 @@ namespace ViewModel
public List<string> MapLayerNames { get; } = new List<string>
{
"OpenStreetMap",
"OpenStreetMap German Style",
"Thunderforest OpenCycleMap",
//"Thunderforest Landscape",
//"Thunderforest Outdoors",
//"Thunderforest Transport",
//"Thunderforest Transport Dark",
"OpenStreetMap German",
"Stamen Terrain",
"Stamen Toner Light",
"OpenStreetMap WMS",
"OpenStreetMap TOPO WMS"
};

View file

@ -11,8 +11,8 @@ namespace UniversalApp
{
public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
InitializeComponent();
Suspending += OnSuspending;
}
protected override void OnLaunched(LaunchActivatedEventArgs e)

View file

@ -26,7 +26,7 @@
<Style x:Key="PointItemStyle" TargetType="map:MapItem">
<EventSetter Event="TouchDown" Handler="MapItemTouchDown"/>
<Setter Property="Location" Value="{Binding Location}"/>
<Setter Property="map:MapPanel.Location" Value="{Binding Location}"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="Template">
<Setter.Value>
@ -81,7 +81,7 @@
<Style x:Key="PushpinItemStyle" TargetType="map:MapItem">
<EventSetter Event="TouchDown" Handler="MapItemTouchDown"/>
<Setter Property="Location" Value="{Binding Location}"/>
<Setter Property="map:MapPanel.Location" Value="{Binding Location}"/>
<Setter Property="VerticalAlignment" Value="Bottom"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="Visibility">
@ -155,10 +155,10 @@
ItemContainerStyle="{StaticResource PushpinItemStyle}"
IsSynchronizedWithCurrentItem="True"/>
<map:Pushpin Location="65,-18" Content="Iceland"/>
<map:Pushpin Location="71,25" Content="Norway"/>
<map:Pushpin Location="35,33" Content="Cyprus"/>
<map:Pushpin Location="28.25,-16.5" Content="Tenerife"/>
<map:Pushpin map:MapPanel.Location="65,-18" Content="Iceland"/>
<map:Pushpin map:MapPanel.Location="71,25" Content="Norway"/>
<map:Pushpin map:MapPanel.Location="35,33" Content="Cyprus"/>
<map:Pushpin map:MapPanel.Location="28.25,-16.5" Content="Tenerife"/>
<Path map:MapPanel.Location="53.5,8.2" Stroke="Blue" StrokeThickness="3" Fill="#1F007F00">
<Path.Data>
@ -166,7 +166,7 @@
</Path.Data>
</Path>
<map:Pushpin Location="53.5,8.2" Background="Yellow" Foreground="Blue" Content="N 53°30' E 8°12'">
<map:Pushpin map:MapPanel.Location="53.5,8.2" Background="Yellow" Foreground="Blue" Content="N 53°30' E 8°12'">
<map:Pushpin.Visibility>
<MultiBinding Converter="{StaticResource LocationToVisibilityConverter}">
<Binding Path="(map:MapPanel.ParentMap)" RelativeSource="{RelativeSource Self}"/>
@ -177,7 +177,7 @@
</map:Map>
<Border HorizontalAlignment="Right" VerticalAlignment="Bottom" Background="#7FFFFFFF">
<TextBlock Margin="2" FontSize="10" map:HyperlinkText.InlinesSource="{Binding MapLayers.CurrentMapLayer.Description}"/>
<TextBlock Margin="2" FontSize="10" map:HyperlinkText.InlinesSource="{Binding MapLayer.Description, ElementName=map}"/>
</Border>
<Grid Grid.Row="1">

View file

@ -21,9 +21,9 @@ namespace WpfApplication
{
if (e.ClickCount == 2)
{
map.TargetCenter = map.ViewportPointToLocation(e.GetPosition(map));
//map.ZoomMap(e.GetPosition(map), Math.Floor(map.ZoomLevel + 1.5));
//map.ZoomToBounds(new BoundingBox(53, 7, 54, 9));
map.TargetCenter = map.ViewportPointToLocation(e.GetPosition(map));
}
}
@ -31,7 +31,7 @@ namespace WpfApplication
{
if (e.ClickCount == 2)
{
map.ZoomMap(e.GetPosition(map), Math.Ceiling(map.ZoomLevel - 1.5));
//map.ZoomMap(e.GetPosition(map), Math.Ceiling(map.ZoomLevel - 1.5));
}
}
@ -80,12 +80,12 @@ namespace WpfApplication
private void SeamarksChecked(object sender, RoutedEventArgs e)
{
map.Children.Insert(map.Children.IndexOf(mapGraticule), ((MapViewModel)DataContext).MapLayers.SeamarksLayer);
map.Children.Insert(map.Children.IndexOf(mapGraticule), (UIElement)Application.Current.Resources["Seamarks"]);
}
private void SeamarksUnchecked(object sender, RoutedEventArgs e)
{
map.Children.Remove(((MapViewModel)DataContext).MapLayers.SeamarksLayer);
map.Children.Remove((UIElement)Application.Current.Resources["Seamarks"]);
}
}
}