Closed tombrewer-onwave closed 1 year ago
I this case i decided to migrate to system.text.json from json.net. I think i will be done till next sunday. Here is branch with most of changes are done. I started with marker testing/fixing and then move to other parts. When changed done i will take a look at your issue.
https://github.com/rungwiroon/BlazorGoogleMaps/tree/system.text.json_migration
Ok - I can't get that branch to build at the moment for the server side demo, but let me know if you want me to try or test anything out.
Thank you for your help. I lost patience when when everything started to show errors :). Just left till next weekend. Marker demo is working so i need to added remaining attributes for rest of the project. Will let you know.
Migration done. I am not sure if this functionality even posible out of the box. Do you have pure js example?
When using the call-back (Func) functionality to vary the style options (based on feature properties) it attempts to serialize the Func and fails with a Newtonsoft.Json.JsonSerializationException: 'Self referencing loop detected for property 'module' with type 'System.Reflection.RuntimeModule'. Path 'method.module.assembly.entryPoint'.'
For example if you add a line to MapDataPage.razor in the server-side examples at the bottom of GetMapDataFeature() after the line 'await _map1.InteropObject.Data.AddGeoJson(rootFeature);' the exception is thrown when you run and click Get MapData (Feature).
await _map1.InteropObject.Data.SetStyle(new Func<Feature, StyleOptions>((feat) => { return new StyleOptions { StrokeColor = "blue", StrokeWeight = 2, FillColor = "magenta", FillOpacity = 0.3f }; }));![Code](https://user-images.githubusercontent.com/122376907/225686434-772fda76-5ada-4db0-aee4-be7a472e12d1.PNG)