From 5eafa751f8f8287dec8e94fe07aea1fef112fb4c Mon Sep 17 00:00:00 2001 From: ClemensF Date: Sun, 17 Nov 2013 16:52:03 +0100 Subject: [PATCH] Version 1.9.0: - added MapBase.ZoomToBounds method - fixed coercing property values in MapBase - improved Location property handling in MapPanel to keep viewport positions near map center - use common view model in sample applications --- .../FileDbCache/Properties/AssemblyInfo.cs | 4 +- .../ImageFileCache/Properties/AssemblyInfo.cs | 4 +- MapControl/MapBase.cs | 106 ++++++---- MapControl/MapGraticule.Silverlight.WinRT.cs | 7 +- MapControl/MapPanel.cs | 17 ++ MapControl/Properties/AssemblyInfo.cs | 4 +- MapControl/TileContainer.Silverlight.WinRT.cs | 4 +- MapControl/TileContainer.WPF.cs | 4 +- MapControl/TileContainer.cs | 2 +- MapControl/TileImageLoader.WPF.cs | 6 +- MapControl/TileLayer.cs | 2 +- MapControl/TileSource.cs | 5 + MapControl/WinRT/Properties/AssemblyInfo.cs | 4 +- .../10_535_330.jpg | Bin SampleApps/Common/ViewModel.cs | 191 ++++++++++++++++++ .../Properties/AssemblyInfo.cs | 4 +- .../SilverlightApplication/MainPage.xaml | 19 +- .../SilverlightApplication/MainPage.xaml.cs | 103 +--------- .../Properties/AssemblyInfo.cs | 4 +- .../SilverlightApplication/SampleItems.cs | 51 ----- .../SilverlightApplication.csproj | 8 +- SampleApps/StoreApplication/10_535_330.jpg | Bin 7174 -> 0 bytes SampleApps/StoreApplication/MainPage.xaml | 20 +- SampleApps/StoreApplication/MainPage.xaml.cs | 107 +--------- .../Properties/AssemblyInfo.cs | 4 +- SampleApps/StoreApplication/SampleItems.cs | 51 ----- .../StoreApplication/StoreApplication.csproj | 8 +- .../Properties/AssemblyInfo.cs | 4 +- SampleApps/WpfApplication/10_535_330.jpg | Bin 7174 -> 0 bytes SampleApps/WpfApplication/App.config | 2 +- SampleApps/WpfApplication/MainWindow.xaml | 40 ++-- SampleApps/WpfApplication/MainWindow.xaml.cs | 107 +--------- .../WpfApplication/Properties/AssemblyInfo.cs | 4 +- .../Properties/Settings.Designer.cs | 4 +- .../Properties/Settings.settings | 2 +- SampleApps/WpfApplication/SampleItems.cs | 51 ----- .../WpfApplication/WpfApplication.csproj | 9 +- 37 files changed, 391 insertions(+), 571 deletions(-) rename SampleApps/{SilverlightApplication => Common}/10_535_330.jpg (100%) create mode 100644 SampleApps/Common/ViewModel.cs delete mode 100644 SampleApps/SilverlightApplication/SampleItems.cs delete mode 100644 SampleApps/StoreApplication/10_535_330.jpg delete mode 100644 SampleApps/StoreApplication/SampleItems.cs delete mode 100644 SampleApps/WpfApplication/10_535_330.jpg delete mode 100644 SampleApps/WpfApplication/SampleItems.cs diff --git a/Caching/FileDbCache/Properties/AssemblyInfo.cs b/Caching/FileDbCache/Properties/AssemblyInfo.cs index c22cc179..75a45f2a 100644 --- a/Caching/FileDbCache/Properties/AssemblyInfo.cs +++ b/Caching/FileDbCache/Properties/AssemblyInfo.cs @@ -8,8 +8,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © Clemens Fischer 2012-2013")] [assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("1.8.0")] -[assembly: AssemblyFileVersion("1.8.0")] +[assembly: AssemblyVersion("1.9.0")] +[assembly: AssemblyFileVersion("1.9.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/Caching/ImageFileCache/Properties/AssemblyInfo.cs b/Caching/ImageFileCache/Properties/AssemblyInfo.cs index 244d27ac..f44ac956 100644 --- a/Caching/ImageFileCache/Properties/AssemblyInfo.cs +++ b/Caching/ImageFileCache/Properties/AssemblyInfo.cs @@ -8,8 +8,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © Clemens Fischer 2012-2013")] [assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("1.8.0")] -[assembly: AssemblyFileVersion("1.8.0")] +[assembly: AssemblyVersion("1.9.0")] +[assembly: AssemblyFileVersion("1.9.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/MapControl/MapBase.cs b/MapControl/MapBase.cs index 391e3f9a..ad16a8fd 100644 --- a/MapControl/MapBase.cs +++ b/MapControl/MapBase.cs @@ -405,6 +405,27 @@ namespace MapControl } } + /// + /// Sets the TargetZoomLevel and TargetCenter properties such that the specified bounding box + /// fits into the current viewport. The TargetHeading property is set to zero. + /// + public void ZoomToBounds(Location southWest, Location northEast) + { + if (southWest.Latitude < northEast.Latitude && southWest.Longitude < northEast.Longitude) + { + var p1 = MapTransform.Transform(southWest); + var p2 = MapTransform.Transform(northEast); + var lonScale = ActualWidth / (p2.X - p1.X) * 360d / TileSource.TileSize; + var latScale = ActualHeight / (p2.Y - p1.Y) * 360d / TileSource.TileSize; + var lonZoom = Math.Log(lonScale, 2d); + var latZoom = Math.Log(latScale, 2d); + + TargetZoomLevel = Math.Min(lonZoom, latZoom); + TargetCenter = MapTransform.Transform(new Point((p1.X + p2.X) / 2d, (p1.Y + p2.Y) / 2d)); + TargetHeading = 0d; + } + } + protected override void OnViewportChanged() { base.OnViewportChanged(); @@ -551,8 +572,14 @@ namespace MapControl internalPropertyChange = false; } - private bool CoerceLocation(Location location, double latitudeEpsilon = 0d) + private bool CoerceLocation(ref Location location, double latitudeEpsilon = 0d) { + if (location == null) + { + location = new Location(); + return true; + } + var maxLatitude = mapTransform.MaxLatitude + latitudeEpsilon; var latitude = Math.Min(Math.Max(location.Latitude, -maxLatitude), maxLatitude); var longitude = Location.NormalizeLongitude(location.Longitude); @@ -567,9 +594,9 @@ namespace MapControl return false; } - private void CoerceCenterProperty(DependencyProperty property, Location center) + private void CoerceCenterProperty(DependencyProperty property, ref Location center) { - if (CoerceLocation(center)) + if (CoerceLocation(ref center)) { InternalSetValue(property, center); } @@ -579,7 +606,7 @@ namespace MapControl { if (!internalPropertyChange) { - CoerceCenterProperty(CenterProperty, center); + CoerceCenterProperty(CenterProperty, ref center); ResetTransformOrigin(); UpdateTransform(); @@ -595,9 +622,9 @@ namespace MapControl { if (!internalPropertyChange) { - CoerceCenterProperty(TargetCenterProperty, targetCenter); + CoerceCenterProperty(TargetCenterProperty, ref targetCenter); - if (!targetCenter.Equals(Center)) + if (targetCenter.Latitude != Center.Latitude || targetCenter.Longitude != Center.Longitude) { if (centerAnimation != null) { @@ -652,9 +679,11 @@ namespace MapControl if (coercedValue != minZoomLevel) { - InternalSetValue(MinZoomLevelProperty, coercedValue); + minZoomLevel = coercedValue; + InternalSetValue(MinZoomLevelProperty, minZoomLevel); } - else if (ZoomLevel < minZoomLevel) + + if (ZoomLevel < minZoomLevel) { ZoomLevel = minZoomLevel; } @@ -666,32 +695,32 @@ namespace MapControl if (coercedValue != maxZoomLevel) { - InternalSetValue(MaxZoomLevelProperty, coercedValue); + maxZoomLevel = coercedValue; + InternalSetValue(MaxZoomLevelProperty, maxZoomLevel); } - else if (ZoomLevel > maxZoomLevel) + + if (ZoomLevel > maxZoomLevel) { ZoomLevel = maxZoomLevel; } } - private bool CoerceZoomLevelProperty(DependencyProperty property, ref double zoomLevel) + private void CoerceZoomLevelProperty(DependencyProperty property, ref double zoomLevel) { var coercedValue = Math.Min(Math.Max(zoomLevel, MinZoomLevel), MaxZoomLevel); if (coercedValue != zoomLevel) { - InternalSetValue(property, coercedValue); - return true; + zoomLevel = coercedValue; + InternalSetValue(property, zoomLevel); } - - return false; } private void ZoomLevelPropertyChanged(double zoomLevel) { - if (!internalPropertyChange && - !CoerceZoomLevelProperty(ZoomLevelProperty, ref zoomLevel)) + if (!internalPropertyChange) { + CoerceZoomLevelProperty(ZoomLevelProperty, ref zoomLevel); UpdateTransform(); if (zoomLevelAnimation == null) @@ -703,25 +732,28 @@ namespace MapControl private void TargetZoomLevelPropertyChanged(double targetZoomLevel) { - if (!internalPropertyChange && - !CoerceZoomLevelProperty(TargetZoomLevelProperty, ref targetZoomLevel) && - targetZoomLevel != ZoomLevel) + if (!internalPropertyChange) { - if (zoomLevelAnimation != null) + CoerceZoomLevelProperty(TargetZoomLevelProperty, ref targetZoomLevel); + + if (targetZoomLevel != ZoomLevel) { - zoomLevelAnimation.Completed -= ZoomLevelAnimationCompleted; + if (zoomLevelAnimation != null) + { + zoomLevelAnimation.Completed -= ZoomLevelAnimationCompleted; + } + + zoomLevelAnimation = new DoubleAnimation + { + To = targetZoomLevel, + Duration = AnimationDuration, + EasingFunction = AnimationEasingFunction, + FillBehavior = FillBehavior.HoldEnd + }; + + zoomLevelAnimation.Completed += ZoomLevelAnimationCompleted; + this.BeginAnimation(ZoomLevelProperty, zoomLevelAnimation); } - - zoomLevelAnimation = new DoubleAnimation - { - To = targetZoomLevel, - Duration = AnimationDuration, - EasingFunction = AnimationEasingFunction, - FillBehavior = FillBehavior.HoldEnd - }; - - zoomLevelAnimation.Completed += ZoomLevelAnimationCompleted; - this.BeginAnimation(ZoomLevelProperty, zoomLevelAnimation); } } @@ -742,12 +774,12 @@ namespace MapControl private void CoerceHeadingProperty(DependencyProperty property, ref double heading) { - var coercedValue = (heading >= -180d && heading <= 360d) ? - heading : (((heading % 360d) + 360d) % 360d); + var coercedValue = (heading >= -180d && heading <= 360d) ? heading : (((heading % 360d) + 360d) % 360d); if (coercedValue != heading) { - InternalSetValue(property, coercedValue); + heading = coercedValue; + InternalSetValue(property, heading); } } @@ -826,7 +858,7 @@ namespace MapControl { center = ViewportPointToLocation(new Point(RenderSize.Width / 2d, RenderSize.Height / 2d)); - var coerced = CoerceLocation(center, 1e-3); + var coerced = CoerceLocation(ref center, 1e-3); InternalSetValue(CenterProperty, center); diff --git a/MapControl/MapGraticule.Silverlight.WinRT.cs b/MapControl/MapGraticule.Silverlight.WinRT.cs index 50e0b5b7..9d6599bc 100644 --- a/MapControl/MapGraticule.Silverlight.WinRT.cs +++ b/MapControl/MapGraticule.Silverlight.WinRT.cs @@ -226,7 +226,6 @@ namespace MapControl { for (var lon = labelsStart.Longitude; lon <= end.Longitude; lon += spacing) { - var location = new Location(lat, lon); TextBlock label; if (childIndex < Children.Count) @@ -273,13 +272,17 @@ namespace MapControl { transformGroup.Children.Add(new TranslateTransform()); transformGroup.Children.Add(ParentMap.RotateTransform); + transformGroup.Children.Add(new TranslateTransform()); } var translateTransform = (TranslateTransform)transformGroup.Children[0]; translateTransform.X = StrokeThickness / 2d + 2d; translateTransform.Y = -label.DesiredSize.Height / 2d; - MapPanel.SetLocation(label, location); + var viewportPosition = ParentMap.LocationToViewportPoint(new Location(lat, lon)); + translateTransform = (TranslateTransform)transformGroup.Children[2]; + translateTransform.X = viewportPosition.X; + translateTransform.Y = viewportPosition.Y; } } diff --git a/MapControl/MapPanel.cs b/MapControl/MapPanel.cs index 234aa69c..b8f0eb4d 100644 --- a/MapControl/MapPanel.cs +++ b/MapControl/MapPanel.cs @@ -151,6 +151,23 @@ namespace MapControl if (parentMap != null && location != null) { + var longitude = Location.NormalizeLongitude(location.Longitude); + var centerDistance = longitude - parentMap.Center.Longitude; + + if (centerDistance > 180d) + { + longitude -= 360d; + } + else if (centerDistance < -180d) + { + longitude += 360d; + } + + if (location.Longitude != longitude) // keep viewport position near map center + { + location = new Location(location.Latitude, longitude); + } + viewportPosition = parentMap.LocationToViewportPoint(location); element.SetValue(ViewportPositionProperty, viewportPosition); } diff --git a/MapControl/Properties/AssemblyInfo.cs b/MapControl/Properties/AssemblyInfo.cs index 39d82727..095b20b5 100644 --- a/MapControl/Properties/AssemblyInfo.cs +++ b/MapControl/Properties/AssemblyInfo.cs @@ -15,8 +15,8 @@ using System.Windows; [assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © Clemens Fischer 2012-2013")] [assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("1.8.0")] -[assembly: AssemblyFileVersion("1.8.0")] +[assembly: AssemblyVersion("1.9.0")] +[assembly: AssemblyFileVersion("1.9.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/MapControl/TileContainer.Silverlight.WinRT.cs b/MapControl/TileContainer.Silverlight.WinRT.cs index 3be445ed..22da03c5 100644 --- a/MapControl/TileContainer.Silverlight.WinRT.cs +++ b/MapControl/TileContainer.Silverlight.WinRT.cs @@ -17,8 +17,10 @@ namespace MapControl { internal partial class TileContainer : Panel { - private Matrix GetViewportTransformMatrix(Matrix transform) + private Matrix GetViewportTransformMatrix(double scale, double offsetX, double offsetY) { + var transform = new Matrix(scale, 0d, 0d, -scale, offsetX, offsetY); + return transform.RotateAt(rotation, viewportOrigin.X, viewportOrigin.Y); } diff --git a/MapControl/TileContainer.WPF.cs b/MapControl/TileContainer.WPF.cs index 9a87e1c4..dc9a415b 100644 --- a/MapControl/TileContainer.WPF.cs +++ b/MapControl/TileContainer.WPF.cs @@ -9,8 +9,10 @@ namespace MapControl { internal partial class TileContainer : ContainerVisual { - private Matrix GetViewportTransformMatrix(Matrix transform) + private Matrix GetViewportTransformMatrix(double scale, double offsetX, double offsetY) { + var transform = new Matrix(scale, 0d, 0d, -scale, offsetX, offsetY); + transform.RotateAt(rotation, viewportOrigin.X, viewportOrigin.Y); return transform; diff --git a/MapControl/TileContainer.cs b/MapControl/TileContainer.cs index 667789bf..054bd91f 100644 --- a/MapControl/TileContainer.cs +++ b/MapControl/TileContainer.cs @@ -101,7 +101,7 @@ namespace MapControl tileLayerOffset.X = transformOffsetX - 180d * scale; tileLayerOffset.Y = transformOffsetY - 180d * scale; - ViewportTransform.Matrix = GetViewportTransformMatrix(new Matrix(scale, 0d, 0d, -scale, transformOffsetX, transformOffsetY)); + ViewportTransform.Matrix = GetViewportTransformMatrix(scale, transformOffsetX, transformOffsetY); if (Math.Sign(mapOrigin.X) != Math.Sign(oldMapOriginX) && Math.Abs(mapOrigin.X) > 90d) { diff --git a/MapControl/TileImageLoader.WPF.cs b/MapControl/TileImageLoader.WPF.cs index cfac5dec..8ae081a3 100644 --- a/MapControl/TileImageLoader.WPF.cs +++ b/MapControl/TileImageLoader.WPF.cs @@ -104,7 +104,7 @@ namespace MapControl return; } } - else if (!tileSource.UriFormat.StartsWith("file:")) // always load local image files asynchronously + else if (!tileSource.UriFormat.StartsWith("file:")) // load local image files asynchronously, without caching { if (Cache == null || string.IsNullOrWhiteSpace(sourceName)) { @@ -183,7 +183,7 @@ namespace MapControl if (uri != null) { - if (uri.Scheme == "file") + if (uri.Scheme == "file") // create from FileStream as creating from URI leaves the file open { image = CreateImage(uri.AbsolutePath); } @@ -256,7 +256,7 @@ namespace MapControl { try { - using (var stream = new FileStream(path, FileMode.Open)) + using (var stream = new FileStream(path, FileMode.Open, FileAccess.Read)) { image = BitmapFrame.Create(stream, BitmapCreateOptions.None, BitmapCacheOption.OnLoad); } diff --git a/MapControl/TileLayer.cs b/MapControl/TileLayer.cs index 615c8bac..e68f0649 100644 --- a/MapControl/TileLayer.cs +++ b/MapControl/TileLayer.cs @@ -48,7 +48,7 @@ namespace MapControl public TileLayer() { - MinZoomLevel = 1; + MinZoomLevel = 0; MaxZoomLevel = 18; MaxParallelDownloads = 8; LoadLowerZoomLevels = true; diff --git a/MapControl/TileSource.cs b/MapControl/TileSource.cs index be2f4f21..948f3dc3 100644 --- a/MapControl/TileSource.cs +++ b/MapControl/TileSource.cs @@ -145,6 +145,11 @@ namespace MapControl private Uri GetQuadKeyUri(int x, int y, int zoomLevel) { + if (zoomLevel < 1) + { + return null; + } + var key = new StringBuilder { Length = zoomLevel }; for (var z = zoomLevel - 1; z >= 0; z--, x /= 2, y /= 2) diff --git a/MapControl/WinRT/Properties/AssemblyInfo.cs b/MapControl/WinRT/Properties/AssemblyInfo.cs index e3f48ad2..1cdf1020 100644 --- a/MapControl/WinRT/Properties/AssemblyInfo.cs +++ b/MapControl/WinRT/Properties/AssemblyInfo.cs @@ -8,8 +8,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © Clemens Fischer 2012-2013")] [assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("1.8.0")] -[assembly: AssemblyFileVersion("1.8.0")] +[assembly: AssemblyVersion("1.9.0")] +[assembly: AssemblyFileVersion("1.9.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/SampleApps/SilverlightApplication/10_535_330.jpg b/SampleApps/Common/10_535_330.jpg similarity index 100% rename from SampleApps/SilverlightApplication/10_535_330.jpg rename to SampleApps/Common/10_535_330.jpg diff --git a/SampleApps/Common/ViewModel.cs b/SampleApps/Common/ViewModel.cs new file mode 100644 index 00000000..5b18d00d --- /dev/null +++ b/SampleApps/Common/ViewModel.cs @@ -0,0 +1,191 @@ +using System; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Linq; +#if NETFX_CORE +using Windows.UI.Xaml; +#else +using System.Windows.Threading; +#endif +using MapControl; + +namespace ViewModel +{ + public class VmBase : INotifyPropertyChanged + { + public event PropertyChangedEventHandler PropertyChanged; + + protected void OnPropertyChanged(string propertyName) + { + if (PropertyChanged != null) + { + PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + } + + public class VmPoint : VmBase + { + private string name; + public string Name + { + get { return name; } + set + { + name = value; + OnPropertyChanged("Name"); + } + } + + private Location location; + public Location Location + { + get { return location; } + set + { + location = value; + OnPropertyChanged("Location"); + } + } + } + + public class VmPolyline + { + public LocationCollection Locations { get; set; } + } + + public class ViewModel : VmBase + { + public ObservableCollection Points { get; set; } + public ObservableCollection Pushpins { get; set; } + public ObservableCollection Polylines { get; set; } + + private Location mapCenter; + public Location MapCenter + { + get { return mapCenter; } + set + { + mapCenter = value; + OnPropertyChanged("MapCenter"); + } + } + + public ViewModel() + { + MapCenter = new Location(53.5, 8.2); + + Points = new ObservableCollection(); + Points.Add( + new VmPoint + { + Name = "Steinbake Leitdamm", + Location = new Location(53.51217, 8.16603) + }); + Points.Add( + new VmPoint + { + Name = "Buhne 2", + Location = new Location(53.50926, 8.15815) + }); + Points.Add( + new VmPoint + { + Name = "Buhne 4", + Location = new Location(53.50468, 8.15343) + }); + Points.Add( + new VmPoint + { + Name = "Buhne 6", + Location = new Location(53.50092, 8.15267) + }); + Points.Add( + new VmPoint + { + Name = "Buhne 8", + Location = new Location(53.49871, 8.15321) + }); + Points.Add( + new VmPoint + { + Name = "Buhne 10", + Location = new Location(53.49350, 8.15563) + }); + Points.Add( + new VmPoint + { + Name = "Moving", + Location = new Location(53.5, 8.25) + }); + + Pushpins = new ObservableCollection(); + Pushpins.Add( + new VmPoint + { + Name = "WHV - Eckwarderhörne", + Location = new Location(53.5495, 8.1877) + }); + Pushpins.Add( + new VmPoint + { + Name = "JadeWeserPort", + Location = new Location(53.5914, 8.14) + }); + Pushpins.Add( + new VmPoint + { + Name = "Kurhaus Dangast", + Location = new Location(53.447, 8.1114) + }); + Pushpins.Add( + new VmPoint + { + Name = "Eckwarderhörne", + Location = new Location(53.5207, 8.2323) + }); + + //for (double lon = -720; lon <= 720; lon += 15) + //{ + // var lat = lon / 10; + // Pushpins.Add( + // new VmPoint + // { + // Name = string.Format("{0:00.0}°, {1:000}°", lat, lon), + // Location = new Location(lat, lon) + // }); + //} + + Polylines = new ObservableCollection(); + Polylines.Add( + new VmPolyline + { + Locations = LocationCollection.Parse("53.5140,8.1451 53.5123,8.1506 53.5156,8.1623 53.5276,8.1757 53.5491,8.1852 53.5495,8.1877 53.5426,8.1993 53.5184,8.2219 53.5182,8.2386 53.5195,8.2387") + }); + Polylines.Add( + new VmPolyline + { + Locations = LocationCollection.Parse("53.5978,8.1212 53.6018,8.1494 53.5859,8.1554 53.5852,8.1531 53.5841,8.1539 53.5802,8.1392 53.5826,8.1309 53.5867,8.1317 53.5978,8.1212") + }); + + var timer = new DispatcherTimer + { + Interval = TimeSpan.FromSeconds(0.1) + }; + + timer.Tick += (sender, e) => + { + var p = Points.Last(); + p.Location = new Location(p.Location.Latitude + 0.001, p.Location.Longitude + 0.002); + + if (p.Location.Latitude > 54d) + { + p.Name = "Stopped"; + ((DispatcherTimer)sender).Stop(); + } + }; + + timer.Start(); + } + } +} diff --git a/SampleApps/SilverlightApplication.Web/Properties/AssemblyInfo.cs b/SampleApps/SilverlightApplication.Web/Properties/AssemblyInfo.cs index 4d0e3823..35521462 100644 --- a/SampleApps/SilverlightApplication.Web/Properties/AssemblyInfo.cs +++ b/SampleApps/SilverlightApplication.Web/Properties/AssemblyInfo.cs @@ -8,8 +8,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © Clemens Fischer 2012-2013")] [assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("1.8.0")] -[assembly: AssemblyFileVersion("1.8.0")] +[assembly: AssemblyVersion("1.9.0")] +[assembly: AssemblyFileVersion("1.9.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/SampleApps/SilverlightApplication/MainPage.xaml b/SampleApps/SilverlightApplication/MainPage.xaml index 1901d701..734127a4 100644 --- a/SampleApps/SilverlightApplication/MainPage.xaml +++ b/SampleApps/SilverlightApplication/MainPage.xaml @@ -4,8 +4,9 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:map="clr-namespace:MapControl;assembly=MapControl.Silverlight" xmlns:sys="clr-namespace:System;assembly=mscorlib" + xmlns:map="clr-namespace:MapControl;assembly=MapControl.Silverlight" + xmlns:vm="clr-namespace:ViewModel" xmlns:local="clr-namespace:SilverlightApplication" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> @@ -93,32 +94,32 @@ - - - + + + - - - - - diff --git a/SampleApps/SilverlightApplication/MainPage.xaml.cs b/SampleApps/SilverlightApplication/MainPage.xaml.cs index e8008c0a..5b09b9ce 100644 --- a/SampleApps/SilverlightApplication/MainPage.xaml.cs +++ b/SampleApps/SilverlightApplication/MainPage.xaml.cs @@ -1,118 +1,17 @@ -using System; -using System.Collections.Generic; -using System.Globalization; +using System.Globalization; using System.Windows; using System.Windows.Controls; using System.Windows.Input; -using System.Windows.Threading; using MapControl; namespace SilverlightApplication { public partial class MainPage : UserControl { - private SamplePoint movingPoint = new SamplePoint - { - Name = "Moving", - Location = new Location(53.5, 8.25) - }; - public MainPage() { InitializeComponent(); tileLayerComboBox.SelectedIndex = 0; - - var polylines = (ICollection)Resources["Polylines"]; - polylines.Add( - new SamplePolyline - { - Locations = LocationCollection.Parse("53.5140,8.1451 53.5123,8.1506 53.5156,8.1623 53.5276,8.1757 53.5491,8.1852 53.5495,8.1877 53.5426,8.1993 53.5184,8.2219 53.5182,8.2386 53.5195,8.2387") - }); - polylines.Add( - new SamplePolyline - { - Locations = LocationCollection.Parse("53.5978,8.1212 53.6018,8.1494 53.5859,8.1554 53.5852,8.1531 53.5841,8.1539 53.5802,8.1392 53.5826,8.1309 53.5867,8.1317 53.5978,8.1212") - }); - - var points = (ICollection)Resources["Points"]; - points.Add( - new SamplePoint - { - Name = "Steinbake Leitdamm", - Location = new Location(53.51217, 8.16603) - }); - points.Add( - new SamplePoint - { - Name = "Buhne 2", - Location = new Location(53.50926, 8.15815) - }); - points.Add( - new SamplePoint - { - Name = "Buhne 4", - Location = new Location(53.50468, 8.15343) - }); - points.Add( - new SamplePoint - { - Name = "Buhne 6", - Location = new Location(53.50092, 8.15267) - }); - points.Add( - new SamplePoint - { - Name = "Buhne 8", - Location = new Location(53.49871, 8.15321) - }); - points.Add( - new SamplePoint - { - Name = "Buhne 10", - Location = new Location(53.49350, 8.15563) - }); - points.Add(movingPoint); - - var pushpins = (ICollection)Resources["Pushpins"]; - pushpins.Add( - new SamplePoint - { - Name = "WHV - Eckwarderhörne", - Location = new Location(53.5495, 8.1877) - }); - pushpins.Add( - new SamplePoint - { - Name = "JadeWeserPort", - Location = new Location(53.5914, 8.14) - }); - pushpins.Add( - new SamplePoint - { - Name = "Kurhaus Dangast", - Location = new Location(53.447, 8.1114) - }); - pushpins.Add( - new SamplePoint - { - Name = "Eckwarderhörne", - Location = new Location(53.5207, 8.2323) - }); - - var timer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(0.1) }; - timer.Tick += MovePoint; - timer.Start(); - } - - private void MovePoint(object sender, EventArgs e) - { - movingPoint.Location = new Location(movingPoint.Location.Latitude + 0.001, movingPoint.Location.Longitude + 0.002); - - if (movingPoint.Location.Latitude > 54d) - { - movingPoint.Name = "Stopped"; - ((DispatcherTimer)sender).Stop(); - } } private void MapMouseLeave(object sender, MouseEventArgs e) diff --git a/SampleApps/SilverlightApplication/Properties/AssemblyInfo.cs b/SampleApps/SilverlightApplication/Properties/AssemblyInfo.cs index 56c8f888..cd747fbf 100644 --- a/SampleApps/SilverlightApplication/Properties/AssemblyInfo.cs +++ b/SampleApps/SilverlightApplication/Properties/AssemblyInfo.cs @@ -8,8 +8,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © Clemens Fischer 2012-2013")] [assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("1.8.0")] -[assembly: AssemblyFileVersion("1.8.0")] +[assembly: AssemblyVersion("1.9.0")] +[assembly: AssemblyFileVersion("1.9.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/SampleApps/SilverlightApplication/SampleItems.cs b/SampleApps/SilverlightApplication/SampleItems.cs deleted file mode 100644 index bbfe90dc..00000000 --- a/SampleApps/SilverlightApplication/SampleItems.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.Collections.ObjectModel; -using System.ComponentModel; -using MapControl; - -namespace SilverlightApplication -{ - public class SamplePoint : INotifyPropertyChanged - { - private string name; - private Location location; - - public event PropertyChangedEventHandler PropertyChanged; - - public string Name - { - get { return name; } - set - { - name = value; - OnPropertyChanged("Name"); - } - } - - public Location Location - { - get { return location; } - set - { - location = value; - OnPropertyChanged("Location"); - } - } - - private void OnPropertyChanged(string propertyName) - { - if (PropertyChanged != null) - { - PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); - } - } - } - - public class SamplePolyline - { - public LocationCollection Locations { get; set; } - } - - public class SampleItemCollection : ObservableCollection - { - } -} diff --git a/SampleApps/SilverlightApplication/SilverlightApplication.csproj b/SampleApps/SilverlightApplication/SilverlightApplication.csproj index c6af4cfe..95f33178 100644 --- a/SampleApps/SilverlightApplication/SilverlightApplication.csproj +++ b/SampleApps/SilverlightApplication/SilverlightApplication.csproj @@ -73,6 +73,9 @@ + + ViewModel.cs + App.xaml @@ -80,7 +83,6 @@ MainPage.xaml - @@ -108,7 +110,9 @@ - + + 10_535_330.jpg + - - - - diff --git a/SampleApps/StoreApplication/MainPage.xaml.cs b/SampleApps/StoreApplication/MainPage.xaml.cs index 66aa9794..91f63616 100644 --- a/SampleApps/StoreApplication/MainPage.xaml.cs +++ b/SampleApps/StoreApplication/MainPage.xaml.cs @@ -1,121 +1,16 @@ -using System; -using System.Collections.Generic; -using MapControl; +using MapControl; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls.Primitives; -// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238 - namespace StoreApplication { - /// - /// An empty page that can be used on its own or navigated to within a Frame. - /// public sealed partial class MainPage : Page { - private SamplePoint movingPoint = new SamplePoint - { - Name = "Moving", - Location = new Location(53.5, 8.25) - }; - public MainPage() { this.InitializeComponent(); tileLayerComboBox.SelectedIndex = 0; - - var polylines = (ICollection)Resources["Polylines"]; - polylines.Add( - new SamplePolyline - { - Locations = LocationCollection.Parse("53.5140,8.1451 53.5123,8.1506 53.5156,8.1623 53.5276,8.1757 53.5491,8.1852 53.5495,8.1877 53.5426,8.1993 53.5184,8.2219 53.5182,8.2386 53.5195,8.2387") - }); - polylines.Add( - new SamplePolyline - { - Locations = LocationCollection.Parse("53.5978,8.1212 53.6018,8.1494 53.5859,8.1554 53.5852,8.1531 53.5841,8.1539 53.5802,8.1392 53.5826,8.1309 53.5867,8.1317 53.5978,8.1212") - }); - - var points = (ICollection)Resources["Points"]; - points.Add( - new SamplePoint - { - Name = "Steinbake Leitdamm", - Location = new Location(53.51217, 8.16603) - }); - points.Add( - new SamplePoint - { - Name = "Buhne 2", - Location = new Location(53.50926, 8.15815) - }); - points.Add( - new SamplePoint - { - Name = "Buhne 4", - Location = new Location(53.50468, 8.15343) - }); - points.Add( - new SamplePoint - { - Name = "Buhne 6", - Location = new Location(53.50092, 8.15267) - }); - points.Add( - new SamplePoint - { - Name = "Buhne 8", - Location = new Location(53.49871, 8.15321) - }); - points.Add( - new SamplePoint - { - Name = "Buhne 10", - Location = new Location(53.49350, 8.15563) - }); - points.Add(movingPoint); - - var pushpins = (ICollection)Resources["Pushpins"]; - pushpins.Add( - new SamplePoint - { - Name = "WHV - Eckwarderhörne", - Location = new Location(53.5495, 8.1877) - }); - pushpins.Add( - new SamplePoint - { - Name = "JadeWeserPort", - Location = new Location(53.5914, 8.14) - }); - pushpins.Add( - new SamplePoint - { - Name = "Kurhaus Dangast", - Location = new Location(53.447, 8.1114) - }); - pushpins.Add( - new SamplePoint - { - Name = "Eckwarderhörne", - Location = new Location(53.5207, 8.2323) - }); - - var timer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(0.1) }; - timer.Tick += MovePoint; - timer.Start(); - } - - private void MovePoint(object sender, object e) - { - movingPoint.Location = new Location(movingPoint.Location.Latitude + 0.001, movingPoint.Location.Longitude + 0.002); - - if (movingPoint.Location.Latitude > 54d) - { - movingPoint.Name = "Stopped"; - ((DispatcherTimer)sender).Stop(); - } } private void ImageOpacitySliderValueChanged(object sender, RangeBaseValueChangedEventArgs e) diff --git a/SampleApps/StoreApplication/Properties/AssemblyInfo.cs b/SampleApps/StoreApplication/Properties/AssemblyInfo.cs index 9f0d38a2..39f46008 100644 --- a/SampleApps/StoreApplication/Properties/AssemblyInfo.cs +++ b/SampleApps/StoreApplication/Properties/AssemblyInfo.cs @@ -8,8 +8,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © Clemens Fischer 2012-2013")] [assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("1.8.0")] -[assembly: AssemblyFileVersion("1.8.0")] +[assembly: AssemblyVersion("1.9.0")] +[assembly: AssemblyFileVersion("1.9.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/SampleApps/StoreApplication/SampleItems.cs b/SampleApps/StoreApplication/SampleItems.cs deleted file mode 100644 index 04769ee2..00000000 --- a/SampleApps/StoreApplication/SampleItems.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.Collections.ObjectModel; -using System.ComponentModel; -using MapControl; - -namespace StoreApplication -{ - public class SamplePoint : INotifyPropertyChanged - { - private string name; - private Location location; - - public event PropertyChangedEventHandler PropertyChanged; - - public string Name - { - get { return name; } - set - { - name = value; - OnPropertyChanged("Name"); - } - } - - public Location Location - { - get { return location; } - set - { - location = value; - OnPropertyChanged("Location"); - } - } - - private void OnPropertyChanged(string propertyName) - { - if (PropertyChanged != null) - { - PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); - } - } - } - - public class SamplePolyline - { - public LocationCollection Locations { get; set; } - } - - public class SampleItemCollection : ObservableCollection - { - } -} diff --git a/SampleApps/StoreApplication/StoreApplication.csproj b/SampleApps/StoreApplication/StoreApplication.csproj index 17bbd195..50fce977 100644 --- a/SampleApps/StoreApplication/StoreApplication.csproj +++ b/SampleApps/StoreApplication/StoreApplication.csproj @@ -37,6 +37,9 @@ 4 + + ViewModel.cs + App.xaml @@ -45,7 +48,6 @@ MainPage.xaml - @@ -53,7 +55,9 @@ - + + 10_535_330.jpg + diff --git a/SampleApps/SurfaceApplication/Properties/AssemblyInfo.cs b/SampleApps/SurfaceApplication/Properties/AssemblyInfo.cs index 96b900ec..c9a8dc51 100644 --- a/SampleApps/SurfaceApplication/Properties/AssemblyInfo.cs +++ b/SampleApps/SurfaceApplication/Properties/AssemblyInfo.cs @@ -8,8 +8,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © Clemens Fischer 2012-2013")] [assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("1.8.0")] -[assembly: AssemblyFileVersion("1.8.0")] +[assembly: AssemblyVersion("1.9.0")] +[assembly: AssemblyFileVersion("1.9.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/SampleApps/WpfApplication/10_535_330.jpg b/SampleApps/WpfApplication/10_535_330.jpg deleted file mode 100644 index 7eb2f5a71746b01a70dbdae4509923f8674552af..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7174 zcmbW5cTiK&m&X%YfCP{#p-7iNqz9xIApt@Uy@*H$0qNC3FOlAa2uKMKNrC@3~8i@&lvyMOKOd2{B@n|J5D@8{fe-n(=E%>P*hTtcICQ2-zi003TGfIo`> zO#n3&6^M$G8UzB-&`{GtSm+>NFa*lP%)r9U!E=S1gNut-P+XXo|C#_77wo#oHAyK1 z0>LA!pdv4=EG~nP{u=~HLqh`rL)hu)*roZn_@w{O_NNQLNc~q6IglSf#t0;51pes- z@LcGm1pdPS|1uyMIRzyZh?<5Ld@-T<5`YXyPEJNaPDx2YaWVV;#d81!BPA1`lm->E z$!!q7AB%KUMhUgRjfQSk%;ZNw8AtzU8d|o?>`)G&tHLl5QG~4Ab$JCvO)Vr!TSpgd zYG!U>X=QEWCErX9TDLdJzkL6>mHIDEZ2Z$wmMl zG=pa&^Sf#+a*cv@c|=q7I4DV5fS6HFTTwwJX_h*hokG+XzENRkxAD6am_$bIMX2jI z7)LmH;oY3T-+EP@M50#8X8y2HmV>z+P3dCjzp}dH=IV&GpA{RS13N>~Y!aG-`qAiJ z{4o_4Rv|^l(qv3Vi;V~@^hFvV=|yTJ=ZkS(o?YuCL7fA8t1hhOR-=Uv}YtW7Z!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jQ0VIg#P31CzNJ^v(PVw_-Y~K=NY& zpNRs9Rxw?%q186I)Bd#~9rI z=5RWE*_>TDglDJO1N}TX*|Xd1OrcY=r}c}dUBzc^>#%_}tLN-Y@Hzfj;=&~#Uuj=- z74Lnd_UMU47jNLSQ6zkh{1!`ZDdk45>&r?gT0 zo=BB#k29?Hawf|u+(mY&&_GX6C`MDkZtp29Fdm0`E<)7m(o)7$eyPo3 z4N4iekts7Ib_nE3d9_3R7=U^T{SMN#=C{vqYtSq+td7M)@X2k{42ZVl&TM^%)J_ct zU!@7WGo|zqe{^cCHbvFor~zH(Fccb4RK}WBDH*+&C2#RF++zA>UcNnB;n18=8i0!8i9HABj?ve+h`6J!EG?_Go3#^h z-pdT=vAfG&NvKnuE~_cdn@4F2UXeUUj2!OOL%>XIWR0N zs3so-HN*J?6R*%vz(q;BZ3;_3&_vW+(welOj1NTPwdv8v@*Yaz%;BYz&*frYB7@@~ zk}7KG$~*K6OhTmym!+89i1YOtLAJwcymZb`|KVo1Yb~m_7Mx@5aqYDEE0CmAOKdG4k9Akl%8Z>&U#8TYKP9=h!s%2V(5uC z8MdQdHoL!EO$EAAflnQC_SN6_56F~h`bDik$Sxce*WZyUQgu-HfWeP7!qeF!y%6?SE) z%}Jd1bQWPy*|7nq5})h18skV3#j#}8%a%MT5!|QW6@A8vy^Z0DqzT6roslSeIgg&F z*(XIewhN&F@XNs-?8kfwXq|VZ-Xz1hec<4p;byufq-f_=bC_7+b&#DDMZD^a)a|V{ z0A$1GSo@{OjEK}eEvF{;zDHNnuXK*_fmm}T$q#xj(csjN4u zyIR)Siyl-|v|n*qei4mI%xY4D{&0IWSC-1pDz2`}Cd6BbF>3qip0nB>Pf5Kylq32+ z5OOwNw_#R<%Wh#`)gVybZ#?p - + ImageFileCache diff --git a/SampleApps/WpfApplication/MainWindow.xaml b/SampleApps/WpfApplication/MainWindow.xaml index 64e4ba7f..7833c4dc 100644 --- a/SampleApps/WpfApplication/MainWindow.xaml +++ b/SampleApps/WpfApplication/MainWindow.xaml @@ -1,11 +1,17 @@ - + + - + TileSource="http://ecn.t{i}.tiles.virtualearth.net/tiles/h{q}.jpeg?g=0&stl=h" MaxZoomLevel="20"/> - - - - diff --git a/SampleApps/WpfApplication/MainWindow.xaml.cs b/SampleApps/WpfApplication/MainWindow.xaml.cs index 8d0fb6da..f36414d7 100644 --- a/SampleApps/WpfApplication/MainWindow.xaml.cs +++ b/SampleApps/WpfApplication/MainWindow.xaml.cs @@ -1,11 +1,9 @@ using System; -using System.Collections.Generic; using System.Globalization; using System.Runtime.Caching; using System.Windows; using System.Windows.Controls; using System.Windows.Input; -using System.Windows.Threading; using Caching; using MapControl; @@ -13,12 +11,6 @@ namespace WpfApplication { public partial class MainWindow : Window { - private SamplePoint movingPoint = new SamplePoint - { - Name = "Moving", - Location = new Location(53.5, 8.25) - }; - public MainWindow() { switch (Properties.Settings.Default.TileCache) @@ -37,98 +29,6 @@ namespace WpfApplication } InitializeComponent(); - - var polylines = (ICollection)Resources["Polylines"]; - polylines.Add( - new SamplePolyline - { - Locations = LocationCollection.Parse("53.5140,8.1451 53.5123,8.1506 53.5156,8.1623 53.5276,8.1757 53.5491,8.1852 53.5495,8.1877 53.5426,8.1993 53.5184,8.2219 53.5182,8.2386 53.5195,8.2387") - }); - polylines.Add( - new SamplePolyline - { - Locations = LocationCollection.Parse("53.5978,8.1212 53.6018,8.1494 53.5859,8.1554 53.5852,8.1531 53.5841,8.1539 53.5802,8.1392 53.5826,8.1309 53.5867,8.1317 53.5978,8.1212") - }); - - var points = (ICollection)Resources["Points"]; - points.Add( - new SamplePoint - { - Name = "Steinbake Leitdamm", - Location = new Location(53.51217, 8.16603) - }); - points.Add( - new SamplePoint - { - Name = "Buhne 2", - Location = new Location(53.50926, 8.15815) - }); - points.Add( - new SamplePoint - { - Name = "Buhne 4", - Location = new Location(53.50468, 8.15343) - }); - points.Add( - new SamplePoint - { - Name = "Buhne 6", - Location = new Location(53.50092, 8.15267) - }); - points.Add( - new SamplePoint - { - Name = "Buhne 8", - Location = new Location(53.49871, 8.15321) - }); - points.Add( - new SamplePoint - { - Name = "Buhne 10", - Location = new Location(53.49350, 8.15563) - }); - points.Add(movingPoint); - - var pushpins = (ICollection)Resources["Pushpins"]; - pushpins.Add( - new SamplePoint - { - Name = "WHV - Eckwarderhörne", - Location = new Location(53.5495, 8.1877) - }); - pushpins.Add( - new SamplePoint - { - Name = "JadeWeserPort", - Location = new Location(53.5914, 8.14) - }); - pushpins.Add( - new SamplePoint - { - Name = "Kurhaus Dangast", - Location = new Location(53.447, 8.1114) - }); - pushpins.Add( - new SamplePoint - { - Name = "Eckwarderhörne", - Location = new Location(53.5207, 8.2323) - }); - - var timer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(0.1) }; - timer.Tick += MovePoint; - timer.Start(); - } - - private void MovePoint(object sender, EventArgs e) - { - movingPoint.Location = new Location(movingPoint.Location.Latitude + 0.001, movingPoint.Location.Longitude + 0.002); - - if (movingPoint.Location.Latitude > 54d) - { - movingPoint.Name = "Stopped"; - ((DispatcherTimer)sender).Stop(); - } } private void MapMouseLeftButtonDown(object sender, MouseButtonEventArgs e) @@ -171,6 +71,13 @@ namespace WpfApplication e.TranslationBehavior.DesiredDeceleration = 0.001; } + private void MapItemTouchDown(object sender, TouchEventArgs e) + { + var mapItem = (MapItem)sender; + mapItem.IsSelected = !mapItem.IsSelected; + e.Handled = true; + } + private void SeamarksClick(object sender, RoutedEventArgs e) { var seamarks = (TileLayer)Resources["SeamarksTileLayer"]; diff --git a/SampleApps/WpfApplication/Properties/AssemblyInfo.cs b/SampleApps/WpfApplication/Properties/AssemblyInfo.cs index 216b6127..e3cf2aba 100644 --- a/SampleApps/WpfApplication/Properties/AssemblyInfo.cs +++ b/SampleApps/WpfApplication/Properties/AssemblyInfo.cs @@ -8,8 +8,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyCompany("Clemens Fischer")] [assembly: AssemblyCopyright("Copyright © Clemens Fischer 2012-2013")] [assembly: AssemblyTrademark("")] -[assembly: AssemblyVersion("1.8.0")] -[assembly: AssemblyFileVersion("1.8.0")] +[assembly: AssemblyVersion("1.9.0")] +[assembly: AssemblyFileVersion("1.9.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/SampleApps/WpfApplication/Properties/Settings.Designer.cs b/SampleApps/WpfApplication/Properties/Settings.Designer.cs index 5fcde2a0..c601f6e5 100644 --- a/SampleApps/WpfApplication/Properties/Settings.Designer.cs +++ b/SampleApps/WpfApplication/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34003 +// Runtime Version:4.0.30319.18408 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -25,7 +25,7 @@ namespace WpfApplication.Properties { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("")] + [global::System.Configuration.DefaultSettingValueAttribute("ImageFileCache")] public string TileCache { get { return ((string)(this["TileCache"])); diff --git a/SampleApps/WpfApplication/Properties/Settings.settings b/SampleApps/WpfApplication/Properties/Settings.settings index 0dab5ee7..d4515930 100644 --- a/SampleApps/WpfApplication/Properties/Settings.settings +++ b/SampleApps/WpfApplication/Properties/Settings.settings @@ -3,7 +3,7 @@ - + ImageFileCache \ No newline at end of file diff --git a/SampleApps/WpfApplication/SampleItems.cs b/SampleApps/WpfApplication/SampleItems.cs deleted file mode 100644 index a3bc5236..00000000 --- a/SampleApps/WpfApplication/SampleItems.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.Collections.ObjectModel; -using System.ComponentModel; -using MapControl; - -namespace WpfApplication -{ - public class SamplePoint : INotifyPropertyChanged - { - private string name; - private Location location; - - public event PropertyChangedEventHandler PropertyChanged; - - public string Name - { - get { return name; } - set - { - name = value; - OnPropertyChanged("Name"); - } - } - - public Location Location - { - get { return location; } - set - { - location = value; - OnPropertyChanged("Location"); - } - } - - private void OnPropertyChanged(string propertyName) - { - if (PropertyChanged != null) - { - PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); - } - } - } - - public class SamplePolyline - { - public LocationCollection Locations { get; set; } - } - - public class SampleItemCollection : ObservableCollection - { - } -} diff --git a/SampleApps/WpfApplication/WpfApplication.csproj b/SampleApps/WpfApplication/WpfApplication.csproj index 78ba97a8..b1d94675 100644 --- a/SampleApps/WpfApplication/WpfApplication.csproj +++ b/SampleApps/WpfApplication/WpfApplication.csproj @@ -49,7 +49,10 @@ MSBuild:Compile Designer - + + ViewModel.cs + + MSBuild:Compile Designer @@ -97,7 +100,9 @@ - + + 10_535_330.jpg +