Select to view content in your preferred language

MAUI Hybrid Blazor app

318
5
08-20-2024 11:21 PM
Labels (5)
RonakPatel2
New Contributor

I am building a cross-platform app using MAUI Blazor Hybrid template. This allows me to define and use MAUI.AcrGISRuntime.Mapping library on the Blazor Server component but I am unable to render the MapView with the reference of MapView.
This is how I am referencing it.
<MapView Map="@_mapView" Width="100%" Height="100px;" />
@code{

private static MapView _mapView;

private async Task InitializeMapAsync()

{
_mapView = new MapView
{
Map = new Map(new Uri("https://www.arcgis.com/apps/mapviewer/index.html?webmap=55ebf90799fa4a3fa57562700a68c405"))
};

}

}

protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{

await InitializeMapAsync();
}
}

0 Kudos
5 Replies
MichaelBranscomb
Esri Frequent Contributor

Hi,

Can you share a bit more information about your project?

It appears it might be a little outside what's considered normal/permitted usage of the SDK. As far as I'm aware, we haven't designed for, or tested, rendering to an embedded Web View and therefore may not technically be able to support Blazor Hybrid. Additionally the terms of use include "...may not be used to develop Internet or server-based Value-Added Applications". It's licensed per-user (and per-application if using the license string approach) and therefore the service/server usage limitation typically applies to server-side applications that can be accessed concurrently by multiple users.

 

Thanks

RonakPatel2
New Contributor

In Blazor hybrid we can have both client and server components running on the client end. I have been able to initiate the .Net runtime map on the server side but as you have highlighted the rendering is not supported unless I use WebView.

The offline map capability is required for my application and when using WebView with JS API the offline map is not supported. Looks like I will be locked to use XAML template to access the full capability of offline mode features.

0 Kudos
dotMorten_esri
Esri Notable Contributor

You can't host MAUI UI Controls inside the Blazor pages (AFAIK it only works the other way around that you can host the BlazorWebView inside a XAML page)

René_AstadDupont
Occasional Contributor

You might take a look at GeoBlazor from Dymaptic. Maybe that is what you are looking fore. 

0 Kudos
dotMorten_esri
Esri Notable Contributor

GeoBlazor is awesome, but I don't believe it supports offline, since it's just a blazor wrapper of the JS API.

0 Kudos