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