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

23 lines
685 B
C#

using Microsoft.JSInterop;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace BlazorDeviceInterop.Components.LeafletMap
{
public class Marker : InteractiveLayer
{
[JsonIgnore] public LatLng LatLng { get; }
[JsonIgnore] public MarkerOptions Options { get; }
public Marker(LatLng latlng, MarkerOptions options)
{
LatLng = latlng;
Options = options;
}
protected override async Task<JsRuntimeObjectRef> CreateJsObjectRef(IJSRuntime jsRuntime)
{
return await jsRuntime.InvokeAsync<JsRuntimeObjectRef>("LeafletMap.marker", LatLng, Options);
}
}
}