Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/Controls/Maps/src/HandlerImpl/Map.Impl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public partial class Map : IMap, IEnumerable<IMapPin>

IList<IMapPin> IMap.Pins => _pins.Cast<IMapPin>().ToList();

Location? IMap.LastUserLocation => _lastUserLocation;

void IMap.Clicked(Location location) => MapClicked?.Invoke(this, new MapClickedEventArgs(location));

bool IMap.ClusterClicked(IReadOnlyList<IMapPin> pins, Location location)
Expand All @@ -22,6 +24,17 @@ bool IMap.ClusterClicked(IReadOnlyList<IMapPin> pins, Location location)
return args.Handled;
}

void IMap.UserLocationUpdated(Location location)
{
if (Equals(_lastUserLocation, location))
return;

OnPropertyChanging(nameof(LastUserLocation));
_lastUserLocation = location;
Comment thread
jfversluis marked this conversation as resolved.
Resolved
OnPropertyChanged(nameof(LastUserLocation));
UserLocationChanged?.Invoke(this, new UserLocationChangedEventArgs(location));
}

void IMap.LongClicked(Location location) => MapLongClicked?.Invoke(this, new MapClickedEventArgs(location));

void IMap.ShowInfoWindow(IMapPin pin) => Handler?.Invoke(nameof(IMap.ShowInfoWindow), pin);
Expand Down
22 changes: 22 additions & 0 deletions src/Controls/Maps/src/Map.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.ComponentModel;
using System.Linq;
using Microsoft.Maui.Controls.Internals;
using Microsoft.Maui.Devices.Sensors;
using Microsoft.Maui.Maps;

namespace Microsoft.Maui.Controls.Maps
Expand Down Expand Up @@ -53,6 +54,7 @@ public partial class Map : View
readonly ObservableCollection<MapElement> _mapElements = new();
MapSpan? _visibleRegion;
MapSpan? _lastMoveToRegion;
Location? _lastUserLocation;

/// <summary>
/// Initializes a new instance of the <see cref="Map"/> class with a region.
Expand Down Expand Up @@ -215,6 +217,26 @@ public MapSpan? Region
/// </summary>
public event EventHandler<MapClickedEventArgs>? MapLongClicked;

/// <summary>
/// Occurs when the user's location is updated on the map.
/// </summary>
/// <remarks>
/// This event fires when the platform map handler reports a location update.
/// The handler only sends updates when <see cref="IsShowingUser"/> is set to true
/// and location permissions have been granted.
/// </remarks>
public event EventHandler<UserLocationChangedEventArgs>? UserLocationChanged;
Comment thread
jfversluis marked this conversation as resolved.
Resolved

/// <summary>
/// Gets the last known user location from the map, or null if not available.
/// </summary>
/// <remarks>
/// This property requires <see cref="IsShowingUser"/> to be set to true
/// and location permissions to be granted. The location is updated as the
/// user moves and the map receives location updates.
/// </remarks>
public Location? LastUserLocation => _lastUserLocation;

