Version 2.4.0.

- Added ImageFileCache and FileDbCache for WinRT
- Improved TileImageLoader
- Removed TileContainer, TileLayer can be added as MapBase child
- Removed attached property MapPanel.ViewportPosition
This commit is contained in:
ClemensF 2014-11-19 21:11:14 +01:00
parent f04025067c
commit 3b6545e738
84 changed files with 5504 additions and 1940 deletions

View file

@ -32,7 +32,8 @@
<map:TileSource UriFormat="http://{c}.tile.thunderforest.com/transport/{z}/{x}/{y}.png"/>
</map:TileLayer>
<map:TileLayer SourceName="Thunderforest Transport Dark"
Description="Maps © [Thunderforest](http://www.thunderforest.com/), Data © [OpenStreetMap Contributors](http://www.openstreetmap.org/copyright)">
Description="Maps © [Thunderforest](http://www.thunderforest.com/), Data © [OpenStreetMap Contributors](http://www.openstreetmap.org/copyright)"
Foreground="White" Background="Black">
<map:TileSource UriFormat="http://{c}.tile.thunderforest.com/transport-dark/{z}/{x}/{y}.png"/>
</map:TileLayer>
<map:TileLayer SourceName="MapQuest OpenStreetMap"

View file

@ -15,8 +15,7 @@ namespace PhoneApplication
public MainPage()
{
//TileImageLoader.Cache = new ImageFileCache();
//BingMapsTileLayer.ApiKey = ...
//BingMapsTileLayer.ApiKey = "...";
InitializeComponent();

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest" xmlns:m3="http://schemas.microsoft.com/appx/2014/manifest" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest">
<Identity Name="45fd5832-8021-45d0-909e-dd7af206f388" Publisher="CN=Clemens" Version="1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="45fd5832-8021-45d0-909e-dd7af206f388" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Identity Name="XamlMapControl.PhoneApp" Publisher="CN=Clemens" Version="2.4.0.0" />
<mp:PhoneIdentity PhoneProductId="a28a99bb-a24b-4713-a6ea-3015d8aa2d72" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>PhoneApplication</DisplayName>
<DisplayName>XAML Map Control Phone Application</DisplayName>
<PublisherDisplayName>Clemens</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
@ -16,7 +16,7 @@
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="PhoneApplication.App">
<m3:VisualElements DisplayName="PhoneApplication" Square150x150Logo="Assets\Logo.png" Square44x44Logo="Assets\SmallLogo.png" Description="PhoneApplication" ForegroundText="light" BackgroundColor="transparent">
<m3:VisualElements DisplayName="XAML Map Control Test Application" Square150x150Logo="Assets\Logo.png" Square44x44Logo="Assets\SmallLogo.png" Description="PhoneApplication" ForegroundText="light" BackgroundColor="transparent">
<m3:DefaultTile Wide310x150Logo="Assets\WideLogo.png" Square71x71Logo="Assets\Square71x71Logo.png">
</m3:DefaultTile>
<m3:SplashScreen Image="Assets\SplashScreen.png" />

View file

@ -14,6 +14,7 @@
<MinimumVisualStudioVersion>12</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{76F1466A-8B6D-4E39-A767-685A06062A39};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<AppxBundle>Always</AppxBundle>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2014 Clemens Fischer")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("2.3.1")]
[assembly: AssemblyFileVersion("2.3.1")]
[assembly: AssemblyVersion("2.4.0")]
[assembly: AssemblyFileVersion("2.4.0")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2014 Clemens Fischer")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("2.3.1")]
[assembly: AssemblyFileVersion("2.3.1")]
[assembly: AssemblyVersion("2.4.0")]
[assembly: AssemblyFileVersion("2.4.0")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]

View file

@ -1,5 +1,5 @@
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="SilverlightApplication.App">
<Application.Resources>
</Application.Resources>

View file

@ -32,7 +32,7 @@
<map:TileLayer SourceName="Thunderforest Transport Dark"
Description="Maps © [Thunderforest](http://www.thunderforest.com/), Data © [OpenStreetMap Contributors](http://www.openstreetmap.org/copyright)"
TileSource="http://{c}.tile.thunderforest.com/transport-dark/{z}/{x}/{y}.png"
Background="Black" Foreground="White"/>
Foreground="White" Background="Black"/>
<map:TileLayer SourceName="MapQuest OpenStreetMap"
Description="Maps © [MapQuest](http://www.mapquest.com/), Data © [OpenStreetMap Contributors](http://www.openstreetmap.org/copyright)"
TileSource="http://otile{n}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png"
@ -159,11 +159,12 @@
</Path>
<map:Pushpin map:MapPanel.Location="53.5,8.2" Background="Yellow" Foreground="Blue" Content="N 53° 30' E 8° 12'"/>
</map:Map>
<Border HorizontalAlignment="Right" VerticalAlignment="Bottom" Background="#7FFFFFFF">
<RichTextBlock x:Name="mapLegend" Margin="4,2" FontSize="10"/>
</Border>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition/>

View file

@ -14,7 +14,7 @@ namespace SilverlightApplication
public MainPage()
{
//BingMapsTileLayer.ApiKey = ...
//BingMapsTileLayer.ApiKey = "...";
InitializeComponent();

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2014 Clemens Fischer")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("2.3.1")]
[assembly: AssemblyFileVersion("2.3.1")]
[assembly: AssemblyVersion("2.4.0")]
[assembly: AssemblyFileVersion("2.4.0")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]

View file

@ -32,7 +32,8 @@
<map:TileSource UriFormat="http://{c}.tile.thunderforest.com/transport/{z}/{x}/{y}.png"/>
</map:TileLayer>
<map:TileLayer SourceName="Thunderforest Transport Dark"
Description="Maps © [Thunderforest](http://www.thunderforest.com/), Data © [OpenStreetMap Contributors](http://www.openstreetmap.org/copyright)">
Description="Maps © [Thunderforest](http://www.thunderforest.com/), Data © [OpenStreetMap Contributors](http://www.openstreetmap.org/copyright)"
Foreground="White" Background="Black">
<map:TileSource UriFormat="http://{c}.tile.thunderforest.com/transport-dark/{z}/{x}/{y}.png"/>
</map:TileLayer>
<map:TileLayer SourceName="MapQuest OpenStreetMap"

View file

@ -11,8 +11,9 @@ namespace StoreApplication
public MainPage()
{
//TileImageLoader.Cache = new ImageFileCache();
//BingMapsTileLayer.ApiKey = ...
//TileImageLoader.Cache = new MapControl.Caching.ImageFileCache();
//TileImageLoader.Cache = new MapControl.Caching.FileDbCache();
//BingMapsTileLayer.ApiKey = "...";
this.InitializeComponent();

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest">
<Identity Name="199e6e5e-60fe-46b4-a699-07c78f31849c" Publisher="CN=Clemens" Version="1.1.0.0" />
<Identity Name="XamlMapControl.StoreApp" Publisher="CN=Clemens" Version="2.4.0.0" />
<Properties>
<DisplayName>StoreApplication</DisplayName>
<DisplayName>XAML Map Control Store Application</DisplayName>
<PublisherDisplayName>Clemens</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
@ -15,7 +15,7 @@
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="StoreApplication.App">
<m2:VisualElements DisplayName="StoreApplication" Description="StoreApplication" BackgroundColor="#464646" ForegroundText="light" Square150x150Logo="Assets\Logo.png" Square30x30Logo="Assets\SmallLogo.png">
<m2:VisualElements DisplayName="XAML Map Control Test Application" Description="StoreApplication" BackgroundColor="#464646" ForegroundText="light" Square150x150Logo="Assets\Logo.png" Square30x30Logo="Assets\SmallLogo.png">
<m2:DefaultTile>
<m2:ShowNameOnTiles>
<m2:ShowOn Tile="square150x150Logo" />

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2014 Clemens Fischer")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("2.3.1")]
[assembly: AssemblyFileVersion("2.3.1")]
[assembly: AssemblyVersion("2.4.0")]
[assembly: AssemblyFileVersion("2.4.0")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]

View file

@ -16,6 +16,7 @@
<TargetPlatformVersion>8.1</TargetPlatformVersion>
<MinimumVisualStudioVersion>12</MinimumVisualStudioVersion>
<TargetFrameworkVersion />
<AppxBundle>Always</AppxBundle>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@ -78,6 +79,14 @@
</Page>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Caching\FileDbCache.WinRT\FileDbCache.WinRT.csproj">
<Project>{c7bf2b18-cc74-430b-bcb2-600304efa3d8}</Project>
<Name>FileDbCache.WinRT</Name>
</ProjectReference>
<ProjectReference Include="..\..\Caching\ImageFileCache.WinRT\ImageFileCache.WinRT.csproj">
<Project>{f789647e-96f7-43e3-a895-fa3fe8d01260}</Project>
<Name>ImageFileCache.WinRT</Name>
</ProjectReference>
<ProjectReference Include="..\..\MapControl\WinRT\MapControl.WinRT.csproj">
<Project>{63cefdf7-5170-43b6-86f8-5c4a383a1615}</Project>
<Name>MapControl.WinRT</Name>

View file

@ -1,17 +1,5 @@
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="WpfApplication.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<applicationSettings>
<WpfApplication.Properties.Settings>
<setting name="TileCache" serializeAs="String">
<value />
</setting>
</WpfApplication.Properties.Settings>
</applicationSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>

View file

@ -31,14 +31,14 @@
<map:TileLayer SourceName="Thunderforest Transport Dark"
Description="Maps © [Thunderforest](http://www.thunderforest.com/), Data © [OpenStreetMap Contributors](http://www.openstreetmap.org/copyright)"
TileSource="http://{c}.tile.thunderforest.com/transport-dark/{z}/{x}/{y}.png"
Background="Black" Foreground="White"/>
Foreground="White" Background="Black"/>
<map:TileLayer SourceName="MapQuest OpenStreetMap"
Description="Maps © [MapQuest](http://www.mapquest.com/), Data © [OpenStreetMap Contributors](http://www.openstreetmap.org/copyright)"
TileSource="http://otile{n}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png"
MaxZoomLevel="19"/>
<map:TileLayer SourceName="Seamarks"
TileSource="http://tiles.openseamap.org/seamark/{z}/{x}/{y}.png"
MinZoomLevel="10" MaxZoomLevel="18"/>
MinZoomLevel="9" MaxZoomLevel="18"/>
<!--
Bing Maps TileLayers with tile URLs retrieved from the Imagery Metadata Service
@ -66,7 +66,7 @@
<!--
A TileLayer that uses an ImageTileSource, which bypasses caching of map tile images
-->
<!--<map:TileLayer SourceName="OSM Uncached"
<!--<map:TileLayer SourceName="OpenStreetMap No Cache"
Description="© [OpenStreetMap Contributors](http://www.openstreetmap.org/copyright)">
<map:ImageTileSource IsAsync="True" UriFormat="http://{c}.tile.openstreetmap.org/{z}/{x}/{y}.png"/>
</map:TileLayer>-->
@ -189,7 +189,7 @@
Source="10_535_330.jpg" Opacity="0.5"/>
<map:MapGraticule Opacity="0.6"/>
<map:MapScale Margin="4" Opacity="0.8" HorizontalAlignment="Left"/>
<map:MapScale Margin="4" Opacity="0.8" HorizontalAlignment="Left" Background="Transparent"/>
<!-- use ItemTemplate or ItemContainerStyle alternatively -->
<map:MapItemsControl ItemsSource="{Binding Polylines}"
@ -206,6 +206,12 @@
ItemContainerStyle="{StaticResource PushpinItemStyle}"
IsSynchronizedWithCurrentItem="True"/>
<Path map:MapPanel.Location="53.5,8.2" Stroke="Blue" StrokeThickness="3" Fill="#1F007F00">
<Path.Data>
<EllipseGeometry RadiusX="1852" RadiusY="1852" Transform="{Binding ScaleTransform, ElementName=map}"/>
</Path.Data>
</Path>
<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}">
@ -214,16 +220,12 @@
</MultiBinding>
</map:Pushpin.Visibility>
</map:Pushpin>
<Path map:MapPanel.Location="53.5,8.2" Stroke="Blue" StrokeThickness="3" HorizontalAlignment="Left" VerticalAlignment="Top">
<Path.Data>
<EllipseGeometry RadiusX="1852" RadiusY="1852" Transform="{Binding ScaleTransform, ElementName=map}"/>
</Path.Data>
</Path>
</map:Map>
<Border HorizontalAlignment="Right" VerticalAlignment="Bottom" Background="#7FFFFFFF">
<TextBlock x:Name="mapLegend" Margin="2" FontSize="10"/>
</Border>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition/>

View file

@ -1,11 +1,10 @@
using System;
using System.Globalization;
using System.Runtime.Caching;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using Caching;
using MapControl;
using MapControl.Caching;
namespace WpfApplication
{
@ -15,25 +14,10 @@ namespace WpfApplication
public MainWindow()
{
switch (Properties.Settings.Default.TileCache)
{
case "MemoryCache":
TileImageLoader.Cache = MemoryCache.Default; // this is the default value of the TileImageLoader.Cache property
break;
case "ImageFileCache":
TileImageLoader.Cache = new ImageFileCache(TileImageLoader.DefaultCacheName, TileImageLoader.DefaultCacheDirectory);
break;
case "FileDbCache":
TileImageLoader.Cache = new FileDbCache(TileImageLoader.DefaultCacheName, TileImageLoader.DefaultCacheDirectory);
break;
case "None":
TileImageLoader.Cache = null;
break;
default:
break;
}
//BingMapsTileLayer.ApiKey = ...
//TileImageLoader.Cache = new ImageFileCache(TileImageLoader.DefaultCacheName, TileImageLoader.DefaultCacheFolder);
//TileImageLoader.Cache = new FileDbCache(TileImageLoader.DefaultCacheName, TileImageLoader.DefaultCacheFolder);
//TileImageLoader.HttpUserAgent = "...";
//BingMapsTileLayer.ApiKey = "...";
InitializeComponent();
@ -105,7 +89,7 @@ namespace WpfApplication
{
var selectedItem = (ComboBoxItem)tileLayerComboBox.SelectedItem;
map.TileLayer = tileLayers[(string)selectedItem.Tag];
map.TileLayer = tileLayers[(string)selectedItem.Tag];
mapLegend.Inlines.Clear();
mapLegend.Inlines.AddRange(map.TileLayer.DescriptionInlines);

View file

@ -7,8 +7,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Clemens Fischer")]
[assembly: AssemblyCopyright("Copyright © 2014 Clemens Fischer")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("2.3.1")]
[assembly: AssemblyFileVersion("2.3.1")]
[assembly: AssemblyVersion("2.4.0")]
[assembly: AssemblyFileVersion("2.4.0")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]

View file

@ -1,35 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WpfApplication.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string TileCache {
get {
return ((string)(this["TileCache"]));
}
}
}
}

View file

@ -1,9 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="WpfApplication.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="TileCache" Type="System.String" Scope="Application">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>

View file

@ -23,6 +23,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@ -32,6 +33,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
@ -70,28 +72,19 @@
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Caching\FileDbCache\FileDbCache.csproj">
<ProjectReference Include="..\..\Caching\FileDbCache.WPF\FileDbCache.WPF.csproj">
<Project>{ef44f661-b98a-4676-927f-85d138f82300}</Project>
<Name>FileDbCache</Name>
<Name>FileDbCache.WPF</Name>
</ProjectReference>
<ProjectReference Include="..\..\Caching\ImageFileCache\ImageFileCache.csproj">
<ProjectReference Include="..\..\Caching\ImageFileCache.WPF\ImageFileCache.WPF.csproj">
<Project>{86470440-fee2-4120-af5a-3762fb9c536f}</Project>
<Name>ImageFileCache</Name>
<Name>ImageFileCache.WPF</Name>
</ProjectReference>
<ProjectReference Include="..\..\MapControl\MapControl.WPF.csproj">
<Project>{226f3575-b683-446d-a2f0-181291dc8787}</Project>