Skip to content

Commit

Permalink
Merge pull request #170 from ArnoldV/develop
Browse files Browse the repository at this point in the history
Release 3.0.2
  • Loading branch information
robertjf committed Feb 9, 2024
2 parents 099099c + 3e37d2a commit 14a636d
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 8 deletions.
6 changes: 4 additions & 2 deletions Our.Umbraco.GMaps.Core/Models/Legacy/LegacyAddress.cs
Original file line number Diff line number Diff line change
@@ -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; }
}
}
3 changes: 3 additions & 0 deletions Our.Umbraco.GMaps.Core/Models/Legacy/LegacyMap.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
using Newtonsoft.Json;
using System.Runtime.Serialization;
using System.Text.Json.Serialization;

namespace Our.Umbraco.GMaps.Models.Legacy
{
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; }

}
Expand Down
9 changes: 6 additions & 3 deletions Our.Umbraco.GMaps.Core/Models/Legacy/LegacyMapConfig.cs
Original file line number Diff line number Diff line change
@@ -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; }
}
}
2 changes: 1 addition & 1 deletion Our.Umbraco.GMaps.Core/Our.Umbraco.GMaps.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>

<Version>3.0.1</Version>
<Version>3.0.2</Version>
<Authors>Arnold Visser</Authors>
<Company>Arnold Visser</Company>
<Description>Basic Google Maps with autocomplete property editor for Umbraco 8+. This package contains the Core DLL only.</Description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion Our.Umbraco.GMaps/Our.Umbraco.GMaps.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<IncludeBuildOutput>false</IncludeBuildOutput>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>

<Version>3.0.1</Version>
<Version>3.0.2</Version>
<Authors>Arnold Visser</Authors>
<Company>Arnold Visser</Company>
<Description>Basic Google Maps with autocomplete property editor for Umbraco 8+</Description>
Expand Down

0 comments on commit 14a636d

Please sign in to comment.