Skip to content
This repository was archived by the owner on Mar 24, 2023. It is now read-only.
This repository was archived by the owner on Mar 24, 2023. It is now read-only.

Mapbox Xamarin.Forms black map on Android #115

Description

@Deathgar

I have created an empty Xamarin.Forms project. Installed all required nugets. Added accessToken to MainActivity.OnCreate. Added a map to the start page and got a black screen.

MainActivity:

protected override void OnCreate(Bundle savedInstanceState)
{
    base.OnCreate(savedInstanceState);

    Com.Mapbox.Mapboxsdk.Mapbox.GetInstance(this, MAPBOX_TOKEN);

    Xamarin.Essentials.Platform.Init(this, savedInstanceState);
    global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
    LoadApplication(new App());
}

MainPage.xaml:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
             xmlns:local="clr-namespace:Naxam.Controls.Forms;assembly=Naxam.Mapbox.Forms"
             x:Class="MapBoxEmpty.MainPage">

    <StackLayout>
        <local:MapView x:Name="map" 
                        VerticalOptions="FillAndExpand" 
                       HorizontalOptions="FillAndExpand"
                        MapStyle="LIGHT" 
        />
    </StackLayout>

</ContentPage>

App:
image

What's wrong?

P.s. Haven't looked at iOS.

https://dropmefiles.com/IbcPE

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions