我一直在尝试让地图显示在应用程序中,我已经设置了权限并且在配置中使用了 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;
}
}
我在这里错过了什么?