Simplified sample application, set default TileLayer in Map.Loaded handler.

This commit is contained in:
ClemensF 2012-06-14 10:43:27 +02:00
parent bb3a9cf8c3
commit f74f4bf404
4 changed files with 78 additions and 179 deletions

View file

@ -108,6 +108,18 @@ namespace MapControl
AddVisualChild(tileContainer);
TileLayers = new TileLayerCollection();
SetValue(ParentMapProperty, this);
Loaded += (o, e) =>
{
if (MainTileLayer == null)
{
MainTileLayer = new TileLayer
{
Description = "© {y} OpenStreetMap Contributors, CC-BY-SA",
TileSource = new OpenStreetMapTileSource { UriFormat = "http://{c}.tile.openstreetmap.org/{z}/{x}/{y}.png" }
};
}
};
}
/// <summary>