Beispiel #1
0
        View CreateMapContentView()
        {
            //Coordinates for the starting point of the map
            const double latitude  = 41.788081;
            const double longitude = -87.831573;

            var location = new Position(latitude, longitude);

            var _map = new ExtendedMap.Forms.Plugin.Abstractions.ExtendedMap(MapSpan.FromCenterAndRadius(location, Distance.FromMiles(15)))
            {
                IsShowingUser = true
            };

            _map.StyleId = "CustomMap";

            _map.ShareText = string.Format("This is a custom message text");

            _map.BindingContext = BindingContext;

            _map.SetBinding <ExtendedMapViewModel>(ExtendedMap.Forms.Plugin.Abstractions.ExtendedMap.CustomPinsProperty, x => x.SamplePins);

            var createMapContentView = new CustomMapContentView(_map);

            return(createMapContentView);
        }
        public MainPage()
        {
            _viewModel     = new MainPageViewModel(new VolleyballLocationService());
            BindingContext = _viewModel;

            BackgroundColor = Color.White;

            //Coordinates for the starting point of the map
            const double latitude  = 41.788081;
            const double longitude = -87.831573;

            var location = new Position(latitude, longitude);

            var map = new CustomMap(MapSpan.FromCenterAndRadius(location, Distance.FromMiles(20)))
            {
                IsShowingUser = true
            };

            map.BindingContext = _viewModel;
            map.SetBinding <MainPageViewModel> (CustomMap.CustomPinsProperty, x => x.VolleyballLocations);

            Content = new CustomMapContentView(map);
        }