diff --git a/Our.Umbraco.GMaps.Core/Models/Legacy/LegacyAddress.cs b/Our.Umbraco.GMaps.Core/Models/Legacy/LegacyAddress.cs index 8c6a91e..d4eb6a4 100644 --- a/Our.Umbraco.GMaps.Core/Models/Legacy/LegacyAddress.cs +++ b/Our.Umbraco.GMaps.Core/Models/Legacy/LegacyAddress.cs @@ -1,10 +1,12 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; +using Newtonsoft.Json; namespace Our.Umbraco.GMaps.Models.Legacy { internal class LegacyAddress : Address { [JsonProperty("latlng")] - internal string LatLng { get; set; } + [JsonPropertyName("latlng")] + public string LatLng { get; set; } } } \ No newline at end of file diff --git a/Our.Umbraco.GMaps.Core/Models/Legacy/LegacyMap.cs b/Our.Umbraco.GMaps.Core/Models/Legacy/LegacyMap.cs index 6e16fc5..b24fed7 100644 --- a/Our.Umbraco.GMaps.Core/Models/Legacy/LegacyMap.cs +++ b/Our.Umbraco.GMaps.Core/Models/Legacy/LegacyMap.cs @@ -1,5 +1,6 @@ using Newtonsoft.Json; using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Our.Umbraco.GMaps.Models.Legacy { @@ -7,10 +8,12 @@ internal class LegacyMap { [DataMember(Name = "address")] [JsonProperty("address")] + [JsonPropertyName("address")] internal LegacyAddress Address { get; set; } [DataMember(Name = "mapconfig")] [JsonProperty("mapconfig")] + [JsonPropertyName("mapconfig")] internal LegacyMapConfig MapConfig { get; set; } } diff --git a/Our.Umbraco.GMaps.Core/Models/Legacy/LegacyMapConfig.cs b/Our.Umbraco.GMaps.Core/Models/Legacy/LegacyMapConfig.cs index 7f7c3f6..4fb2c53 100644 --- a/Our.Umbraco.GMaps.Core/Models/Legacy/LegacyMapConfig.cs +++ b/Our.Umbraco.GMaps.Core/Models/Legacy/LegacyMapConfig.cs @@ -1,13 +1,16 @@ -using Newtonsoft.Json; +using System.Text.Json.Serialization; +using Newtonsoft.Json; namespace Our.Umbraco.GMaps.Models { internal class LegacyMapConfig : MapConfig { [JsonProperty("mapcenter")] - internal string MapCenter { get; set; } + [JsonPropertyName("mapcenter")] + public string MapCenter { get; set; } [JsonProperty("zoom")] - internal new string Zoom { get; set; } + [JsonPropertyName("zoom")] + public new string Zoom { get; set; } } } diff --git a/Our.Umbraco.GMaps.Core/Our.Umbraco.GMaps.Core.csproj b/Our.Umbraco.GMaps.Core/Our.Umbraco.GMaps.Core.csproj index fec06c2..5418126 100644 --- a/Our.Umbraco.GMaps.Core/Our.Umbraco.GMaps.Core.csproj +++ b/Our.Umbraco.GMaps.Core/Our.Umbraco.GMaps.Core.csproj @@ -3,7 +3,7 @@ net6.0;net7.0 True - 3.0.1 + 3.0.2 Arnold Visser Arnold Visser Basic Google Maps with autocomplete property editor for Umbraco 8+. This package contains the Core DLL only. diff --git a/Our.Umbraco.GMaps.Core/PropertyValueConverter/SingleMapPropertyValueConverter.cs b/Our.Umbraco.GMaps.Core/PropertyValueConverter/SingleMapPropertyValueConverter.cs index 48c5502..557d739 100644 --- a/Our.Umbraco.GMaps.Core/PropertyValueConverter/SingleMapPropertyValueConverter.cs +++ b/Our.Umbraco.GMaps.Core/PropertyValueConverter/SingleMapPropertyValueConverter.cs @@ -50,7 +50,10 @@ public override object ConvertIntermediateToObject(IPublishedElement owner, IPub // Map the LatLng property. model.Address.Coordinates = Location.Parse(intermediate.Address.LatLng); model.MapConfig.CenterCoordinates = Location.Parse(intermediate.MapConfig.MapCenter); - model.MapConfig.Zoom = string.IsNullOrEmpty(intermediate.MapConfig.Zoom) ? 17 : Convert.ToInt32(intermediate.MapConfig.Zoom); + if (model.MapConfig.Zoom == 0) + { + model.MapConfig.Zoom = string.IsNullOrEmpty(intermediate.MapConfig.Zoom) ? 17 : Convert.ToInt32(intermediate.MapConfig.Zoom); + } } else { diff --git a/Our.Umbraco.GMaps/Our.Umbraco.GMaps.csproj b/Our.Umbraco.GMaps/Our.Umbraco.GMaps.csproj index c7c8804..8397596 100644 --- a/Our.Umbraco.GMaps/Our.Umbraco.GMaps.csproj +++ b/Our.Umbraco.GMaps/Our.Umbraco.GMaps.csproj @@ -7,7 +7,7 @@ false true - 3.0.1 + 3.0.2 Arnold Visser Arnold Visser Basic Google Maps with autocomplete property editor for Umbraco 8+