rungwiroon / BlazorGoogleMaps

Blazor interop for GoogleMap library
MIT License
319 stars 102 forks source link

Support polymorphic serialization for MapStyles #257

Closed Nickztar closed 1 year ago

Nickztar commented 1 year ago

This fixes and issue where the stylers would just end up as empty objects when added since System.Text.Json could not figure out how to serialize them correctly. This also changes how MapTypeStyle is constructed since its no longer an object array but an array of the abstract class. This does however prevent that people implement their own style objects, but from my understanding that should never be needed since we have all the available styles specified in the project.

Testing this requires a api-key but if you check the map object in JS it now contains the correct styles.

valentasm1 commented 1 year ago

Thaaank you very much. Honestly i half dont care, half trust you so didnt tested it :).

Nickztar commented 1 year ago

image Works perfectly ;)