Maui 西装外套混合应用 Microsoft.Maui.Controls.Maps

问题描述 投票:0回答:0

我一直在尝试让地图显示在应用程序中,我已经设置了权限并且在配置中使用了 google api 密钥,但是在 te android 上它没有显示这里是代码。

@page "/"
@using Microsoft.AspNetCore.Components;
@using Microsoft.Maui.Controls;
@using Microsoft.Maui.Controls.Maps;
@using Microsoft.Maui.Maps;
@using FishbitesDemo.Classes;
@inject IJSRuntime JsRuntime
<h1>Hello, world!</h1>

Welcome to your new app.
<map></map>
@if (loc != null)
{
    <p>Your Location is @loc.Longitude , @loc.Latitude</p>

}

<SurveyPrompt Title="How is Blazor working for you?" />
@code{
    public Location loc;
    public Map map = new Map();
    protected override async Task OnInitializedAsync()
    {
        loc = await GeoTracking.GetCurrentLocation();
      
        map.MapType = MapType.Satellite;
      

    }

}

我在这里错过了什么?

blazor maui hybrid
© www.soinside.com 2019 - 2024. All rights reserved.