Skip to content

Commit

Permalink
Update LegacyMapConfig.cs to allow string or int zoom value
Browse files Browse the repository at this point in the history
  • Loading branch information
mistyn8 authored Apr 30, 2024
1 parent 3e37d2a commit 05f4e2a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Our.Umbraco.GMaps.Core/Models/Legacy/LegacyMapConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,20 @@ internal class LegacyMapConfig : MapConfig
[JsonPropertyName("mapcenter")]
public string MapCenter { get; set; }

[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public new string Zoom { get; set; }

[JsonProperty("zoom")]
[JsonPropertyName("zoom")]
public new string Zoom { get; set; }
public object _value
{
get
{
if (int.TryParse(Zoom, out var intValue)) return intValue;
return this.Zoom;
}
set { this.Zoom = value.ToString(); }
}
}
}

0 comments on commit 05f4e2a

Please sign in to comment.