Ejemplo n.º 1
0
        //Here all Markers for the Exhibits in the Main Map are set
        //and some general stuff
        private void SetMainScreenMarkers(IReadOnlyList <Exhibit> set)
        {
            locationOverlay = new MyLocationOverlay(activity, mapView);
            var compassOverlay = new CompassOverlay(activity, mapView);

            compassOverlay.EnableCompass();
            mapView.OverlayManager.Add(locationOverlay);
            mapView.OverlayManager.Add(compassOverlay);

            //Here all exhibit markers and bubbles are set if the Exhibit is not null
            if (set != null)
            {
                var markerInfoWindow = new ViaPointInfoWindow(Resource.Layout.navigation_info_window, mapView);
                var mapMarkerIcon    = ContextCompat.GetDrawable(activity, Resource.Drawable.marker_blue);
                var setMarker        = new SetMarker(mapView, markerInfoWindow);

                foreach (var e in set)
                {
                    //One Marker Object
                    var geoPoint = new GeoPoint(e.Location.Latitude, e.Location.Longitude);
                    var marker   = setMarker.AddMarker(null, e.Name, e.Description, geoPoint, mapMarkerIcon, e.Id);
                    mapView.OverlayManager.Add(marker);
                }
            }

            mapView.Invalidate();
        }
Ejemplo n.º 2
0
        public override void OnActivityCreated(Bundle savedInstanceState)
        {
            base.OnActivityCreated(savedInstanceState);

            var context = Activity;
            var dm      = context.Resources.DisplayMetrics;

            // mResourceProxy = new ResourceProxyImpl(getActivity().getApplicationContext());

            _prefs = context.GetSharedPreferences(OpenStreetMapConstants.PrefsName, FileCreationMode.Private);

            _compassOverlay = new CompassOverlay(context, new InternalCompassOrientationProvider(context),
                                                 _mapView);
            _myLocationOverlay = new MyLocationNewOverlay(context, new GpsMyLocationProvider(context),
                                                          _mapView);

            _minimapOverlay = new MinimapOverlay(Activity, _mapView.TileRequestCompleteHandler)
            {
                Width  = dm.WidthPixels / 5,
                Height = dm.HeightPixels / 5
            };

            _scaleBarOverlay = new ScaleBarOverlay(context);
            _scaleBarOverlay.SetCentred(true);
            _scaleBarOverlay.SetScaleBarOffset(dm.WidthPixels / 2, 10);

            _rotationGestureOverlay = new RotationGestureOverlay(context, _mapView)
            {
                Enabled = false
            };

            _mapView.SetBuiltInZoomControls(true);
            _mapView.SetMultiTouchControls(true);
            _mapView.Overlays.Add(_myLocationOverlay);
            _mapView.Overlays.Add(_compassOverlay);
            _mapView.Overlays.Add(_minimapOverlay);
            _mapView.Overlays.Add(_scaleBarOverlay);
            _mapView.Overlays.Add(_rotationGestureOverlay);

            _mapView.Controller.SetZoom(_prefs.GetInt(OpenStreetMapConstants.PrefsZoomLevel, 1));
            _mapView.ScrollTo(_prefs.GetInt(OpenStreetMapConstants.PrefsScrollX, 0),
                              _prefs.GetInt(OpenStreetMapConstants.PrefsScrollY, 0));

            _myLocationOverlay.EnableMyLocation();
            _compassOverlay.EnableCompass();

            HasOptionsMenu = true;
        }
Ejemplo n.º 3
0
        public override void OnActivityCreated(Bundle savedInstanceState)
        {
            base.OnActivityCreated(savedInstanceState);

            var context = Activity;
            var dm = context.Resources.DisplayMetrics;
            // mResourceProxy = new ResourceProxyImpl(getActivity().getApplicationContext());

            _prefs = context.GetSharedPreferences(OpenStreetMapConstants.PrefsName, FileCreationMode.Private);

            _compassOverlay = new CompassOverlay(context, new InternalCompassOrientationProvider(context),
                _mapView);
            _myLocationOverlay = new MyLocationNewOverlay(context, new GpsMyLocationProvider(context),
                _mapView);

            _minimapOverlay = new MinimapOverlay(Activity, _mapView.TileRequestCompleteHandler)
            {
                Width = dm.WidthPixels/5,
                Height = dm.HeightPixels/5
            };

            _scaleBarOverlay = new ScaleBarOverlay(context);
            _scaleBarOverlay.SetCentred(true);
            _scaleBarOverlay.SetScaleBarOffset(dm.WidthPixels/2, 10);

            _rotationGestureOverlay = new RotationGestureOverlay(context, _mapView) {Enabled = false};

            _mapView.SetBuiltInZoomControls(true);
            _mapView.SetMultiTouchControls(true);
            _mapView.Overlays.Add(_myLocationOverlay);
            _mapView.Overlays.Add(_compassOverlay);
            _mapView.Overlays.Add(_minimapOverlay);
            _mapView.Overlays.Add(_scaleBarOverlay);
            _mapView.Overlays.Add(_rotationGestureOverlay);

            _mapView.Controller.SetZoom(_prefs.GetInt(OpenStreetMapConstants.PrefsZoomLevel, 1));
            _mapView.ScrollTo(_prefs.GetInt(OpenStreetMapConstants.PrefsScrollX, 0),
                _prefs.GetInt(OpenStreetMapConstants.PrefsScrollY, 0));

            _myLocationOverlay.EnableMyLocation();
            _compassOverlay.EnableCompass();

            HasOptionsMenu = true;
        }