Skip to content

Commit

Permalink
Add properties to InfoWindowOptions interface #371
Browse files Browse the repository at this point in the history
  • Loading branch information
valentasm committed Sep 29, 2024
1 parent 93787ab commit 7a04780
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion GoogleMapsComponents/GoogleMapsComponents.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<RazorLangVersion>3.0</RazorLangVersion>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<PackageId>BlazorGoogleMaps</PackageId>
<Version>4.7.11</Version>
<Version>4.7.12</Version>
<Authors>Rungwiroon</Authors>
<Company>QueueStack Solution</Company>
<Product>BlazorGoogleMaps</Product>
Expand Down
28 changes: 25 additions & 3 deletions GoogleMapsComponents/Maps/InfoWindowOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,60 @@

/// <summary>
/// InfoWindowOptions object used to define the properties that can be set on a InfoWindow.
/// https://developers.google.com/maps/documentation/javascript/reference/info-window#InfoWindowOptions
/// </summary>
public class InfoWindowOptions
{
/// <summary>
/// AriaLabel to assign to the InfoWindow.
/// </summary>
public string? AriaLabel { get; set; }
/// <summary>
/// Content to display in the InfoWindow. This can be a plain-text string, or a string containing HTML.
/// The InfoWindow will be sized according to the content. To set an explicit size for the content, set content to be a HTML element with that size.
/// </summary>
public string Content { get; set; }
public string? Content { get; set; }

/// <summary>
/// Disable auto-pan on open. By default, the info window will pan the map so that it is fully visible when it opens.
/// </summary>
public bool? DisableAutoPan { get; set; }
/// <summary>
/// The content to display in the InfoWindow header row.
/// This can be an HTML element, or a string of plain text. The InfoWindow will be sized according to the content.
/// To set an explicit size for the header content, set headerContent to be a HTML element with that size.
/// </summary>
public string? HeaderContent { get; set; }
/// <summary>
/// Disables the whole header row in the InfoWindow. When set to true, the header will be removed so that the header content and the close button will be hidden.
/// </summary>
public bool? HeaderDisabled { get; set; }

/// <summary>
/// Maximum width of the infowindow, regardless of content's width.
/// This value is only considered if it is set before a call to open.
/// To change the maximum width when changing content, call close, setOptions, and then open.
/// </summary>
public int? MaxWidth { get; set; }
/// <summary>
/// Minimum width of the InfoWindow, regardless of the content's width.
/// When using this property, it is strongly recommended to set the minWidth to a value less than the width of the map (in pixels).
/// This value is only considered if it is set before a call to open().
/// To change the minimum width when changing content, call close(), setOptions(), and then open().
/// </summary>
public int? MinWidth { get; set; }

/// <summary>
/// The offset, in pixels, of the tip of the info window from the point on the map at whose geographical coordinates the info window is anchored.
/// If an InfoWindow is opened with an anchor, the pixelOffset will be calculated from the anchor's anchorPoint property.
/// </summary>
public Size PixelOffset { get; set; }
public Size? PixelOffset { get; set; }

/// <summary>
/// The LatLng at which to display this InfoWindow.
/// If the InfoWindow is opened with an anchor, the anchor's position will be used instead.
/// </summary>
public LatLngLiteral Position { get; set; }
public LatLngLiteral? Position { get; set; }

/// <summary>
/// All InfoWindows are displayed on the map in order of their zIndex, with higher values displaying in front of InfoWindows with lower values.
Expand Down

0 comments on commit 7a04780

Please sign in to comment.