/// <summary>Initializes a new instance of the Tile class.</summary> /// <param name="zoom">The zoom level for the tile.</param> /// <param name="x">The tile index along the X axis.</param> /// <param name="y">The tile index along the Y axis.</param> public Tile(MapControlFactory mapControlFactory, int zoom, int x, int y) { _mapControlFactory = mapControlFactory; _tileX = x; _tileY = y; _zoom = zoom; this.LoadTile(); }
/// <summary>Initializes a new instance of the SearchControl class.</summary> public SearchControl() { this.InitializeComponent(); _mapControlFactory = UIControls.Maps.Control.MapControlFactoryToUse; if (_mapControlFactory != null) { _provider = _mapControlFactory.SearchProvider; _provider.SearchCompleted += this.OnSearchCompleted; _provider.SearchError += this.OnSearchError; } }
/// <summary>Initializes a new instance of the MapOffset class.</summary> /// <param name="property">The property this MapOffset represents.</param> /// <param name="offsetChanged">Called when the Offset changes.</param> public MapOffset(MapControlFactory mapControlFactory, PropertyInfo property, EventHandler offsetChanged) { System.Diagnostics.Debug.Assert(property != null, "property cannot be null"); System.Diagnostics.Debug.Assert(offsetChanged != null, "offsetChanged cannot be null"); _mapControlFactory = mapControlFactory; _mapSize = mapControlFactory.TileGenerator.TileSize; _offsetChanged = offsetChanged; this.Property = property; this.Frames = 24; CompositionTarget.Rendering += this.OnRendering; // Used for manual animation }
public MapCanvas() { _mapControlFactory = UIControls.Maps.Control.MapControlFactoryToUse; if (_mapControlFactory != null) { _offsetX = _mapControlFactory.GetMapOffset(_translate.GetType().GetProperty("X"), this.OnOffsetChanged); _offsetY = _mapControlFactory.GetMapOffset(_translate.GetType().GetProperty("Y"), this.OnOffsetChanged); _tilePanel = _mapControlFactory.TilePanel; _tilePanel.RenderTransform = _translate; } this.Background = Brushes.Transparent; // Register all mouse clicks this.Children.Add(_cache); if (_mapControlFactory != null) { this.Children.Add(_tilePanel); } this.ClipToBounds = true; this.Focusable = true; this.FocusVisualStyle = null; this.SnapsToDevicePixels = true; }
public TileGenerator(MapControlFactory mapControlFactory) { _mapControlFactory = mapControlFactory; _maxZoom = 18; _tileSize = 256; try { string p = Settings.Settings.Default.SettingsFolder; if (!System.IO.Directory.Exists(p)) { System.IO.Directory.CreateDirectory(p); } p = System.IO.Path.Combine(new string[] { p, "MapCache" }); if (!System.IO.Directory.Exists(p)) { System.IO.Directory.CreateDirectory(p); } if (string.IsNullOrEmpty(_mapControlFactory.ID)) { p = System.IO.Path.Combine(new string[] { p, "MapCache" }); } else { p = System.IO.Path.Combine(new string[] { p, _mapControlFactory.ID }); } if (!System.IO.Directory.Exists(p)) { System.IO.Directory.CreateDirectory(p); } CacheFolder = p; } catch { } }
public TileGeneratorOSM(MapControlFactory mapControlFactory) : base(mapControlFactory) { _maxZoom = 18; _tileSize = 256; }
/// <summary>Initializes a new instance of the TilePanel class.</summary> public TilePanel(MapControlFactory mapControlFactory) { _mapControlFactory = mapControlFactory; // This stops the Images from being blurry RenderOptions.SetBitmapScalingMode(this, BitmapScalingMode.NearestNeighbor); }