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

24 lines
715 B
C#

using Microsoft.JSInterop;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace BlazorDeviceInterop.Components.LeafletMap
{
public class TileLayer : Layer
{
[JsonIgnore] public string UrlTemplate { get; }
[JsonIgnore] public TileLayerOptions Options { get; }
public TileLayer(string urlTemplate, TileLayerOptions options)
{
UrlTemplate = urlTemplate;
Options = options;
}
protected override async Task<JsRuntimeObjectRef> CreateJsObjectRef(IJSRuntime jsRuntime)
{
return await jsRuntime.InvokeAsync<JsRuntimeObjectRef>("LeafletMap.tileLayer", UrlTemplate, Options);
}
}
}