Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Map not being displayed

$
0
0

Hello

I have a sample Xamarin forms application that I want to display a map in

My map page code is very basic and was taken from the help article

using Xamarin.Forms;
using Xamarin.Forms.Maps;

namespace STC.Alerts.Pages.Maps
{
    public class MapPage : ContentPage
    {
        public MapPage()
        {
            var map = new Map(
                MapSpan.FromCenterAndRadius(
                    new Position(37, -122), Distance.FromMiles(0.3)))
            {

                HeightRequest = 100,
                WidthRequest = 960,
                VerticalOptions = LayoutOptions.FillAndExpand
            };
            var label = new Label() {Text = "wwww"};

            var stack = new StackLayout {Spacing = 0};
            stack.Children.Add(label);
            stack.Children.Add(map);
            Content = stack;
        }
    }
}

I have removed the ShowUser = true line in the method and that makes no difference

When I start my ios app, no map is shown? There are no error messages

The label does show. Interestingly if I add the label to the stack layout after the map the label is shown at the bottom which implies the map has occupied part of the view, but is not being painted

Can anyone help please?

I am not using the unified API yet, although that will be coming soon

Paul


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>