BlazorLeaflet icon indicating copy to clipboard operation
BlazorLeaflet copied to clipboard

List of outstanding features

Open PaulTodd opened this issue 5 years ago • 2 comments

I couldn't find a list of the outstanding features/API that needs to be worked on to fully wrap leaflet. I'd like to help, but I really don't know where to start. Could you provide an example of what is involved with wrapping one of the APIs? Or are there any good references to use to learn how to wrap js APIs?

Thanks

PaulTodd avatar Jul 15 '20 14:07 PaulTodd

[ Disclaimer: I'm not the maintainer. ]

I couldn't find a list of the outstanding features/API that needs to be worked on to fully wrap leaflet.

Leaflet is fairly large (not to mention there's quite a few plug-ins), so I'm not sure "fully" is a realistic goal.

I'd like to help, but I really don't know where to start. Could you provide an example of what is involved with wrapping one of the APIs? Or are there any good references to use to learn how to wrap js APIs?

You can look at some of the existing pull requests.

Most wrappers look roughly like this:

  • there's added methods and/or properties on the model classes (e.g. Map.cs, or Models/Layer.cs)
  • those then call into LeafletInterops.cs, which serves as the interop 'hub' from the C# side
  • that in turn calls into wwwroot/leafletBlazorInterops.js, which talks directly to Leaflet

For the general concepts, limitations, etc. of JS interop in Blazor, you can learn from sites such as:

  • Blazor University: https://blazor-university.com/javascript-interop/calling-javascript-from-dotnet/
  • Microsoft's docs: https://docs.microsoft.com/en-us/aspnet/core/blazor/call-javascript-from-dotnet?view=aspnetcore-3.1

chucker avatar Jul 15 '20 15:07 chucker

That's true! I doubt Leaflet will ever be fully wrapped, but I'd like to see how far we can go. :) Those look like great resources. Thank you for describing the general process the wrapper goes through. I'll start researching that and see if there's anything valuable I can contribute to this project.

PaulTodd avatar Jul 15 '20 18:07 PaulTodd