rungwiroon / BlazorGoogleMaps

Blazor interop for GoogleMap library
MIT License
325 stars 105 forks source link

Custom controls not being added in specified position #300

Closed Enritski closed 9 months ago

Enritski commented 9 months ago

Fixed issue where AddControl, RemoveControl and RemoveControls methods of Map object did not honour the specified ControlPosition.

Updated MapLegendPage in ServerSideDemo to allow selecting the position where the legend will be added.

Enritski commented 9 months ago

Oops - looks like some of this has already been addressed in recent PRs. Didn't realise that I wasn't up-to-date before pushing. Will close this.

Enritski commented 9 months ago

@valentasm Actually, the recent changes do not address this issue and the bug still remains. However, I see there have been discussions in other PRs about how best to address the issue of correctly serializing the values on Enums. I took a rather brute force approach and added an extension method to help retrieving the EnumValueAttrribute, then called it explicitly in the AddControl, RemoveControl and RemoveControls methods of the Map class. It works but may not be as elegant as other solutions...

valentasm1 commented 9 months ago

~Could you give extenstion code?~ I will try to check this week

Enritski commented 9 months ago

~Could you give extenstion code?~ I will try to check this week

I tried to reopen this PR for you, but could not because it says "The master branch was force-pushed or recreated". I can submit another, if you like. Otherwise, you can see the extension method I wrote here: https://github.com/rungwiroon/BlazorGoogleMaps/pull/300/commits/b587e8dfcac145ecc54544a6967ace00bfeb57e8#diff-4aa7e003db3ec7af3fb90792023c77f74f79e04872fc93ac05c40616d7f420f4

valentasm1 commented 9 months ago

https://www.nuget.org/packages/BlazorGoogleMaps/3.3.2