Umbraco v8 (GMaps: 1.3.3) to Umbraco v10 (GMaps 3.0.0) legacy data value converter issues
Opened this issue · 1 comments
AndyBoot commented
I'm currently upgrading an Umbraco 8 site to Umbraco 10+, GMaps 1.3.3 to 3.0.0. I'm getting parsing issues related to this package when reading & writing data using the Map
object.
On debugging SingleMapPropertyValueConverter.cs
I've found the following json isn't successfully deserializing into the LegacyMap
object.
{"address":{"latlng":"53.5879923, -2.5384524","full_address":"mansell house","postalcode":"bl6 6qq","city":"horwich","state":"england","country":"united kingdom"},"mapconfig":{"zoom":16,"maptype":"roadmap","mapcenter":"53.58793457153, -2.5383417500000194"}}
Both the Address
and MapConfig
properties are just null
for the intermediate
variable.
I've managed to resolve this by applying the following changes:
LegacyAddress.cs
- changingLatLng
frominternal
topublic
. Adding[JsonPropertyName("latlng")]
.LegacyMapConfig.cs
- changingMapCenter
frominternal
topublic
. Adding[JsonPropertyName("MapCenter")]
. In addition, I've also removed theZoom
property as I found it an unnecessary addition, and zoom parses perfectly fine without it.SingleMapPropertyValueConverter.cs
- Removed Line 50 (model.MapConfig.Zoom = ...
)
I hope this helps solidify this awesome package, and/or helps anybody else facing similar issues.
JohanReitsma83 commented