Beispiel #1
0
        /// <summary>
        /// Callback d'initialisation de la map
        /// </summary>
        public override void OnMapReady(GoogleMap googleMap)
        {
            if (googleMap != null)
            {
                this.MapWrapperLayout.Init(googleMap);

                if (_mapControlManager == null)
                {
                    // initialisation de la map
                    _mapControlManager = new MapControlManager(googleMap
                                                               , BaseContext
                                                               , AddPointSvgImageView
                                                               , UndoSvgImageView
                                                               , CenterSeekiosSvgImageView
                                                               , MapViewModelBase.Seekios.Idseekios.ToString());
                    App.Locator.ModeZone.MapControlManager = _mapControlManager;
                    App.Locator.ModeZone.InitMap();
                    //Ajout d'un polygone pour la zone du mode zone
                    App.Locator.ModeZone.InitMode();
                    App.Locator.ModeZone.InitZone();
                    if (_mapControlManager.ZonePolygon != null)
                    {
                        ShowZoneSvgImageView.Visibility = ViewStates.Visible;
                    }

                    //(_modeMetaDataFragment as ZoneMetaDataFragment).ZonePolygon = _mapControlManager.ZonePolygon;

                    _mapControlManager.ZoneInformationUpdated += OnInformationZoneRefresh;
                    _mapControlManager.RegisterMethodes();
                }
            }
            base.OnMapReady(googleMap);
        }
Beispiel #2
0
        /// <summary>
        /// Set up the business logic for the map
        /// </summary>
        public override void SetMapControlManager()
        {
            _mapControlManager = new MapControlManager(MapViewControl
                                                       , this
                                                       , FocusOnSeekiosButton
                                                       , ChangeMapTypeButton
                                                       , MapZoomInButton
                                                       , MapZoomOutButton
                                                       , MapViewModelBase.Seekios.Idseekios.ToString());

            App.Locator.Historic.MapControlManager = _mapControlManager;
            App.Locator.Historic.InitMap();

            _mapControlManager.RegisterMethodes();
        }
Beispiel #3
0
        public override void SetMapControlManager()
        {
            _mapControlManager = new MapControlManager(MapViewControl
                                                       , this
                                                       , MapZoomInButton
                                                       , MapZoomOutButton);

            App.Locator.MapAllSeekios.MapControlManager = _mapControlManager;
            App.Locator.MapAllSeekios.InitMap();

            if (App.CurrentUserEnvironment.LsSeekios.Count != 0)
            {
                _mapControlManager.RegisterMethodes();
                var listLatLong = _mapControlManager.ConvertLatitudeLongitudeToLatLng(GetSeekiosListCordinates());
                _mapControlManager.CenterOnLocations(listLatLong, true);
            }
        }
        /// <summary>
        /// Callback d'initialisation de la map
        /// </summary>
        public override void OnMapReady(GoogleMap googleMap)
        {
            if (googleMap != null)
            {
                MapWrapperLayout.Init(googleMap);

                // Initialisation de la map
                _mapControlManager = new MapControlManager(googleMap
                                                           , this
                                                           , null
                                                           , null
                                                           , CenterSeekiosSvgImageView
                                                           , MapViewModelBase.Seekios.Idseekios.ToString());
                App.Locator.Historic.MapControlManager = _mapControlManager;
                App.Locator.Historic.InitMap();

                _mapControlManager.RegisterMethodes();
            }
            base.OnMapReady(googleMap);
        }
