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

24 lines
683 B
C#

using Microsoft.JSInterop;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace BlazorDeviceInterop.Components.LeafletMap
{
public class Map : InteropObject
{
[JsonIgnore] public string ElementId { get; }
[JsonIgnore] public MapOptions Options { get; }
public Map(string elementId, MapOptions options)
{
ElementId = elementId;
Options = options;
}
protected override async Task<JsRuntimeObjectRef> CreateJsObjectRef(IJSRuntime jsRuntime)
{
return await jsRuntime.InvokeAsync<JsRuntimeObjectRef>("LeafletMap.map", ElementId, Options);
}
}
}