/// <summary>
/// Gets the currently visible region of the map.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ Microsoft.Maui.Controls.Maps.ClusterClickedEventArgs.Pins.get -> System.Collecti
Microsoft.Maui.Controls.Maps.Map.ClusterClicked -> System.EventHandler<Microsoft.Maui.Controls.Maps.ClusterClickedEventArgs!>?
Microsoft.Maui.Controls.Maps.Map.IsClusteringEnabled.get -> bool
Microsoft.Maui.Controls.Maps.Map.IsClusteringEnabled.set -> void
Microsoft.Maui.Controls.Maps.Map.LastUserLocation.get -> Microsoft.Maui.Devices.Sensors.Location?
Microsoft.Maui.Controls.Maps.Map.MapLongClicked -> System.EventHandler<Microsoft.Maui.Controls.Maps.MapClickedEventArgs!>?
Microsoft.Maui.Controls.Maps.Map.Region.get -> Microsoft.Maui.Maps.MapSpan?
Microsoft.Maui.Controls.Maps.Map.Region.set -> void
Microsoft.Maui.Controls.Maps.Map.UserLocationChanged -> System.EventHandler<Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs!>?
Microsoft.Maui.Controls.Maps.MapElement.IsVisible.get -> bool
Microsoft.Maui.Controls.Maps.MapElement.IsVisible.set -> void
Microsoft.Maui.Controls.Maps.MapElement.ZIndex.get -> int
Expand All @@ -25,6 +27,9 @@ Microsoft.Maui.Controls.Maps.Pin.ImageSource.set -> void
Microsoft.Maui.Controls.Maps.Pin.ShowInfoWindow() -> void
Microsoft.Maui.Controls.Maps.Polygon.PolygonClicked -> System.EventHandler?
Microsoft.Maui.Controls.Maps.Polyline.PolylineClicked -> System.EventHandler?
Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs
Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs.Location.get -> Microsoft.Maui.Devices.Sensors.Location!
Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs.UserLocationChangedEventArgs(Microsoft.Maui.Devices.Sensors.Location! location) -> void
const Microsoft.Maui.Controls.Maps.Pin.DefaultClusteringIdentifier = "maui_default_cluster" -> string!
static readonly Microsoft.Maui.Controls.Maps.Map.IsClusteringEnabledProperty -> Microsoft.Maui.Controls.BindableProperty!
static readonly Microsoft.Maui.Controls.Maps.Map.RegionProperty -> Microsoft.Maui.Controls.BindableProperty!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ Microsoft.Maui.Controls.Maps.ClusterClickedEventArgs.Pins.get -> System.Collecti
Microsoft.Maui.Controls.Maps.Map.ClusterClicked -> System.EventHandler<Microsoft.Maui.Controls.Maps.ClusterClickedEventArgs!>?
Microsoft.Maui.Controls.Maps.Map.IsClusteringEnabled.get -> bool
Microsoft.Maui.Controls.Maps.Map.IsClusteringEnabled.set -> void
Microsoft.Maui.Controls.Maps.Map.LastUserLocation.get -> Microsoft.Maui.Devices.Sensors.Location?
Microsoft.Maui.Controls.Maps.Map.MapLongClicked -> System.EventHandler<Microsoft.Maui.Controls.Maps.MapClickedEventArgs!>?
Microsoft.Maui.Controls.Maps.Map.Region.get -> Microsoft.Maui.Maps.MapSpan?
Microsoft.Maui.Controls.Maps.Map.Region.set -> void
Microsoft.Maui.Controls.Maps.Map.UserLocationChanged -> System.EventHandler<Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs!>?
Microsoft.Maui.Controls.Maps.MapElement.IsVisible.get -> bool
Microsoft.Maui.Controls.Maps.MapElement.IsVisible.set -> void
Microsoft.Maui.Controls.Maps.MapElement.ZIndex.get -> int
Expand All @@ -25,6 +27,9 @@ Microsoft.Maui.Controls.Maps.Pin.ImageSource.set -> void
Microsoft.Maui.Controls.Maps.Pin.ShowInfoWindow() -> void
Microsoft.Maui.Controls.Maps.Polygon.PolygonClicked -> System.EventHandler?
Microsoft.Maui.Controls.Maps.Polyline.PolylineClicked -> System.EventHandler?
Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs
Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs.Location.get -> Microsoft.Maui.Devices.Sensors.Location!
Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs.UserLocationChangedEventArgs(Microsoft.Maui.Devices.Sensors.Location! location) -> void
const Microsoft.Maui.Controls.Maps.Pin.DefaultClusteringIdentifier = "maui_default_cluster" -> string!
static readonly Microsoft.Maui.Controls.Maps.Map.IsClusteringEnabledProperty -> Microsoft.Maui.Controls.BindableProperty!
static readonly Microsoft.Maui.Controls.Maps.Map.RegionProperty -> Microsoft.Maui.Controls.BindableProperty!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ Microsoft.Maui.Controls.Maps.ClusterClickedEventArgs.Pins.get -> System.Collecti
Microsoft.Maui.Controls.Maps.Map.ClusterClicked -> System.EventHandler<Microsoft.Maui.Controls.Maps.ClusterClickedEventArgs!>?
Microsoft.Maui.Controls.Maps.Map.IsClusteringEnabled.get -> bool
Microsoft.Maui.Controls.Maps.Map.IsClusteringEnabled.set -> void
Microsoft.Maui.Controls.Maps.Map.LastUserLocation.get -> Microsoft.Maui.Devices.Sensors.Location?
Microsoft.Maui.Controls.Maps.Map.MapLongClicked -> System.EventHandler<Microsoft.Maui.Controls.Maps.MapClickedEventArgs!>?
Microsoft.Maui.Controls.Maps.Map.Region.get -> Microsoft.Maui.Maps.MapSpan?
Microsoft.Maui.Controls.Maps.Map.Region.set -> void
Microsoft.Maui.Controls.Maps.Map.UserLocationChanged -> System.EventHandler<Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs!>?
Microsoft.Maui.Controls.Maps.MapElement.IsVisible.get -> bool
Microsoft.Maui.Controls.Maps.MapElement.IsVisible.set -> void
Microsoft.Maui.Controls.Maps.MapElement.ZIndex.get -> int
Expand All @@ -25,6 +27,9 @@ Microsoft.Maui.Controls.Maps.Pin.ImageSource.set -> void
Microsoft.Maui.Controls.Maps.Pin.ShowInfoWindow() -> void
Microsoft.Maui.Controls.Maps.Polygon.PolygonClicked -> System.EventHandler?
Microsoft.Maui.Controls.Maps.Polyline.PolylineClicked -> System.EventHandler?
Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs
Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs.Location.get -> Microsoft.Maui.Devices.Sensors.Location!
Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs.UserLocationChangedEventArgs(Microsoft.Maui.Devices.Sensors.Location! location) -> void
const Microsoft.Maui.Controls.Maps.Pin.DefaultClusteringIdentifier = "maui_default_cluster" -> string!
static readonly Microsoft.Maui.Controls.Maps.Map.IsClusteringEnabledProperty -> Microsoft.Maui.Controls.BindableProperty!
static readonly Microsoft.Maui.Controls.Maps.Map.RegionProperty -> Microsoft.Maui.Controls.BindableProperty!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ Microsoft.Maui.Controls.Maps.ClusterClickedEventArgs.Pins.get -> System.Collecti
Microsoft.Maui.Controls.Maps.Map.ClusterClicked -> System.EventHandler<Microsoft.Maui.Controls.Maps.ClusterClickedEventArgs!>?
Microsoft.Maui.Controls.Maps.Map.IsClusteringEnabled.get -> bool
Microsoft.Maui.Controls.Maps.Map.IsClusteringEnabled.set -> void
Microsoft.Maui.Controls.Maps.Map.LastUserLocation.get -> Microsoft.Maui.Devices.Sensors.Location?
Microsoft.Maui.Controls.Maps.Map.MapLongClicked -> System.EventHandler<Microsoft.Maui.Controls.Maps.MapClickedEventArgs!>?
Microsoft.Maui.Controls.Maps.Map.Region.get -> Microsoft.Maui.Maps.MapSpan?
Microsoft.Maui.Controls.Maps.Map.Region.set -> void
Microsoft.Maui.Controls.Maps.Map.UserLocationChanged -> System.EventHandler<Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs!>?
Microsoft.Maui.Controls.Maps.MapElement.IsVisible.get -> bool
Microsoft.Maui.Controls.Maps.MapElement.IsVisible.set -> void
Microsoft.Maui.Controls.Maps.MapElement.ZIndex.get -> int
Expand All @@ -25,6 +27,9 @@ Microsoft.Maui.Controls.Maps.Pin.ImageSource.set -> void
Microsoft.Maui.Controls.Maps.Pin.ShowInfoWindow() -> void
Microsoft.Maui.Controls.Maps.Polygon.PolygonClicked -> System.EventHandler?
Microsoft.Maui.Controls.Maps.Polyline.PolylineClicked -> System.EventHandler?
Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs
Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs.Location.get -> Microsoft.Maui.Devices.Sensors.Location!
Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs.UserLocationChangedEventArgs(Microsoft.Maui.Devices.Sensors.Location! location) -> void
const Microsoft.Maui.Controls.Maps.Pin.DefaultClusteringIdentifier = "maui_default_cluster" -> string!
static readonly Microsoft.Maui.Controls.Maps.Map.IsClusteringEnabledProperty -> Microsoft.Maui.Controls.BindableProperty!
static readonly Microsoft.Maui.Controls.Maps.Map.RegionProperty -> Microsoft.Maui.Controls.BindableProperty!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ Microsoft.Maui.Controls.Maps.ClusterClickedEventArgs.Pins.get -> System.Collecti
Microsoft.Maui.Controls.Maps.Map.ClusterClicked -> System.EventHandler<Microsoft.Maui.Controls.Maps.ClusterClickedEventArgs!>?
Microsoft.Maui.Controls.Maps.Map.IsClusteringEnabled.get -> bool
Microsoft.Maui.Controls.Maps.Map.IsClusteringEnabled.set -> void
Microsoft.Maui.Controls.Maps.Map.LastUserLocation.get -> Microsoft.Maui.Devices.Sensors.Location?
Microsoft.Maui.Controls.Maps.Map.MapLongClicked -> System.EventHandler<Microsoft.Maui.Controls.Maps.MapClickedEventArgs!>?
Microsoft.Maui.Controls.Maps.Map.Region.get -> Microsoft.Maui.Maps.MapSpan?
Microsoft.Maui.Controls.Maps.Map.Region.set -> void
Microsoft.Maui.Controls.Maps.Map.UserLocationChanged -> System.EventHandler<Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs!>?
Microsoft.Maui.Controls.Maps.MapElement.IsVisible.get -> bool
Microsoft.Maui.Controls.Maps.MapElement.IsVisible.set -> void
Microsoft.Maui.Controls.Maps.MapElement.ZIndex.get -> int
Expand All @@ -25,6 +27,9 @@ Microsoft.Maui.Controls.Maps.Pin.ImageSource.set -> void
Microsoft.Maui.Controls.Maps.Pin.ShowInfoWindow() -> void
Microsoft.Maui.Controls.Maps.Polygon.PolygonClicked -> System.EventHandler?
Microsoft.Maui.Controls.Maps.Polyline.PolylineClicked -> System.EventHandler?
Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs
Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs.Location.get -> Microsoft.Maui.Devices.Sensors.Location!
Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs.UserLocationChangedEventArgs(Microsoft.Maui.Devices.Sensors.Location! location) -> void
const Microsoft.Maui.Controls.Maps.Pin.DefaultClusteringIdentifier = "maui_default_cluster" -> string!
static readonly Microsoft.Maui.Controls.Maps.Map.IsClusteringEnabledProperty -> Microsoft.Maui.Controls.BindableProperty!
static readonly Microsoft.Maui.Controls.Maps.Map.RegionProperty -> Microsoft.Maui.Controls.BindableProperty!
Expand Down
5 changes: 5 additions & 0 deletions src/Controls/Maps/src/PublicAPI/net/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ Microsoft.Maui.Controls.Maps.ClusterClickedEventArgs.Pins.get -> System.Collecti
Microsoft.Maui.Controls.Maps.Map.ClusterClicked -> System.EventHandler<Microsoft.Maui.Controls.Maps.ClusterClickedEventArgs!>?
Microsoft.Maui.Controls.Maps.Map.IsClusteringEnabled.get -> bool
Microsoft.Maui.Controls.Maps.Map.IsClusteringEnabled.set -> void
Microsoft.Maui.Controls.Maps.Map.LastUserLocation.get -> Microsoft.Maui.Devices.Sensors.Location?
Microsoft.Maui.Controls.Maps.Map.MapLongClicked -> System.EventHandler<Microsoft.Maui.Controls.Maps.MapClickedEventArgs!>?
Microsoft.Maui.Controls.Maps.Map.Region.get -> Microsoft.Maui.Maps.MapSpan?
Microsoft.Maui.Controls.Maps.Map.Region.set -> void
Microsoft.Maui.Controls.Maps.Map.UserLocationChanged -> System.EventHandler<Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs!>?
Microsoft.Maui.Controls.Maps.MapElement.IsVisible.get -> bool
Microsoft.Maui.Controls.Maps.MapElement.IsVisible.set -> void
Microsoft.Maui.Controls.Maps.MapElement.ZIndex.get -> int
Expand All @@ -25,6 +27,9 @@ Microsoft.Maui.Controls.Maps.Pin.ImageSource.set -> void
Microsoft.Maui.Controls.Maps.Pin.ShowInfoWindow() -> void
Microsoft.Maui.Controls.Maps.Polygon.PolygonClicked -> System.EventHandler?
Microsoft.Maui.Controls.Maps.Polyline.PolylineClicked -> System.EventHandler?
Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs
Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs.Location.get -> Microsoft.Maui.Devices.Sensors.Location!
Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs.UserLocationChangedEventArgs(Microsoft.Maui.Devices.Sensors.Location! location) -> void
const Microsoft.Maui.Controls.Maps.Pin.DefaultClusteringIdentifier = "maui_default_cluster" -> string!
static readonly Microsoft.Maui.Controls.Maps.Map.IsClusteringEnabledProperty -> Microsoft.Maui.Controls.BindableProperty!
static readonly Microsoft.Maui.Controls.Maps.Map.RegionProperty -> Microsoft.Maui.Controls.BindableProperty!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ Microsoft.Maui.Controls.Maps.ClusterClickedEventArgs.Pins.get -> System.Collecti
Microsoft.Maui.Controls.Maps.Map.ClusterClicked -> System.EventHandler<Microsoft.Maui.Controls.Maps.ClusterClickedEventArgs!>?
Microsoft.Maui.Controls.Maps.Map.IsClusteringEnabled.get -> bool
Microsoft.Maui.Controls.Maps.Map.IsClusteringEnabled.set -> void
Microsoft.Maui.Controls.Maps.Map.LastUserLocation.get -> Microsoft.Maui.Devices.Sensors.Location?
Microsoft.Maui.Controls.Maps.Map.MapLongClicked -> System.EventHandler<Microsoft.Maui.Controls.Maps.MapClickedEventArgs!>?
Microsoft.Maui.Controls.Maps.Map.Region.get -> Microsoft.Maui.Maps.MapSpan?
Microsoft.Maui.Controls.Maps.Map.Region.set -> void
Microsoft.Maui.Controls.Maps.Map.UserLocationChanged -> System.EventHandler<Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs!>?
Microsoft.Maui.Controls.Maps.MapElement.IsVisible.get -> bool
Microsoft.Maui.Controls.Maps.MapElement.IsVisible.set -> void
Microsoft.Maui.Controls.Maps.MapElement.ZIndex.get -> int
Expand All @@ -25,6 +27,9 @@ Microsoft.Maui.Controls.Maps.Pin.ImageSource.set -> void
Microsoft.Maui.Controls.Maps.Pin.ShowInfoWindow() -> void
Microsoft.Maui.Controls.Maps.Polygon.PolygonClicked -> System.EventHandler?
Microsoft.Maui.Controls.Maps.Polyline.PolylineClicked -> System.EventHandler?
Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs
Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs.Location.get -> Microsoft.Maui.Devices.Sensors.Location!
Microsoft.Maui.Controls.Maps.UserLocationChangedEventArgs.UserLocationChangedEventArgs(Microsoft.Maui.Devices.Sensors.Location! location) -> void
const Microsoft.Maui.Controls.Maps.Pin.DefaultClusteringIdentifier = "maui_default_cluster" -> string!
static readonly Microsoft.Maui.Controls.Maps.Map.IsClusteringEnabledProperty -> Microsoft.Maui.Controls.BindableProperty!
static readonly Microsoft.Maui.Controls.Maps.Map.RegionProperty -> Microsoft.Maui.Controls.BindableProperty!
Expand Down
24 changes: 24 additions & 0 deletions src/Controls/Maps/src/UserLocationChangedEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Microsoft.Maui.Devices.Sensors;

