using Microsoft.AspNetCore.Components; using System; namespace Radzen.Blazor { /// /// RadzenGoogleMapMarker component. /// public class RadzenGoogleMapMarker : RadzenComponent { /// /// Gets or sets the position. /// /// The position. [Parameter] public GoogleMapPosition Position { get; set; } = new GoogleMapPosition() { Lat = 0, Lng = 0 }; /// /// Gets or sets the title. /// /// The title. [Parameter] public string? Title { get; set; } /// /// Gets or sets the label. /// /// The label. [Parameter] public string? Label { get; set; } RadzenGoogleMap? _map; /// /// Gets or sets the map. /// /// The map. [CascadingParameter] public RadzenGoogleMap? Map { get { return _map; } set { if (_map != value && value != null) { _map = value; _map.AddMarker(this); } } } /// /// Disposes this instance. /// public override void Dispose() { base.Dispose(); Map?.RemoveMarker(this); GC.SuppressFinalize(this); } } }