I have followed the guide https://docs.telerik.com/devtools/maui/controls/map/getting-started to integrate maps into my app. However, all I get is an empty white rectangle.
MainPage.xaml:
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:telerikMap="clr-namespace:Telerik.XamarinForms.Map;assembly=Telerik.Maui.Controls.Compatibility"
x:Class="MauiApp1.MainPage"
BackgroundColor="{DynamicResource SecondaryColor}">
<ScrollView>
<Grid RowSpacing="25" HorizontalOptions="Fill" BackgroundColor="LightBlue" RowDefinitions="Auto, auto"
Padding="{OnPlatform iOS='30,60,30,30', Default='20'}">
<Grid Grid.Row="0" HeightRequest="600" BackgroundColor="Green">
<telerikMap:RadMap x:Name="map" AutomationId="map">
<telerikMap:RadMap.Layers>
<telerikMap:ShapefileLayer>
<telerikMap:ShapefileLayer.Reader>
<telerikMap:MapShapeReader x:Name="reader"/>
</telerikMap:ShapefileLayer.Reader>
</telerikMap:ShapefileLayer>
</telerikMap:RadMap.Layers>
</telerikMap:RadMap>
</Grid>
</Grid>
</ScrollView>
</ContentPage>
MainPage.xaml.cs:
using Telerik.XamarinForms.Map;
using Telerik.XamarinForms.ShapefileReader;
namespace MauiApp1;
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
var assembly = this.GetType().Assembly;
var source = MapSource.FromResource("SDKBrowserMaui.Examples.MapControl.world.shp", assembly);
this.reader.Source = source;
Console.WriteLine("Source: " + source + "Reader: " + this.reader);
}
}
Output:
Source: Telerik.XamarinForms.Map.StreamMapSource Reader: Telerik.XamarinForms.Map.MapShapeReader