Files
BlazorDeviceInterop/BlazorDeviceInterop.Components/LeafletMap/LeafletMap.razor.cs
T
Bernard Darnton 9576c5aa5b Add project files.
2020-10-12 06:03:49 +13:00

24 lines
696 B
C#

using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using System.Threading.Tasks;
namespace BlazorDeviceInterop.Components.LeafletMap
{
public class LeafletMapBase : ComponentBase
{
[Inject] public IJSRuntime JSRuntime { get; set; }
[Parameter] public Map Map { get; set; }
[Parameter] public TileLayer TileLayer { get; set; }
protected async override Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await Map.BindToJsRuntime(JSRuntime);
await TileLayer.BindToJsRuntime(JSRuntime);
await TileLayer.AddTo(Map);
}
}
}
}