Comments (13)
Pull Request to Add .NET 8 To Blazor in 4.1 Branch
#2329
from mapsui.
@pauldendulk Can confirm, Mapsui 4 does work in a Blazor 8 project, based on the new webapp auto rendering template.
@jirisykora83 Sorry, was a long day, gave you duff advice, install 'Microsoft.AspNetCore.Components.Web 8.0.0' nuget into your wasm client project, not 'Microsoft.AspNetCore.Components.WebAssembly'
One thing though...Mapsui works great in Blazor, thanks again @inforithmics, but have discovered if I publish the wasm client with AOT enabled, the map fails to load. I don't get any exceptions, no trim warnings during publish, nothing, AOT just seems to break something. Curious if that's a known issue or something to do with the dotnet 7 dependencies?
from mapsui.
@pauldendulk Can confirm, Mapsui 4 does work in a Blazor 8 project, based on the new webapp auto rendering template.
@jirisykora83 Sorry, was a long day, gave you duff advice, install 'Microsoft.AspNetCore.Components.Web 8.0.0' nuget into your wasm client project, not 'Microsoft.AspNetCore.Components.WebAssembly'
One thing though...Mapsui works great in Blazor, thanks again @inforithmics, but have discovered if I publish the wasm client with AOT enabled, the map fails to load. I don't get any exceptions, no trim warnings during publish, nothing, AOT just seems to break something. Curious if that's a known issue or something to do with the dotnet 7 dependencies?
Thank you adding Microsoft.AspNetCore.Components.Web
fix build. There are still some warnings but at least build works.
I do not use AOT but there was LinkerConfig not sure if it is still supported.
from mapsui.
I have not investigated AOT at all so far. Guess it is time to start to think about it, but I don't think we will support it in v5. A quick search shows we use System.Reflection in a couple of places. It seems superficial though, not unfixable. Further it is important that SkiaSharp support AOT, did not look at that at all.
About showing an error to the user. If it writes something to the logger this would be enough for me (perhaps that already happens). We are working on ways to make the logging more visible to developers.
from mapsui.
As a workaround, add nuget package Microsoft.AspNetCore.Components.WebAssembly 8.0.0 to your project.
from mapsui.
Microsoft.AspNetCore.Components.WebAssembly
I do not understand blazor project (which reference Mapsui,Blazor already have Microsoft.AspNetCore.Components.WebAssembly
reference (as i think it is included by default in blazor client project)
from mapsui.
I can not give a lot of attention to these platform specific issues. The issue you face is caused by the upper limit we set in our nuget. It is easy to remove that limit but it still may not function. I am not sure how Blazor compatibility works. We are building with Blazor 7 and I would think you really need to build with Blazor 8 to deal with breaking changes. If so, you need to wait for Mapsui v5.
@p2pbsh did you get Mapsui 4 to work in Blazor 8?
from mapsui.
I can not give a lot of attention to these platform specific issues. The issue you face is caused by the upper limit we set in our nuget. It is easy to remove that limit but it still may not function. I am not sure how Blazor compatibility works. We are building with Blazor 7 and I would think you really need to build with Blazor 8 to deal with breaking changes. If so, you need to wait for Mapsui v5.
@p2pbsh did you get Mapsui 4 to work in Blazor 8?
Yes, I am building with (migrating to) .net 8. As for all projects we have it was just updating nuget (or wait for nuget to update if their use upper limit as for us it was just npgsql and mapsui) & change version basically. I am not too familiar with MAUI & android/ios developing but I guess there is lot more works between version. If blazor isn't priority maybe you can remove the upper limit as if it isn't working then we still have to wait for new major release anyway and if it works then it is fine.
from mapsui.
AOT can not be used in all situations. Mapsui has a lot of dependencies so it is likely there is something in there which is not compatible with AOT. I think this is a problem Blazor 8 as well. It would be nice if we could support AOT though.
from mapsui.
Ok, cheers Paul. I'm guessing there's something in there that needs reflection, which seems to be the primary crusher of aot dreams.
Hardly a high priority, but currently mapsui will happily build in aot then silently fail, not sure how to do it, but would be handy to propogate an aot compatability behaviour warning to the user like you see in the dotnet libs.
from mapsui.
dotnet AOT is a bit wild west at the moment so I imagine the migration path will be a little smoother further down the road. That said, basic dotnet performance on wasm is not particularly great, being able to AOT buys huge performance gains, so Mapsui support would be pretty cool :)
I did check on Skia out of curiosity, apparently its used in AOT on UNO, but don't quote me on that, haven't ran it personally.
from mapsui.
I have a quite complicated blazor component with a SKGLView and a lot of skiasharp in the code and it works in wasm AOT but no map in a mapsui component. If this can be of any help
from mapsui.
@pilotshamn So SkiaSharp support AOT, good. That is one requirement checked.
from mapsui.
Related Issues (20)
- Make the MapControl disposable and not the Map
- GeometryFeature disappears while panning HOT 9
- BitmapRegistry.Unregister() doesn't remove bitmap from lookup array HOT 3
- Callout not always on top HOT 6
- Drawing order different to map info order HOT 4
- More shared touch/mouse handling over all platforms HOT 7
- When touching and holding a long press, mapControl becomes blank HOT 6
- OSM MapControl does not work in Avalonia Browser when using .NET 8 HOT 8
- Regression tests crash on GeoTiff HOT 5
- Incorrect zoom behavior HOT 3
- Suddenly blank map is displayed for all KnownTileSources HOT 4
- Add feature sorting mechanism HOT 2
- Rewrite test-image-copier.cmd to powershell
- Remove the number prefix from all our samples HOT 1
- System.NullReferenceException when replacing TileLayer. HOT 4
- Replace ILayer.Style with a ILayer.Styles like IFeature.Styles HOT 2
- MyLocationLayer with animation results in tiles not loading HOT 8
- Crash after click on "Attribution" label on Linux (Mapsui Avalonia) HOT 2
- EditingWidget redesign HOT 2
- Any way to draw different colors along the normal direction of the line using an offset value? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapsui.