mirror of
https://github.com/farcasclaudiu/BlazorDeviceInterop.git
synced 2026-06-22 09:01:04 +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 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user