initial commit
This commit is contained in:
19
BlazingPizza.ComponentsLibrary/Map/Map.razor
Normal file
19
BlazingPizza.ComponentsLibrary/Map/Map.razor
Normal file
@@ -0,0 +1,19 @@
|
||||
@using Microsoft.JSInterop
|
||||
@inject IJSRuntime JSRuntime
|
||||
|
||||
<div id="@elementId" style="height: 100%; width: 100%;"></div>
|
||||
|
||||
@code {
|
||||
string elementId = $"map-{Guid.NewGuid().ToString("D")}";
|
||||
|
||||
[Parameter] public double Zoom { get; set; }
|
||||
[Parameter] public List<Marker> Markers { get; set; }
|
||||
|
||||
protected async override Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
await JSRuntime.InvokeVoidAsync(
|
||||
"deliveryMap.showOrUpdate",
|
||||
elementId,
|
||||
Markers);
|
||||
}
|
||||
}
|
||||
13
BlazingPizza.ComponentsLibrary/Map/Marker.cs
Normal file
13
BlazingPizza.ComponentsLibrary/Map/Marker.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace BlazingPizza.ComponentsLibrary.Map
|
||||
{
|
||||
public class Marker
|
||||
{
|
||||
public string Description { get; set; }
|
||||
|
||||
public double X { get; set; }
|
||||
|
||||
public double Y { get; set; }
|
||||
|
||||
public bool ShowPopup { get; set; }
|
||||
}
|
||||
}
|
||||
9
BlazingPizza.ComponentsLibrary/Map/Point.cs
Normal file
9
BlazingPizza.ComponentsLibrary/Map/Point.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace BlazingPizza.ComponentsLibrary.Map
|
||||
{
|
||||
public class Point
|
||||
{
|
||||
public double X { get; set; }
|
||||
|
||||
public double Y { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user