Exemplo n.º 1
0
 public static IObservable<MapNewTileAvailableEventArgs> GetMapNewTileAvailableAsObservable(this Map map)
 {
     var listener = new EventListener(map, "MapNewTileAvaliable");
     return listener.SavedArgs.ToObservable()
         .Select(dict => new MapNewTileAvailableEventArgs(
             (TileLayer) dict["sender"],
             (Envelope) dict["bbox"],
             (Bitmap) dict["bm"],
             (int) dict["sourceWidth"],
             (int) dict["sourceHeight"],
             (ImageAttributes) dict["imageAttributes"]));
 }
Exemplo n.º 2
0
        public static IObservable<DownloadProgressEventArgs> GetDownloadProgressAsObservable(this ITileAsyncLayer layer)
        {
            var listener = new EventListener(layer, "DownloadProgressChanged");

            return listener.SavedArgs.ToObservable()
                .Select(dict => new DownloadProgressEventArgs((int)dict["tilesRemaining"]));
        }