Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Repaint method to MarkerClustering. Updated some xml comments. #146

Merged
merged 1 commit into from
Sep 16, 2021
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
12 changes: 6 additions & 6 deletions GoogleMapsComponents/Maps/MarkerClustererOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class MarkerClustererOptions
public int? BatchSize { get; set; }

/// <summary>
/// The name of the CSS class defining general styles
/// The name of the CSS class defining general styles for the cluster markers.
/// </summary>
public string? ClusterClass { get; set; }

Expand All @@ -49,9 +49,9 @@ public class MarkerClustererOptions
public int? GridSize { get; set; }

/// <summary>
/// Whether to ignore hidden markers in clusters.You
/// Whether to ignore hidden markers in clusters. You
/// may want to set this to `true` to ensure that hidden markers are not included
/// in the marker count that appears on a cluster marker
/// in the marker count that appears on a cluster marker.
/// </summary>
public bool? IgnoreHidden { get; set; }

Expand Down Expand Up @@ -82,9 +82,9 @@ public class MarkerClustererOptions
public int? ZIndex { get; set; }

/// <summary>
/// Whether the position of a cluster marker should be
/// the average position of all markers in the cluster.If set to `false`, the
/// cluster marker is positioned at the location of the first marker added to the cluster.
/// Whether to zoom the map when a cluster marker is clicked. You may want to
/// set this to `false` if you have installed a handler for the `click` event
/// and it deals with zooming on its own.
/// </summary>
public bool? ZoomOnClick { get; set; }
}
Expand Down
15 changes: 15 additions & 0 deletions GoogleMapsComponents/Maps/MarkerClustering.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,31 @@ public virtual async Task SetMap(Map map)
await _jsObjectRef.InvokeAsync("setMap", map);
}

/// <summary>
/// Removes all clusters and markers from the map and also removes all markers managed by the clusterer.
/// </summary>
public virtual async Task ClearMarkers()
{
await _jsObjectRef.InvokeAsync("clearMarkers");
}

/// <summary>
/// Fits the map to the bounds of the markers managed by the clusterer.
/// </summary>
/// <param name="padding"></param>
public virtual async Task FitMapToMarkers(int padding)
{
await _jsObjectRef.InvokeAsync("fitMapToMarkers", padding);
}

/// <summary>
/// Recalculates and redraws all the marker clusters from scratch. Call this after changing any properties.
/// </summary>
public virtual async Task Repaint()
{
await _jsObjectRef.InvokeAsync("repaint");
}

public virtual async Task ClearListeners(string eventName)
{
if (EventListeners.ContainsKey(eventName))
Expand Down