Version 1.3.7. Fixed z index behavior in MapBase and setting of MapPolyline.Locations property in XAML.

This commit is contained in:
ClemensF 2013-06-19 18:57:54 +02:00
parent da651e3e32
commit 8e917e9397
16 changed files with 58 additions and 48 deletions

View file

@ -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)]

View file

@ -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)]

View file

@ -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.
/// </summary>
public class ImageTileSource : TileSource
{

View file

@ -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)));

View file

@ -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];
}
}
}

View file

@ -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;

View file

@ -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)));

View file

@ -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
/// <summary>
/// Gets or sets the locations that define the polyline points.
/// </summary>
#if !NETFX_CORE
[TypeConverter(typeof(LocationCollectionConverter))]
#endif
public IEnumerable<Location> Locations
{
get { return (IEnumerable<Location>)GetValue(LocationsProperty); }

View file

@ -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)]

View file

@ -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));

View file

@ -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)]

View file

@ -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)]

View file

@ -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)]

View file

@ -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)]

View file

@ -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)]

View file

@ -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)]