Skip to content

Commit

Permalink
fix marker id comparison (#22)
Browse files Browse the repository at this point in the history
Co-authored-by: lolochristen <[email protected]>
  • Loading branch information
lolochristen and lolochristen authored Nov 10, 2023
1 parent 5388af4 commit 3c6f051
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/OpenLayers.Blazor.Demo.Components/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Visible Extent: @_map?.VisibleExtent
</div>
</Popup>
<Features>
<Marker Type="MarkerType.MarkerPin" Coordinate="new Coordinate(1197650, 2604200)"></Marker>
<Marker Type="MarkerType.MarkerPin" Coordinate="new Coordinate(1197650, 2604200)" Popup></Marker>
<Marker Type="MarkerType.MarkerFlag" Coordinate="new Coordinate(1177650, 2624200)" Title="Hallo" BackgroundColor="#449933" Popup></Marker>
<Line Points="new[] { new Coordinate(1197650, 2604200), new Coordinate(1177650, 2624200) }" BorderColor="cyan"></Line>
</Features>
Expand Down
2 changes: 1 addition & 1 deletion src/OpenLayers.Blazor/Map.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public async Task OnInternalMarkerClick(Internal.Marker marker)
#if DEBUG
Console.WriteLine($"OnInternalMarkerClick: {JsonSerializer.Serialize(marker)}");
#endif
var m = MarkersList.FirstOrDefault(p => p.InternalFeature.Id == marker.Id);
var m = MarkersList.FirstOrDefault(p => string.Equals(p.InternalFeature.Id.ToString(), marker.Id.ToString(), StringComparison.OrdinalIgnoreCase));

if (m != null)
{
Expand Down

0 comments on commit 3c6f051

Please sign in to comment.