Beispiel #5
0
        public override void SetMapControlManager()
        {
            // map initialisation
            _mapControlManager = new MapControlManager(MapViewControl
                                                       , this
                                                       , FocusOnSeekiosButton
                                                       , FocusOnZoneButton
                                                       , ChangeMapTypeButton
                                                       , MapZoomInButton
                                                       , MapZoomOutButton
                                                       , null
                                                       , UndoButton
                                                       , NextButton
                                                       , App.Locator.DetailSeekios.SeekiosSelected.Idseekios.ToString());

            App.Locator.ModeZone.MapControlManager = _mapControlManager;
            App.Locator.ModeZone.InitMap();
            App.Locator.ModeZone.InitMode();
            App.Locator.ModeZone.InitZone();

            if (App.Locator.DetailSeekios.SeekiosSelected.LastKnownLocation_accuracy > 0)
            {
                // display the area for accuracy (triangulation)
                _mapControlManager.CreateAccuracyArea(App.Locator.DetailSeekios.SeekiosSelected.LastKnownLocation_latitude
                                                      , App.Locator.DetailSeekios.SeekiosSelected.LastKnownLocation_longitude
                                                      , App.Locator.DetailSeekios.SeekiosSelected.LastKnownLocation_accuracy);
            }
            else
            {
                // big zoom
                _mapControlManager.CenterInLocalisation(App.Locator.DetailSeekios.SeekiosSelected.LastKnownLocation_latitude
                                                        , App.Locator.DetailSeekios.SeekiosSelected.LastKnownLocation_longitude
                                                        , (float)ZoomLevelEnum.BigZoom
                                                        , true);
            }

            _mapControlManager.RegisterMethodes();
            _mapControlManager.IsOnPointAdding = true;
        }
        private void InitializeMap()
        {
            var map = (MapControl)GetChildren(ListSeekiosView).First(x => x.Name == "Map");

            if (_mapControlManager == null)
            {
                _mapControlManager = new MapControlManager(map, null, null);
                _mapControlManager.RegisterMethodes();
            }
            if (MapViewModelBase.Mode != null &&
                MapViewModelBase.Mode.ModeDefinition_idmodeDefinition == (int)ModeDefinitionEnum.ModeDontMove)
            {
                if (MapViewModelBase.Mode.StatusDefinition_idstatusDefinition != 1)
                {
                    MapControlManager.IsOutOf = true;
                }
                SeekiosApp.App.Locator.ModeDontMove.MapControlManager = _mapControlManager;
                //SeekiosApp.App.Locator.ModeDontMove.MapControlManager.OnInitTrackingRouteComplete -= OnInitTrackingRouteComplete;
                //SeekiosApp.App.Locator.ModeDontMove.MapControlManager.OnInitTrackingRouteComplete += OnInitTrackingRouteComplete;
                SeekiosApp.App.Locator.ModeDontMove.InitMap();
                SeekiosApp.App.Locator.ModeDontMove.InitModeDontMove();
                if (SeekiosApp.App.Locator.ModeDontMove.LsSeekiosInTrackingAfterMove.Contains(SeekiosApp.App.Locator.DetailSeekios.SeekiosSelected.Idseekios))
                {
                    Task.Factory.StartNew(() => { SeekiosApp.App.Locator.ModeDontMove.InitDontMoveTrackingRouteAsync(); });
                }
            }
            else if (MapViewModelBase.Mode != null &&
                     MapViewModelBase.Mode.ModeDefinition_idmodeDefinition == (int)ModeDefinitionEnum.ModeZone)
            {
                if (MapViewModelBase.Mode.StatusDefinition_idstatusDefinition != 1)
                {
                    MapControlManager.IsOutOf = true;
                }
                SeekiosApp.App.Locator.ModeZone.MapControlManager = _mapControlManager;
                //SeekiosApp.App.Locator.ModeZone.MapControlManager.OnInitTrackingRouteComplete -= OnInitTrackingRouteComplete;
                //SeekiosApp.App.Locator.ModeZone.MapControlManager.OnInitTrackingRouteComplete += OnInitTrackingRouteComplete;
                SeekiosApp.App.Locator.ModeZone.InitMap();
                var isInAlert = MapViewModelBase.Mode != null && MapViewModelBase.Mode.StatusDefinition_idstatusDefinition != 1;

                _mapControlManager.CreateZone(SeekiosApp.App.Locator.ModeZone.DecodeTrame(MapViewModelBase.Mode.Trame), isInAlert);
                if (SeekiosApp.App.Locator.ModeZone.LsSeekiosInTrackingAfterOOZ.Contains(SeekiosApp.App.Locator.DetailSeekios.SeekiosSelected.Idseekios))
                {
                    Task.Factory.StartNew(() => { SeekiosApp.App.Locator.ModeZone.InitZoneTrackingRouteAsync(); });
                }
                //FocusOnZoneButton.Hidden = false;
            }
            else if (MapViewModelBase.Mode != null &&
                     MapViewModelBase.Mode.ModeDefinition_idmodeDefinition == (int)ModeDefinitionEnum.ModeTracking)
            {
                MapControlManager.IsOutOf = false;
                SeekiosApp.App.Locator.ModeTracking.MapControlManager = _mapControlManager;
                //SeekiosApp.App.Locator.ModeTracking.MapControlManager.OnInitTrackingRouteComplete -= OnInitTrackingRouteComplete;
                //SeekiosApp.App.Locator.ModeTracking.MapControlManager.OnInitTrackingRouteComplete += OnInitTrackingRouteComplete;
                SeekiosApp.App.Locator.ModeTracking.InitMap();
                Task.Factory.StartNew(() => { SeekiosApp.App.Locator.ModeTracking.InitTrackingRoute(); });
            }
            else
            {
                MapControlManager.IsOutOf = false;
                SeekiosApp.App.Locator.Map.MapControlManager = _mapControlManager;
                SeekiosApp.App.Locator.Map.InitMap();
            }
            //SetZoom();
        }
        public override void OnMapReady(GoogleMap googleMap)
        {
            if (googleMap != null)
            {
                MapWrapperLayout.Init(googleMap);

                if (App.Locator.ModeTracking.MapControlManager != null)
                {
                    App.Locator.ModeTracking.MapControlManager.OnInitTrackingRouteComplete -= OnInitTrackingRouteComplete;
                }

                _mapControlManager = new MapControlManager(googleMap
                                                           , this
                                                           , CenterSeekiosSvgImageView
                                                           , MapViewModelBase.Seekios.Idseekios.ToString());

                // subscribe to tracking Route Drawing events
                _mapControlManager.OnInitTrackingRouteComplete += OnInitTrackingRouteComplete;

                if (MapViewModelBase.Mode != null && MapViewModelBase.Mode.ModeDefinition_idmodeDefinition == (int)ModeDefinitionEnum.ModeDontMove)
                {
                    if (MapViewModelBase.Mode.StatusDefinition_idstatusDefinition == (int)StatutDefinitionEnum.SeekiosMoved)
                    {
                        MapControlManager.IsInAlert = true;
                    }
                    App.Locator.ModeDontMove.MapControlManager = _mapControlManager;
                    App.Locator.ModeDontMove.InitMap();
                    App.Locator.ModeDontMove.InitModeDontMove();
                    if (App.Locator.Map.LsSeekiosOnTracking.Any(x => x.Seekios.Idseekios == App.Locator.DetailSeekios.SeekiosSelected.Idseekios))
                    {
                        using (var handler = new Handler(Looper.MainLooper))
                        {
                            handler.Post(() => { App.Locator.ModeDontMove.InitDontMoveTrackingRouteAsync(); });
                        }
                    }
                }
                else if (MapViewModelBase.Mode != null && MapViewModelBase.Mode.ModeDefinition_idmodeDefinition == (int)ModeDefinitionEnum.ModeZone)
                {
                    if (MapViewModelBase.Mode.StatusDefinition_idstatusDefinition == (int)StatutDefinitionEnum.SeekiosOutOfZone)
                    {
                        MapControlManager.IsInAlert = true;
                    }
                    App.Locator.ModeZone.MapControlManager = _mapControlManager;
                    App.Locator.ModeZone.InitMap();
                    var isInAlert = MapViewModelBase.Mode != null && MapViewModelBase.Mode.StatusDefinition_idstatusDefinition != 1;
                    _mapControlManager.CreateZone(App.Locator.ModeZone.DecodeTrame(MapViewModelBase.Mode.Trame), isInAlert);
                    if (App.Locator.Map.LsSeekiosOnTracking.Any(x => x.Seekios.Idseekios == App.Locator.DetailSeekios.SeekiosSelected.Idseekios))
                    {
                        using (var handler = new Handler(Looper.MainLooper))
                        {
                            handler.Post(() => { App.Locator.ModeZone.InitZoneTrackingRouteAsync(); });
                        }
                    }
                    CenterOnZoneButton.Visibility = ViewStates.Visible;
                }
                else if (MapViewModelBase.Mode != null && MapViewModelBase.Mode.ModeDefinition_idmodeDefinition == (int)ModeDefinitionEnum.ModeTracking)
                {
                    MapControlManager.IsInAlert = false;
                    App.Locator.ModeTracking.MapControlManager = _mapControlManager;
                    App.Locator.ModeTracking.InitMap();
                    LoadingLayout.Visibility = ViewStates.Visible;
                    using (var handler = new Handler(Looper.MainLooper))
                    {
                        handler.Post(() => { App.Locator.ModeTracking.InitTrackingRoute(); });
                    }
                }
                else
                {
                    MapControlManager.IsInAlert       = false;
                    App.Locator.Map.MapControlManager = _mapControlManager;
                    App.Locator.Map.InitMap();
                }
                _mapControlManager.RegisterMethodes();
            }
            base.OnMapReady(googleMap);

            //the call to the function is made before the map is initialized => _mapControlManager = null
            //we need to Hide & Show the markerInfo once we have initialized the control manager in order to reflect the right
            //internet connection state
            if (!App.DeviceIsConnectedToInternet)
            {
                UpdateUIOnConnectionStateChanged(false);
            }
        }