Skip to content

Conversation

@Nickztar
Copy link
Contributor

@Nickztar Nickztar commented Jul 1, 2025

Here's my suggestion for how to make it somewhat easier to work with, if the users want to get a component via the map they can use the .Components field and then filter based on the ComponentType. Registering new components would be a bit simpler and they can implement the interface to get it to work. This way users can implement their own components, apart from the fact that the events won't really work.

Settings this as a draft for now, until im sure this is a good solution and I will fix some other parts from the previous PR

Copy link
Collaborator

@valentasm1 valentasm1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honesly i am more conserned about js part, but c# part looks good. Also i dont think it is complex to optimize c#. Worst case use reflaction with some caching or some expressions.

void SetDisposed();
}

public enum MapComponentType
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As i see you dont use it anywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I implemented them for each component: https://github.com/rungwiroon/BlazorGoogleMaps/pull/434/files#diff-987163f27f6bdfea202261756380d8e45309d03c83b67350cda463acf851cdb7R23

This way the user can easily filter the AdvancedMap.Components.Where(x => x.ComponentType is MapComponentType.Marker) and then do marker specific stuff is my thoughts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants