Skip to content

Commit

Permalink
Merge pull request #172 from mistyn8/patch-2
Browse files Browse the repository at this point in the history
Update LegacyMapConfig.cs to allow string or int zoom value
  • Loading branch information
robertjf authored May 1, 2024
2 parents 3e37d2a + 05f4e2a commit 5d2d7ec
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 5d2d7ec

Please sign in to comment.