mirror of
https://github.com/farcasclaudiu/BlazorDeviceInterop.git
synced 2026-06-22 07:01:03 +03:00
Add project files.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user