Esempio n. 1
0
 /// <summary> Listens for position changes to notify library. </summary>
 void Update()
 {
     if (_appManager.IsInitialized && Vector3.Distance(_position, transform.position) > PositionUpdateThreshold)
     {
         _position = transform.position;
         Scheduler.ThreadPool.Schedule(() => _tileController.OnPosition(_position, _levelOfDetails));
     }
 }
Esempio n. 2
0
        private void Initialize()
        {
            // initialize services
            _compositionRoot = TestHelper.GetCompositionRoot(_worldZeroPoint);

            // get local references
            _messageBus     = _compositionRoot.GetService <IMessageBus>();
            _trace          = _compositionRoot.GetService <ITrace>();
            _tileController = _compositionRoot.GetService <ITileController>();

            SetupMapData();

            // set observer to react on geo position changes
            _messageBus.AsObservable <GeoPosition>()
            .ObserveOn(Scheduler.MainThread)
            .Subscribe(position =>
            {
                _trace.Debug(TraceCategory, "GeoPosition: {0}", position.ToString());
                _tileController.OnPosition(position.Coordinate, LevelOfDetails);
            });
        }
Esempio n. 3
0
        private void Initialize()
        {
            // initialize services
            _compositionRoot = TestHelper.GetCompositionRoot(_worldZeroPoint);

            // get local references
            _messageBus = _compositionRoot.GetService<IMessageBus>();
            _trace = _compositionRoot.GetService<ITrace>();
            _tileController = _compositionRoot.GetService<ITileController>();

            SetupMapData();

            // set observer to react on geo position changes
            _messageBus.AsObservable<GeoPosition>()
                .ObserveOn(Scheduler.MainThread)
                .Subscribe(position =>
            {
                _trace.Debug(TraceCategory, "GeoPosition: {0}", position.ToString());
                _tileController.OnPosition(position.Coordinate, LevelOfDetails);
            });
        }