rungwiroon / BlazorGoogleMaps

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

Support custom js marker constructor #244

Closed Nickztar closed 1 year ago

Nickztar commented 1 year ago

Today we have to use reflection to be able to construct a MarkerWithLabel. Here is a example of what we do: image

This adds a new method on marker allowing the user specify what js constructor to use. If it's off intrest I could add a example for it later.

Note: I'm not completely sure that calling it jsConstructor is the best but I feel like it fits for what it does in my case atleast.

Nickztar commented 1 year ago

Should probably be added for other methods that do the same thing. Like MarkerList. https://github.com/rungwiroon/BlazorGoogleMaps/blob/master/GoogleMapsComponents/Maps/Extension/MarkerList.cs#L35

valentasm1 commented 1 year ago

It looks like MarkerWithLabels is not part of google maps. It is additional package. Also why you just dont want to extend : ListableEntityBase and create you own class for MarkerWithLabels . Aslo letting pass anything in for constructor isnt good idea.

Nickztar commented 1 year ago

https://github.com/googlemaps/js-markerwithlabel

In the same way that MarkerCluster is a part of googlemaps.

valentasm1 commented 1 year ago

So then it is better to create seperate class.

Nickztar commented 1 year ago

Yes you are probably correct on that. Will try to change this PR later today or this weekend.

valentasm1 commented 1 year ago

Thank you very much for understanding.