namespace Microsoft.Maui.Controls.Maps
{
/// <summary>
/// Event arguments for the <see cref="Map.UserLocationChanged"/> event.
/// </summary>
public class UserLocationChangedEventArgs : System.EventArgs
{
/// <summary>
/// Gets the updated user location.
/// </summary>
public Location Location { get; }

/// <summary>
/// Initializes a new instance of the <see cref="UserLocationChangedEventArgs"/> class.
/// </summary>
/// <param name="location">The user's updated location.</param>
public UserLocationChangedEventArgs(Location location)
{
Location = location;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public MapsGallery()
GalleryBuilder.NavButton("MapElement Click Events", () => new MapElementClickGallery(), Navigation),
GalleryBuilder.NavButton("Map Long Click", () => new MapLongClickGallery(), Navigation),
GalleryBuilder.NavButton("Info Window", () => new InfoWindowGallery(), Navigation),
GalleryBuilder.NavButton("User Location", () => new UserLocationGallery(), Navigation),
}
}
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:maps="http://schemas.microsoft.com/dotnet/2021/maui/maps"
x:Class="Maui.Controls.Sample.Pages.MapsGalleries.UserLocationGallery"
Title="User Location">
<Grid RowDefinitions="Auto, Auto, Auto, *">
<!-- Controls -->
<HorizontalStackLayout Grid.Row="0" Spacing="5" Padding="10">
<Label Text="Show User Location:" VerticalOptions="Center"/>
<Switch x:Name="ShowUserSwitch" IsToggled="True" VerticalOptions="Center"/>
</HorizontalStackLayout>

<!-- Last Location Display -->
<Frame Grid.Row="1" Margin="10" Padding="10" BackgroundColor="{AppThemeBinding Light=#F5F5F5, Dark=#333333}">
<VerticalStackLayout>
<Label Text="Last User Location:" FontAttributes="Bold"/>
<Label x:Name="LatitudeLabel" Text="Latitude: --"/>
<Label x:Name="LongitudeLabel" Text="Longitude: --"/>
<Label x:Name="UpdateCountLabel" Text="Updates received: 0"/>
</VerticalStackLayout>
</Frame>

<!-- Event Log -->
<Frame Grid.Row="2" Margin="10" Padding="10" MaximumHeightRequest="120" BackgroundColor="{AppThemeBinding Light=#F5F5F5, Dark=#333333}">
<VerticalStackLayout>
<Label Text="Recent Location Updates:" FontAttributes="Bold"/>
<ScrollView>
<Label x:Name="EventLogLabel" FontSize="11" Text="Waiting for location updates..."/>
</ScrollView>
</VerticalStackLayout>
</Frame>

<!-- Map -->
<maps:Map x:Name="userLocationMap" Grid.Row="3"
IsShowingUser="{Binding IsToggled, Source={x:Reference ShowUserSwitch}}"
MapClicked="OnMapClicked"
UserLocationChanged="OnUserLocationChanged"/>
</Grid>
</ContentPage>
Loading
Loading