Ejemplo n.º 1
0
        private void AddLocalMapTileSource()
        {
            MapZoomLevelRange range;

            range.Min = 4;
            range.Max = 7;
            LocalMapTileDataSource dataSource = new LocalMapTileDataSource("/tiles/4/1/1.png");
            MapTileSource          tileSource = new MapTileSource(dataSource);

            tileSource.ZoomLevelRange = range;
            MyMapControl.TileSources.Add(tileSource);
            string path = ApplicationData.Current.LocalFolder.Path;
        }
Ejemplo n.º 2
0
        private void UWPUriTileLayer_UriRequested(LocalMapTileDataSource sender, MapTileUriRequestedEventArgs args)
        {
            var deferral = args.Request.GetDeferral();
            var uri      = _makeTileUri(args.X, args.Y, args.ZoomLevel);

            if (uri != null)
            {
                if (!uri.Scheme.ToLower().StartsWith("http"))
                {
                    uri = new Uri(string.Format("ms-appx:///local/{0}", uri.LocalPath.Replace(ApplicationData.Current.LocalFolder.Path, string.Empty).TrimStart('\\')));
                }
                args.Request.Uri = uri;
            }
            deferral.Complete();
        }
 public LocalMapTileDataSourceEvents(LocalMapTileDataSource This)
 {
     this.This = This;
 }