Currently I'm trying to navigate to a different page when the user clicks on a link inside a marker popup:
<OpenStreetMap @ref="_map" Style="width:100%;height:100%;" @bind-Center="_center" AutoPopup>
<Popup>
<div id="popup" class="ol-box">
@if (context is IntersectionMarker marker)
{
<h3>@marker.Name</h3>
<p>@marker.Description</p>
@* Neither of these work *@
@* <p><a class="nav-link" href="/somepage/@marker.InternalId">Analyse</a></p> *@
@* <button @onclick="@(()=>NavigationManager.NavigateTo($"/somepage/{@marker.InternalId}"))">Test</button> *@
}
</div>
</Popup>
</OpenStreetMap>
I also tried routing onclick to a method I declared on my IntersectionMarker class (which derives from Marker, but no luck either. Am I doing this the wrong way? I'm rather new to Blazor, so maybe what I'm trying does not make any sense.
My aim is to have a few links related to a marker, that the user can click to go to a marker-specific page.
Currently I'm trying to navigate to a different page when the user clicks on a link inside a marker popup:
I also tried routing onclick to a method I declared on my
IntersectionMarker
class (which derives fromMarker
, but no luck either. Am I doing this the wrong way? I'm rather new to Blazor, so maybe what I'm trying does not make any sense.My aim is to have a few links related to a marker, that the user can click to go to a marker-specific page.