diff --git a/Caching/FileDbCache/Properties/AssemblyInfo.cs b/Caching/FileDbCache/Properties/AssemblyInfo.cs index f6d2b2de..2c5680ae 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.3.6")] -[assembly: AssemblyFileVersion("1.3.6")] +[assembly: AssemblyVersion("1.3.7")] +[assembly: AssemblyFileVersion("1.3.7")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/Caching/ImageFileCache/Properties/AssemblyInfo.cs b/Caching/ImageFileCache/Properties/AssemblyInfo.cs index 029697fe..ac1ea419 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.3.6")] -[assembly: AssemblyFileVersion("1.3.6")] +[assembly: AssemblyVersion("1.3.7")] +[assembly: AssemblyFileVersion("1.3.7")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/MapControl/ImageTileSource.cs b/MapControl/ImageTileSource.cs index be3f7432..d3d76e5d 100644 --- a/MapControl/ImageTileSource.cs +++ b/MapControl/ImageTileSource.cs @@ -12,7 +12,7 @@ namespace MapControl /// cache processing in TileImageLoader. By overriding the LoadImage method, /// an application can provide tile images from an arbitrary source. /// If the CanLoadAsync property is true, the LoadImage method will be called - /// from a separate non-UI thread and must hence return a frozen ImageSource. + /// from a separate, non-UI thread and must hence return a frozen ImageSource. /// public class ImageTileSource : TileSource { diff --git a/MapControl/MapBase.Silverlight.WinRT.cs b/MapControl/MapBase.Silverlight.WinRT.cs index d3f79c6f..28367ef7 100644 --- a/MapControl/MapBase.Silverlight.WinRT.cs +++ b/MapControl/MapBase.Silverlight.WinRT.cs @@ -20,7 +20,7 @@ namespace MapControl { // Set FillBehavior.HoldEnd to prevent animation from returning // to local value before invoking the Completed handler - private const FillBehavior animationFillBehavior = FillBehavior.HoldEnd; + private const FillBehavior AnimationFillBehavior = FillBehavior.HoldEnd; public static readonly DependencyProperty ForegroundProperty = DependencyProperty.Register( "Foreground", typeof(Brush), typeof(MapBase), new PropertyMetadata(new SolidColorBrush(Colors.Black))); diff --git a/MapControl/MapBase.WPF.cs b/MapControl/MapBase.WPF.cs index 261b865a..d39b4765 100644 --- a/MapControl/MapBase.WPF.cs +++ b/MapControl/MapBase.WPF.cs @@ -12,7 +12,7 @@ namespace MapControl public partial class MapBase { // FillBehavior must be set to Stop to re-enable local property values - private const FillBehavior animationFillBehavior = FillBehavior.Stop; + private const FillBehavior AnimationFillBehavior = FillBehavior.Stop; public static readonly DependencyProperty ForegroundProperty = System.Windows.Controls.Control.ForegroundProperty.AddOwner(typeof(MapBase)); @@ -31,6 +31,21 @@ namespace MapControl AddVisualChild(tileContainer); } + protected override int VisualChildrenCount + { + get { return base.VisualChildrenCount + 1; } + } + + protected override Visual GetVisualChild(int index) + { + if (index == 0) + { + return tileContainer; + } + + return base.GetVisualChild(index - 1); + } + protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo) { base.OnRenderSizeChanged(sizeInfo); @@ -46,20 +61,5 @@ namespace MapControl scaleTransform.Matrix = new Matrix(scale, 0d, 0d, scale, 0d, 0d); scaleRotateTransform.Matrix = scaleTransform.Matrix * rotateMatrix; } - - protected override int VisualChildrenCount - { - get { return InternalChildren.Count + 1; } - } - - protected override Visual GetVisualChild(int index) - { - if (index == 0) - { - return tileContainer; - } - - return InternalChildren[index - 1]; - } } } diff --git a/MapControl/MapBase.cs b/MapControl/MapBase.cs index 827b050b..0eaf1db2 100644 --- a/MapControl/MapBase.cs +++ b/MapControl/MapBase.cs @@ -610,7 +610,7 @@ namespace MapControl To = new Point(targetCenter.Longitude, targetCenter.Latitude), Duration = AnimationDuration, EasingFunction = AnimationEasingFunction, - FillBehavior = animationFillBehavior + FillBehavior = AnimationFillBehavior }; centerAnimation.Completed += CenterAnimationCompleted; @@ -714,7 +714,7 @@ namespace MapControl To = targetZoomLevel, Duration = AnimationDuration, EasingFunction = AnimationEasingFunction, - FillBehavior = animationFillBehavior + FillBehavior = AnimationFillBehavior }; zoomLevelAnimation.Completed += ZoomLevelAnimationCompleted; @@ -789,7 +789,7 @@ namespace MapControl By = delta, Duration = AnimationDuration, EasingFunction = AnimationEasingFunction, - FillBehavior = animationFillBehavior + FillBehavior = AnimationFillBehavior }; headingAnimation.Completed += HeadingAnimationCompleted; diff --git a/MapControl/MapImageLayer.cs b/MapControl/MapImageLayer.cs index 20bfbbe0..570c4203 100644 --- a/MapControl/MapImageLayer.cs +++ b/MapControl/MapImageLayer.cs @@ -149,9 +149,15 @@ namespace MapControl private void UpdateImage(object sender, EventArgs e) { - if (ParentMap != null && !updateInProgress) + if (updateInProgress) + { + return; // update image on next timer tick + } + + updateTimer.Stop(); + + if (ParentMap != null && ActualWidth > 0 && ActualHeight > 0) { - updateTimer.Stop(); updateInProgress = true; var relativeSize = Math.Max(RelativeImageSize, 1d); @@ -170,7 +176,7 @@ namespace MapControl var east = Math.Max(loc1.Longitude, Math.Max(loc2.Longitude, Math.Max(loc3.Longitude, loc4.Longitude))); var south = Math.Min(loc1.Latitude, Math.Min(loc2.Latitude, Math.Min(loc3.Latitude, loc4.Latitude))); var north = Math.Max(loc1.Latitude, Math.Max(loc2.Latitude, Math.Max(loc3.Latitude, loc4.Latitude))); - var image = GetImage(west, east, south, north, (int)width, (int)height); + var image = GetImage(west, east, south, north, (int)Math.Round(width), (int)Math.Round(height)); Dispatcher.BeginInvoke((Action)(() => UpdateImage(west, east, south, north, image))); diff --git a/MapControl/MapPolyline.cs b/MapControl/MapPolyline.cs index 500937cc..b4f5cad8 100644 --- a/MapControl/MapPolyline.cs +++ b/MapControl/MapPolyline.cs @@ -10,6 +10,7 @@ using Windows.Foundation; using Windows.UI.Xaml; #else using System.Windows; +using System.ComponentModel; #endif namespace MapControl @@ -34,6 +35,9 @@ namespace MapControl /// /// Gets or sets the locations that define the polyline points. /// +#if !NETFX_CORE + [TypeConverter(typeof(LocationCollectionConverter))] +#endif public IEnumerable Locations { get { return (IEnumerable)GetValue(LocationsProperty); } diff --git a/MapControl/Properties/AssemblyInfo.cs b/MapControl/Properties/AssemblyInfo.cs index 9d17a95a..d9692892 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.3.6")] -[assembly: AssemblyFileVersion("1.3.6")] +[assembly: AssemblyVersion("1.3.7")] +[assembly: AssemblyFileVersion("1.3.7")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/MapControl/TileSource.cs b/MapControl/TileSource.cs index 38c72e52..2a62b1ce 100644 --- a/MapControl/TileSource.cs +++ b/MapControl/TileSource.cs @@ -161,11 +161,12 @@ namespace MapControl private Uri GetBoundingBoxUri(int x, int y, int zoomLevel) { + var m = MetersPerDegree; var n = (double)(1 << zoomLevel); - var x1 = MetersPerDegree * ((double)x * 360d / n - 180d); - var x2 = MetersPerDegree * ((double)(x + 1) * 360d / n - 180d); - var y1 = MetersPerDegree * (180d - (double)(y + 1) * 360d / n); - var y2 = MetersPerDegree * (180d - (double)y * 360d / n); + var x1 = m * ((double)x * 360d / n - 180d); + var x2 = m * ((double)(x + 1) * 360d / n - 180d); + var y1 = m * (180d - (double)(y + 1) * 360d / n); + var y2 = m * (180d - (double)y * 360d / n); return new Uri(UriFormat. Replace("{W}", x1.ToString(CultureInfo.InvariantCulture)). @@ -176,13 +177,12 @@ namespace MapControl private Uri GetLatLonBoundingBoxUri(int x, int y, int zoomLevel) { + var t = new MercatorTransform(); var n = (double)(1 << zoomLevel); var x1 = (double)x * 360d / n - 180d; var x2 = (double)(x + 1) * 360d / n - 180d; var y1 = 180d - (double)(y + 1) * 360d / n; var y2 = 180d - (double)y * 360d / n; - - var t = new MercatorTransform(); var p1 = t.Transform(new Point(x1, y1)); var p2 = t.Transform(new Point(x2, y2)); diff --git a/MapControl/WinRT/Properties/AssemblyInfo.cs b/MapControl/WinRT/Properties/AssemblyInfo.cs index 51a0b77f..2e9aa00c 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.3.6")] -[assembly: AssemblyFileVersion("1.3.6")] +[assembly: AssemblyVersion("1.3.7")] +[assembly: AssemblyFileVersion("1.3.7")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/SampleApps/SilverlightApplication.Web/Properties/AssemblyInfo.cs b/SampleApps/SilverlightApplication.Web/Properties/AssemblyInfo.cs index 65750fd3..37266417 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.3.6")] -[assembly: AssemblyFileVersion("1.3.6")] +[assembly: AssemblyVersion("1.3.7")] +[assembly: AssemblyFileVersion("1.3.7")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/SampleApps/SilverlightApplication/Properties/AssemblyInfo.cs b/SampleApps/SilverlightApplication/Properties/AssemblyInfo.cs index 22311dff..ef50e043 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.3.6")] -[assembly: AssemblyFileVersion("1.3.6")] +[assembly: AssemblyVersion("1.3.7")] +[assembly: AssemblyFileVersion("1.3.7")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/SampleApps/StoreApplication/Properties/AssemblyInfo.cs b/SampleApps/StoreApplication/Properties/AssemblyInfo.cs index 9ebdbc68..838c148c 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.3.6")] -[assembly: AssemblyFileVersion("1.3.6")] +[assembly: AssemblyVersion("1.3.7")] +[assembly: AssemblyFileVersion("1.3.7")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/SampleApps/SurfaceApplication/Properties/AssemblyInfo.cs b/SampleApps/SurfaceApplication/Properties/AssemblyInfo.cs index 237aa226..f9e086ba 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.3.6")] -[assembly: AssemblyFileVersion("1.3.6")] +[assembly: AssemblyVersion("1.3.7")] +[assembly: AssemblyFileVersion("1.3.7")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] diff --git a/SampleApps/WpfApplication/Properties/AssemblyInfo.cs b/SampleApps/WpfApplication/Properties/AssemblyInfo.cs index 1a06261d..0ce6031c 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.3.6")] -[assembly: AssemblyFileVersion("1.3.6")] +[assembly: AssemblyVersion("1.3.7")] +[assembly: AssemblyFileVersion("1.3.7")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)]