public MapDataStore(IMapDataProvider mapDataProvider, IMapDataLibrary mapDataLibrary) { _mapDataProvider = mapDataProvider; _mapDataLibrary = mapDataLibrary; _mapDataProvider .ObserveOn(Scheduler.ThreadPool) .Subscribe(value => { // we have map data in store. if (String.IsNullOrEmpty(value.Item2)) { _mapDataLibrary.Get(value.Item1, _dataObservers); } else { Add(_mapDataStorageType, value.Item2, value.Item1.Stylesheet, value.Item1.QuadKey) .Subscribe(progress => { }, () => _mapDataLibrary.Get(value.Item1, _dataObservers)); } }); }
public MapDataStore(IMapDataProvider mapDataProvider, IMapDataLibrary mapDataLibrary) { _mapDataLibrary = mapDataLibrary; _mapDataProvider = mapDataProvider; _mapDataProvider .ObserveOn(Scheduler.ThreadPool) .Subscribe(value => { // We have map data in store. if (String.IsNullOrEmpty(value.Item2)) { _mapDataLibrary .Get(value.Item1, _dataObservers) .Subscribe(_ => _tileObservers.ForEach(t => t.OnNext(value.Item1))); } else { // NOTE store data in the first registered store AddTo(_storageKeys.First(), value.Item2, value.Item1.Stylesheet, value.Item1.QuadKey, value.Item1.CancelationToken) .Subscribe(progress => { }, () => _mapDataLibrary.Get(value.Item1, _dataObservers)); } }); }
/// <summary> Triggers search of elements matching query query. </summary> public void OnNext(MapQuery value) { _mapDataLibrary.Get(value, _elementObservers); }